merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / controller / chartapiwrapper / DiagramWrapper.hxx
blob92ce0d9fae9389c30bc3144d43d876f7f4b690f4
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: DiagramWrapper.hxx,v $
10 * $Revision: 1.9 $
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_DIAGRAMWRAPPER_HXX
31 #define CHART_DIAGRAMWRAPPER_HXX
33 #include "WrappedPropertySet.hxx"
34 #include "ServiceMacros.hxx"
35 #include "DiagramHelper.hxx"
36 #include <cppuhelper/implbase11.hxx>
37 #include <comphelper/uno3.hxx>
38 #include <cppuhelper/interfacecontainer.hxx>
39 #include <com/sun/star/chart2/XChartDocument.hpp>
40 #include <com/sun/star/chart2/XDiagram.hpp>
41 #include <com/sun/star/uno/XComponentContext.hpp>
42 #include <com/sun/star/chart2/XDiagramProvider.hpp>
43 #include <com/sun/star/chart2/XChartTypeTemplate.hpp>
44 #include <com/sun/star/chart2/XChartTypeManager.hpp>
45 #include <com/sun/star/chart/XDiagram.hpp>
46 #include <com/sun/star/chart/XAxisZSupplier.hpp>
47 #include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
48 #include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
49 #include <com/sun/star/chart/XStatisticDisplay.hpp>
50 #include <com/sun/star/chart/X3DDisplay.hpp>
51 #include <com/sun/star/lang/XServiceInfo.hpp>
52 #include <com/sun/star/lang/XComponent.hpp>
53 #include <com/sun/star/lang/XEventListener.hpp>
54 #include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
56 #include <com/sun/star/chart/X3DDefaultSetter.hpp>
57 #include <boost/shared_ptr.hpp>
59 namespace chart
62 namespace wrapper
65 class Chart2ModelContact;
67 class DiagramWrapper : public ::cppu::ImplInheritanceHelper11<
68 WrappedPropertySet
69 , ::com::sun::star::chart::XDiagram
70 , ::com::sun::star::chart::XAxisZSupplier
71 , ::com::sun::star::chart::XTwoAxisXSupplier // : XAxisXSupplier
72 , ::com::sun::star::chart::XTwoAxisYSupplier // : XAxisYSupplier
73 , ::com::sun::star::chart::XStatisticDisplay
74 , ::com::sun::star::chart::X3DDisplay
75 , ::com::sun::star::chart::X3DDefaultSetter
76 , ::com::sun::star::lang::XServiceInfo
77 , ::com::sun::star::lang::XComponent
78 // , ::com::sun::star::lang::XEventListener
79 , ::com::sun::star::chart2::XDiagramProvider
80 , ::com::sun::star::chart::XSecondAxisTitleSupplier
83 public:
84 DiagramWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
85 virtual ~DiagramWrapper();
87 /// XServiceInfo declarations
88 APPHELPER_XSERVICEINFO_DECL()
90 // ____ XComponent ____
91 virtual void SAL_CALL dispose()
92 throw (::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
94 ::com::sun::star::lang::XEventListener >& xListener )
95 throw (::com::sun::star::uno::RuntimeException);
96 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
97 ::com::sun::star::lang::XEventListener >& aListener )
98 throw (::com::sun::star::uno::RuntimeException);
100 // ____ XDiagram ____
101 virtual ::rtl::OUString SAL_CALL getDiagramType()
102 throw (::com::sun::star::uno::RuntimeException);
103 virtual ::com::sun::star::uno::Reference<
104 ::com::sun::star::beans::XPropertySet > SAL_CALL getDataRowProperties( sal_Int32 nRow )
105 throw (::com::sun::star::lang::IndexOutOfBoundsException,
106 ::com::sun::star::uno::RuntimeException);
107 virtual ::com::sun::star::uno::Reference<
108 ::com::sun::star::beans::XPropertySet > SAL_CALL getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
109 throw (::com::sun::star::lang::IndexOutOfBoundsException,
110 ::com::sun::star::uno::RuntimeException);
112 // ____ XShape (base of XDiagram) ____
113 virtual ::com::sun::star::awt::Point SAL_CALL getPosition()
114 throw (::com::sun::star::uno::RuntimeException);
115 virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition )
116 throw (::com::sun::star::uno::RuntimeException);
117 virtual ::com::sun::star::awt::Size SAL_CALL getSize()
118 throw (::com::sun::star::uno::RuntimeException);
119 virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize )
120 throw (::com::sun::star::beans::PropertyVetoException,
121 ::com::sun::star::uno::RuntimeException);
123 // ____ XShapeDescriptor (base of XShape) ____
124 virtual ::rtl::OUString SAL_CALL getShapeType()
125 throw (::com::sun::star::uno::RuntimeException);
127 // ____ XAxisZSupplier ____
128 virtual ::com::sun::star::uno::Reference<
129 ::com::sun::star::drawing::XShape > SAL_CALL getZAxisTitle()
130 throw (::com::sun::star::uno::RuntimeException);
131 virtual ::com::sun::star::uno::Reference<
132 ::com::sun::star::beans::XPropertySet > SAL_CALL getZMainGrid()
133 throw (::com::sun::star::uno::RuntimeException);
134 virtual ::com::sun::star::uno::Reference<
135 ::com::sun::star::beans::XPropertySet > SAL_CALL getZHelpGrid()
136 throw (::com::sun::star::uno::RuntimeException);
137 virtual ::com::sun::star::uno::Reference<
138 ::com::sun::star::beans::XPropertySet > SAL_CALL getZAxis()
139 throw (::com::sun::star::uno::RuntimeException);
141 // ____ XTwoAxisXSupplier ____
142 virtual ::com::sun::star::uno::Reference<
143 ::com::sun::star::beans::XPropertySet > SAL_CALL getSecondaryXAxis()
144 throw (::com::sun::star::uno::RuntimeException);
146 // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
147 virtual ::com::sun::star::uno::Reference<
148 ::com::sun::star::drawing::XShape > SAL_CALL getXAxisTitle()
149 throw (::com::sun::star::uno::RuntimeException);
150 virtual ::com::sun::star::uno::Reference<
151 ::com::sun::star::beans::XPropertySet > SAL_CALL getXAxis()
152 throw (::com::sun::star::uno::RuntimeException);
153 virtual ::com::sun::star::uno::Reference<
154 ::com::sun::star::beans::XPropertySet > SAL_CALL getXMainGrid()
155 throw (::com::sun::star::uno::RuntimeException);
156 virtual ::com::sun::star::uno::Reference<
157 ::com::sun::star::beans::XPropertySet > SAL_CALL getXHelpGrid()
158 throw (::com::sun::star::uno::RuntimeException);
160 // ____ XTwoAxisYSupplier ____
161 virtual ::com::sun::star::uno::Reference<
162 ::com::sun::star::beans::XPropertySet > SAL_CALL getSecondaryYAxis()
163 throw (::com::sun::star::uno::RuntimeException);
165 // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
166 virtual ::com::sun::star::uno::Reference<
167 ::com::sun::star::drawing::XShape > SAL_CALL getYAxisTitle()
168 throw (::com::sun::star::uno::RuntimeException);
169 virtual ::com::sun::star::uno::Reference<
170 ::com::sun::star::beans::XPropertySet > SAL_CALL getYAxis()
171 throw (::com::sun::star::uno::RuntimeException);
172 virtual ::com::sun::star::uno::Reference<
173 ::com::sun::star::beans::XPropertySet > SAL_CALL getYHelpGrid()
174 throw (::com::sun::star::uno::RuntimeException);
175 virtual ::com::sun::star::uno::Reference<
176 ::com::sun::star::beans::XPropertySet > SAL_CALL getYMainGrid()
177 throw (::com::sun::star::uno::RuntimeException);
179 // ____ XSecondAxisTitleSupplier ____
180 virtual ::com::sun::star::uno::Reference<
181 ::com::sun::star::drawing::XShape > SAL_CALL getSecondXAxisTitle()
182 throw (::com::sun::star::uno::RuntimeException);
183 virtual ::com::sun::star::uno::Reference<
184 ::com::sun::star::drawing::XShape > SAL_CALL getSecondYAxisTitle()
185 throw (::com::sun::star::uno::RuntimeException);
187 // ____ XStatisticDisplay ____
188 virtual ::com::sun::star::uno::Reference<
189 ::com::sun::star::beans::XPropertySet > SAL_CALL getUpBar()
190 throw (::com::sun::star::uno::RuntimeException);
191 virtual ::com::sun::star::uno::Reference<
192 ::com::sun::star::beans::XPropertySet > SAL_CALL getDownBar()
193 throw (::com::sun::star::uno::RuntimeException);
194 virtual ::com::sun::star::uno::Reference<
195 ::com::sun::star::beans::XPropertySet > SAL_CALL getMinMaxLine()
196 throw (::com::sun::star::uno::RuntimeException);
198 // ____ X3DDisplay ____
199 virtual ::com::sun::star::uno::Reference<
200 ::com::sun::star::beans::XPropertySet > SAL_CALL getWall()
201 throw (::com::sun::star::uno::RuntimeException);
202 virtual ::com::sun::star::uno::Reference<
203 ::com::sun::star::beans::XPropertySet > SAL_CALL getFloor()
204 throw (::com::sun::star::uno::RuntimeException);
206 // ____ X3DDefaultSetter ____
207 virtual void SAL_CALL set3DSettingsToDefault() throw (::com::sun::star::uno::RuntimeException);
208 virtual void SAL_CALL setDefaultRotation() throw (::com::sun::star::uno::RuntimeException);
209 virtual void SAL_CALL setDefaultIllumination() throw (::com::sun::star::uno::RuntimeException);
211 // // ____ XEventListener ____
212 // virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
213 // throw (::com::sun::star::uno::RuntimeException);
215 // ____ XDiagramProvider ____
216 virtual ::com::sun::star::uno::Reference<
217 ::com::sun::star::chart2::XDiagram > SAL_CALL getDiagram()
218 throw (::com::sun::star::uno::RuntimeException);
219 virtual void SAL_CALL setDiagram( const ::com::sun::star::uno::Reference<
220 ::com::sun::star::chart2::XDiagram >& xDiagram )
221 throw (::com::sun::star::uno::RuntimeException);
223 protected:
224 // ____ WrappedPropertySet ____
225 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
226 virtual const std::vector< WrappedProperty* > createWrappedProperties();
227 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
229 private:
230 void updateFromModel();
232 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
233 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
235 ::com::sun::star::uno::Reference<
236 ::com::sun::star::drawing::XShape >
237 m_xXAxisTitle;
238 ::com::sun::star::uno::Reference<
239 ::com::sun::star::drawing::XShape >
240 m_xYAxisTitle;
241 ::com::sun::star::uno::Reference<
242 ::com::sun::star::drawing::XShape >
243 m_xZAxisTitle;
244 ::com::sun::star::uno::Reference<
245 ::com::sun::star::drawing::XShape >
246 m_xSecondXAxisTitle;
247 ::com::sun::star::uno::Reference<
248 ::com::sun::star::drawing::XShape >
249 m_xSecondYAxisTitle;
251 ::com::sun::star::uno::Reference<
252 ::com::sun::star::beans::XPropertySet >
253 m_xXAxis;
254 ::com::sun::star::uno::Reference<
255 ::com::sun::star::beans::XPropertySet >
256 m_xYAxis;
257 ::com::sun::star::uno::Reference<
258 ::com::sun::star::beans::XPropertySet >
259 m_xZAxis;
260 ::com::sun::star::uno::Reference<
261 ::com::sun::star::beans::XPropertySet >
262 m_xSecondXAxis;
263 ::com::sun::star::uno::Reference<
264 ::com::sun::star::beans::XPropertySet >
265 m_xSecondYAxis;
267 ::com::sun::star::uno::Reference<
268 ::com::sun::star::beans::XPropertySet >
269 m_xXMainGrid;
270 ::com::sun::star::uno::Reference<
271 ::com::sun::star::beans::XPropertySet >
272 m_xYMainGrid;
273 ::com::sun::star::uno::Reference<
274 ::com::sun::star::beans::XPropertySet >
275 m_xZMainGrid;
276 ::com::sun::star::uno::Reference<
277 ::com::sun::star::beans::XPropertySet >
278 m_xXHelpGrid;
279 ::com::sun::star::uno::Reference<
280 ::com::sun::star::beans::XPropertySet >
281 m_xYHelpGrid;
282 ::com::sun::star::uno::Reference<
283 ::com::sun::star::beans::XPropertySet >
284 m_xZHelpGrid;
286 ::com::sun::star::uno::Reference<
287 ::com::sun::star::beans::XPropertySet >
288 m_xWall;
289 ::com::sun::star::uno::Reference<
290 ::com::sun::star::beans::XPropertySet >
291 m_xFloor;
293 ::com::sun::star::uno::Reference<
294 ::com::sun::star::beans::XPropertySet >
295 m_xMinMaxLineWrapper;
296 ::com::sun::star::uno::Reference<
297 ::com::sun::star::beans::XPropertySet >
298 m_xUpBarWrapper;
299 ::com::sun::star::uno::Reference<
300 ::com::sun::star::beans::XPropertySet >
301 m_xDownBarWrapper;
304 } // namespace wrapper
305 } // namespace chart
307 // CHART_DIAGRAMWRAPPER_HXX
308 #endif