1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_CHARTDATAWRAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_CHARTDATAWRAPPER_HXX
22 #include "MutexContainer.hxx"
23 #include <cppuhelper/implbase5.hxx>
24 #include <cppuhelper/interfacecontainer.hxx>
25 #include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
26 #include <com/sun/star/chart/XDateCategories.hpp>
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/chart2/XChartDocument.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <boost/shared_ptr.hpp>
39 class Chart2ModelContact
;
42 class ChartDataWrapper
: public MutexContainer
, public
43 ::cppu::WeakImplHelper5
<
44 com::sun::star::chart2::XAnyDescriptionAccess
,
45 com::sun::star::chart::XDateCategories
,
46 com::sun::star::lang::XServiceInfo
,
47 com::sun::star::lang::XEventListener
,
48 com::sun::star::lang::XComponent
>
51 ChartDataWrapper( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
52 ChartDataWrapper( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
53 , const ::com::sun::star::uno::Reference
< ::com::sun::star::chart::XChartData
>& xNewData
);
54 virtual ~ChartDataWrapper();
56 /// XServiceInfo declarations
57 virtual OUString SAL_CALL
getImplementationName()
58 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
59 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
60 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
61 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
62 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
64 static OUString
getImplementationName_Static();
65 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
68 // ____ XDateCategories ____
69 virtual ::com::sun::star::uno::Sequence
< double > SAL_CALL
getDateCategories() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
70 virtual void SAL_CALL
setDateCategories( const ::com::sun::star::uno::Sequence
< double >& rDates
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 // ____ XAnyDescriptionAccess ____
73 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> > SAL_CALL
74 getAnyRowDescriptions() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
75 virtual void SAL_CALL
setAnyRowDescriptions(
76 const ::com::sun::star::uno::Sequence
<
77 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> >& aRowDescriptions
)
78 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> > SAL_CALL
80 getAnyColumnDescriptions() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
setAnyColumnDescriptions(
82 const ::com::sun::star::uno::Sequence
<
83 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> >& aColumnDescriptions
)
84 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 // ____ XComplexDescriptionAccess (base of XAnyDescriptionAccess) ____
87 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< OUString
> > SAL_CALL
88 getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual void SAL_CALL
setComplexRowDescriptions(
90 const ::com::sun::star::uno::Sequence
<
91 ::com::sun::star::uno::Sequence
< OUString
> >& aRowDescriptions
)
92 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< OUString
> > SAL_CALL
94 getComplexColumnDescriptions() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
95 virtual void SAL_CALL
setComplexColumnDescriptions(
96 const ::com::sun::star::uno::Sequence
<
97 ::com::sun::star::uno::Sequence
< OUString
> >& aColumnDescriptions
)
98 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 // ____ XChartDataArray (base of XComplexDescriptionAccess) ____
101 virtual ::com::sun::star::uno::Sequence
<
102 ::com::sun::star::uno::Sequence
<
103 double > > SAL_CALL
getData()
104 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 virtual void SAL_CALL
setData( const ::com::sun::star::uno::Sequence
<
106 ::com::sun::star::uno::Sequence
<
108 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual ::com::sun::star::uno::Sequence
<
110 OUString
> SAL_CALL
getRowDescriptions()
111 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual void SAL_CALL
setRowDescriptions( const ::com::sun::star::uno::Sequence
<
113 OUString
>& aRowDescriptions
)
114 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 virtual ::com::sun::star::uno::Sequence
<
116 OUString
> SAL_CALL
getColumnDescriptions()
117 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 virtual void SAL_CALL
setColumnDescriptions( const ::com::sun::star::uno::Sequence
<
119 OUString
>& aColumnDescriptions
)
120 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
122 // ____ XChartData (base of XChartDataArray) ____
123 virtual void SAL_CALL
addChartDataChangeEventListener( const ::com::sun::star::uno::Reference
<
124 ::com::sun::star::chart::XChartDataChangeEventListener
>& aListener
)
125 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
126 virtual void SAL_CALL
removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference
<
127 ::com::sun::star::chart::XChartDataChangeEventListener
>& aListener
)
128 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 virtual double SAL_CALL
getNotANumber()
130 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
131 virtual sal_Bool SAL_CALL
isNotANumber( double nNumber
)
132 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
134 // ____ XComponent ____
135 virtual void SAL_CALL
dispose()
136 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
137 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
<
138 ::com::sun::star::lang::XEventListener
>& xListener
)
139 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
140 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
<
141 ::com::sun::star::lang::XEventListener
>& aListener
)
142 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
144 // ____ XEventListener ____
145 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
146 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
148 void fireChartDataChangeEvent( ::com::sun::star::chart::ChartDataChangeEvent
& aEvent
);
151 void switchToInternalDataProvider();
152 void initDataAccess();
153 void applyData( lcl_Operator
& rDataOperator
);
156 ::com::sun::star::uno::Reference
<
157 ::com::sun::star::chart2::XAnyDescriptionAccess
> m_xDataAccess
;
159 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
160 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer
;
163 } // namespace wrapper
166 // INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_CHARTDATAWRAPPER_HXX
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */