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_DIAGRAMWRAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_DIAGRAMWRAPPER_HXX
22 #include "WrappedPropertySet.hxx"
23 #include "DiagramHelper.hxx"
25 #include <comphelper/uno3.hxx>
26 #include <cppuhelper/interfacecontainer.hxx>
27 #include <com/sun/star/chart2/XChartDocument.hpp>
28 #include <com/sun/star/chart2/XDiagram.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/chart/XDiagramPositioning.hpp>
31 #include <com/sun/star/chart2/XDiagramProvider.hpp>
32 #include <com/sun/star/chart2/XChartTypeTemplate.hpp>
33 #include <com/sun/star/chart2/XChartTypeManager.hpp>
34 #include <com/sun/star/chart/XDiagram.hpp>
35 #include <com/sun/star/chart/XAxisSupplier.hpp>
36 #include <com/sun/star/chart/XAxisZSupplier.hpp>
37 #include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
38 #include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
39 #include <com/sun/star/chart/XStatisticDisplay.hpp>
40 #include <com/sun/star/chart/X3DDisplay.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/lang/XComponent.hpp>
43 #include <com/sun/star/lang/XEventListener.hpp>
44 #include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
46 #include <com/sun/star/chart/X3DDefaultSetter.hpp>
47 #include <boost/shared_ptr.hpp>
54 class Chart2ModelContact
;
56 class DiagramWrapper
: public cppu::ImplInheritanceHelper
<
58 , ::com::sun::star::chart::XDiagram
59 , ::com::sun::star::chart::XAxisSupplier
60 , ::com::sun::star::chart::XAxisZSupplier
61 , ::com::sun::star::chart::XTwoAxisXSupplier
// : XAxisXSupplier
62 , ::com::sun::star::chart::XTwoAxisYSupplier
// : XAxisYSupplier
63 , ::com::sun::star::chart::XStatisticDisplay
64 , ::com::sun::star::chart::X3DDisplay
65 , ::com::sun::star::chart::X3DDefaultSetter
66 , ::com::sun::star::lang::XServiceInfo
67 , ::com::sun::star::lang::XComponent
68 , ::com::sun::star::chart::XDiagramPositioning
69 , ::com::sun::star::chart2::XDiagramProvider
70 , ::com::sun::star::chart::XSecondAxisTitleSupplier
74 DiagramWrapper( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
75 virtual ~DiagramWrapper();
77 /// XServiceInfo declarations
78 virtual OUString SAL_CALL
getImplementationName()
79 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
81 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
82 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
83 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 static OUString
getImplementationName_Static();
86 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
88 // ____ XComponent ____
89 virtual void SAL_CALL
dispose()
90 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
<
92 ::com::sun::star::lang::XEventListener
>& xListener
)
93 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
94 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
<
95 ::com::sun::star::lang::XEventListener
>& aListener
)
96 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
99 virtual OUString SAL_CALL
getDiagramType()
100 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 virtual ::com::sun::star::uno::Reference
<
102 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getDataRowProperties( sal_Int32 nRow
)
103 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
104 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 virtual ::com::sun::star::uno::Reference
<
106 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getDataPointProperties( sal_Int32 nCol
, sal_Int32 nRow
)
107 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
108 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
110 // ____ XShape (base of XDiagram) ____
111 virtual ::com::sun::star::awt::Point SAL_CALL
getPosition()
112 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 virtual void SAL_CALL
setPosition( const ::com::sun::star::awt::Point
& aPosition
)
114 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 virtual ::com::sun::star::awt::Size SAL_CALL
getSize()
116 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
117 virtual void SAL_CALL
setSize( const ::com::sun::star::awt::Size
& aSize
)
118 throw (::com::sun::star::beans::PropertyVetoException
,
119 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 // ____ XShapeDescriptor (base of XShape) ____
122 virtual OUString SAL_CALL
getShapeType()
123 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 // ____ XAxisSupplier ____
126 virtual ::com::sun::star::uno::Reference
<
127 ::com::sun::star::chart::XAxis
> SAL_CALL
getAxis( sal_Int32 nDimensionIndex
)
128 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 virtual ::com::sun::star::uno::Reference
<
130 ::com::sun::star::chart::XAxis
> SAL_CALL
getSecondaryAxis( sal_Int32 nDimensionIndex
)
131 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 // ____ XAxisZSupplier ____
134 virtual ::com::sun::star::uno::Reference
<
135 ::com::sun::star::drawing::XShape
> SAL_CALL
getZAxisTitle()
136 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
137 virtual ::com::sun::star::uno::Reference
<
138 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getZMainGrid()
139 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
140 virtual ::com::sun::star::uno::Reference
<
141 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getZHelpGrid()
142 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
143 virtual ::com::sun::star::uno::Reference
<
144 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getZAxis()
145 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
147 // ____ XTwoAxisXSupplier ____
148 virtual ::com::sun::star::uno::Reference
<
149 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getSecondaryXAxis()
150 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
152 // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
153 virtual ::com::sun::star::uno::Reference
<
154 ::com::sun::star::drawing::XShape
> SAL_CALL
getXAxisTitle()
155 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
156 virtual ::com::sun::star::uno::Reference
<
157 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getXAxis()
158 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
159 virtual ::com::sun::star::uno::Reference
<
160 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getXMainGrid()
161 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
162 virtual ::com::sun::star::uno::Reference
<
163 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getXHelpGrid()
164 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
166 // ____ XTwoAxisYSupplier ____
167 virtual ::com::sun::star::uno::Reference
<
168 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getSecondaryYAxis()
169 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
171 // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
172 virtual ::com::sun::star::uno::Reference
<
173 ::com::sun::star::drawing::XShape
> SAL_CALL
getYAxisTitle()
174 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
175 virtual ::com::sun::star::uno::Reference
<
176 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getYAxis()
177 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
178 virtual ::com::sun::star::uno::Reference
<
179 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getYHelpGrid()
180 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
181 virtual ::com::sun::star::uno::Reference
<
182 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getYMainGrid()
183 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
185 // ____ XSecondAxisTitleSupplier ____
186 virtual ::com::sun::star::uno::Reference
<
187 ::com::sun::star::drawing::XShape
> SAL_CALL
getSecondXAxisTitle()
188 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
189 virtual ::com::sun::star::uno::Reference
<
190 ::com::sun::star::drawing::XShape
> SAL_CALL
getSecondYAxisTitle()
191 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
193 // ____ XStatisticDisplay ____
194 virtual ::com::sun::star::uno::Reference
<
195 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getUpBar()
196 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
197 virtual ::com::sun::star::uno::Reference
<
198 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getDownBar()
199 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
200 virtual ::com::sun::star::uno::Reference
<
201 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getMinMaxLine()
202 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
204 // ____ X3DDisplay ____
205 virtual ::com::sun::star::uno::Reference
<
206 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getWall()
207 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
208 virtual ::com::sun::star::uno::Reference
<
209 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getFloor()
210 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
212 // ____ X3DDefaultSetter ____
213 virtual void SAL_CALL
set3DSettingsToDefault() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
214 virtual void SAL_CALL
setDefaultRotation() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
215 virtual void SAL_CALL
setDefaultIllumination() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
217 // ____ XDiagramPositioning ____
218 virtual void SAL_CALL
setAutomaticDiagramPositioning( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
219 virtual sal_Bool SAL_CALL
isAutomaticDiagramPositioning( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
220 virtual void SAL_CALL
setDiagramPositionExcludingAxes( const ::com::sun::star::awt::Rectangle
& PositionRect
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
221 virtual sal_Bool SAL_CALL
isExcludingDiagramPositioning( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
222 virtual ::com::sun::star::awt::Rectangle SAL_CALL
calculateDiagramPositionExcludingAxes( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
223 virtual void SAL_CALL
setDiagramPositionIncludingAxes( const ::com::sun::star::awt::Rectangle
& PositionRect
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
224 virtual ::com::sun::star::awt::Rectangle SAL_CALL
calculateDiagramPositionIncludingAxes( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
225 virtual void SAL_CALL
setDiagramPositionIncludingAxesAndAxisTitles( const ::com::sun::star::awt::Rectangle
& PositionRect
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
226 virtual ::com::sun::star::awt::Rectangle SAL_CALL
calculateDiagramPositionIncludingAxesAndAxisTitles( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
228 // ____ XDiagramProvider ____
229 virtual ::com::sun::star::uno::Reference
<
230 ::com::sun::star::chart2::XDiagram
> SAL_CALL
getDiagram()
231 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
232 virtual void SAL_CALL
setDiagram( const ::com::sun::star::uno::Reference
<
233 ::com::sun::star::chart2::XDiagram
>& xDiagram
)
234 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
237 // ____ WrappedPropertySet ____
238 virtual const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& getPropertySequence() SAL_OVERRIDE
;
239 virtual const std::vector
< WrappedProperty
* > createWrappedProperties() SAL_OVERRIDE
;
240 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getInnerPropertySet() SAL_OVERRIDE
;
243 void updateFromModel();
245 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
246 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer
;
248 ::com::sun::star::uno::Reference
<
249 ::com::sun::star::chart::XAxis
> m_xXAxis
;
250 ::com::sun::star::uno::Reference
<
251 ::com::sun::star::chart::XAxis
> m_xYAxis
;
252 ::com::sun::star::uno::Reference
<
253 ::com::sun::star::chart::XAxis
> m_xZAxis
;
254 ::com::sun::star::uno::Reference
<
255 ::com::sun::star::chart::XAxis
> m_xSecondXAxis
;
256 ::com::sun::star::uno::Reference
<
257 ::com::sun::star::chart::XAxis
> m_xSecondYAxis
;
259 ::com::sun::star::uno::Reference
<
260 ::com::sun::star::beans::XPropertySet
> m_xWall
;
261 ::com::sun::star::uno::Reference
<
262 ::com::sun::star::beans::XPropertySet
> m_xFloor
;
264 ::com::sun::star::uno::Reference
<
265 ::com::sun::star::beans::XPropertySet
> m_xMinMaxLineWrapper
;
266 ::com::sun::star::uno::Reference
<
267 ::com::sun::star::beans::XPropertySet
> m_xUpBarWrapper
;
268 ::com::sun::star::uno::Reference
<
269 ::com::sun::star::beans::XPropertySet
> m_xDownBarWrapper
;
272 } // namespace wrapper
275 // INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_DIAGRAMWRAPPER_HXX
278 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */