merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / controller / chartapiwrapper / ChartDataWrapper.hxx
bloba6422269960ccff92d7208e60e8e38d1f557856e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ChartDataWrapper.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_CHARTDATAWRAPPER_HXX
31 #define CHART_CHARTDATAWRAPPER_HXX
33 #include "ServiceMacros.hxx"
34 #include "MutexContainer.hxx"
35 #include <cppuhelper/implbase4.hxx>
36 #include <cppuhelper/interfacecontainer.hxx>
37 #include <com/sun/star/chart/XChartDataArray.hpp>
38 #include <com/sun/star/lang/XComponent.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/chart2/XChartDocument.hpp>
41 #include <com/sun/star/uno/XComponentContext.hpp>
43 #include <boost/shared_ptr.hpp>
45 namespace chart
47 namespace wrapper
50 class Chart2ModelContact;
52 class ChartDataWrapper : public MutexContainer, public
53 ::cppu::WeakImplHelper4<
54 com::sun::star::chart::XChartDataArray,
55 com::sun::star::lang::XServiceInfo,
56 com::sun::star::lang::XEventListener,
57 com::sun::star::lang::XComponent >
59 public:
60 ChartDataWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
61 virtual ~ChartDataWrapper();
63 /// XServiceInfo declarations
64 APPHELPER_XSERVICEINFO_DECL()
66 protected:
67 // ____ XChartDataArray ____
68 virtual ::com::sun::star::uno::Sequence<
69 ::com::sun::star::uno::Sequence<
70 double > > SAL_CALL getData()
71 throw (::com::sun::star::uno::RuntimeException);
72 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence<
73 ::com::sun::star::uno::Sequence<
74 double > >& aData )
75 throw (::com::sun::star::uno::RuntimeException);
76 virtual ::com::sun::star::uno::Sequence<
77 ::rtl::OUString > SAL_CALL getRowDescriptions()
78 throw (::com::sun::star::uno::RuntimeException);
79 virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence<
80 ::rtl::OUString >& aRowDescriptions )
81 throw (::com::sun::star::uno::RuntimeException);
82 virtual ::com::sun::star::uno::Sequence<
83 ::rtl::OUString > SAL_CALL getColumnDescriptions()
84 throw (::com::sun::star::uno::RuntimeException);
85 virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence<
86 ::rtl::OUString >& aColumnDescriptions )
87 throw (::com::sun::star::uno::RuntimeException);
89 // ____ XChartData (base of XChartDataArray) ____
90 virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference<
91 ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
92 throw (::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference<
94 ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
95 throw (::com::sun::star::uno::RuntimeException);
96 virtual double SAL_CALL getNotANumber()
97 throw (::com::sun::star::uno::RuntimeException);
98 virtual sal_Bool SAL_CALL isNotANumber( double nNumber )
99 throw (::com::sun::star::uno::RuntimeException);
101 // ____ XComponent ____
102 virtual void SAL_CALL dispose()
103 throw (::com::sun::star::uno::RuntimeException);
104 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
105 ::com::sun::star::lang::XEventListener >& xListener )
106 throw (::com::sun::star::uno::RuntimeException);
107 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
108 ::com::sun::star::lang::XEventListener >& aListener )
109 throw (::com::sun::star::uno::RuntimeException);
111 // ____ XEventListener ____
112 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
113 throw (::com::sun::star::uno::RuntimeException);
116 void fireChartDataChangeEvent( ::com::sun::star::chart::ChartDataChangeEvent& aEvent );
118 private:
119 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
120 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
122 ::com::sun::star::uno::Sequence<
123 ::com::sun::star::uno::Sequence< double > > m_aData;
124 ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aColumnDescriptions;
125 ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aRowDescriptions;
127 /// re-reads the data from the model
128 void refreshData();
130 /// applies changed data to model
131 void applyData( bool bSetValues, bool bSetRowDescriptions, bool bSetColumnDescriptions );
134 } // namespace wrapper
135 } // namespace chart
137 // CHART_CHARTDATAWRAPPER_HXX
138 #endif