merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_sch / ChXChartDocument.hxx
blob44662ca502df3ed4ac9a6c1169725bd798778d1b
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: ChXChartDocument.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 ************************************************************************/
31 #ifndef _SCH_CHXCHARTDOCUMENT_HXX
32 #define _SCH_CHXCHARTDOCUMENT_HXX
34 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
38 #include <com/sun/star/beans/XPropertySet.hpp>
39 #endif
40 #ifndef _COM_SUN_STAR_CHART_XCHARTDOCUMENT_HPP_
41 #include <com/sun/star/chart/XChartDocument.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
44 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
47 #include <com/sun/star/lang/XUnoTunnel.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_CHART_XCHARTDATA_HPP_
50 #include <com/sun/star/chart/XChartData.hpp>
51 #endif
52 #ifndef _COM_SUN_STAR_CHART_XCHARTDATACHANGEEVENTLISTENER_HPP_
53 #include <com/sun/star/chart/XChartDataChangeEventListener.hpp>
54 #endif
55 #ifndef _COM_SUN_STAR_CHART_XDIAGRAM_HPP_
56 #include <com/sun/star/chart/XDiagram.hpp>
57 #endif
58 #ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGESUPPLIER_HPP_
59 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
60 #endif
61 #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_
62 #include <com/sun/star/lang/XEventListener.hpp>
63 #endif
65 // header for SfxBaseModel
66 #ifndef _SFX_SFXBASEMODEL_HXX_
67 #include <bf_sfx2/sfxbasemodel.hxx>
68 #endif
69 // header for SvxUnoDrawMSFactory
70 #ifndef SVX_UNOMOD_HXX
71 #include <bf_svx/unomod.hxx>
72 #endif
73 #ifndef _OSL_MUTEX_HXX_
74 #include <osl/mutex.hxx>
75 #endif
77 // header for SvxItemPropertySet
78 #ifndef SVX_UNOPROV_HXX
79 #include <bf_svx/unoprov.hxx>
80 #endif
82 #ifndef _CPPUHELPER_WEAK_HXX_
83 #include <cppuhelper/weak.hxx>
84 #endif
86 #ifndef _SCH_ADDINCOLLECTION_HXX_
87 #include "SchAddInCollection.hxx"
88 #endif
89 namespace binfilter {
91 class ChartModel;
92 class ChXDiagram;
93 class SchChartDocShell;
94 class SchMemChart;
96 class ChXChartDocument :
97 public ::com::sun::star::beans::XPropertySet,
98 public ::com::sun::star::chart::XChartDocument,
99 public ::com::sun::star::lang::XServiceInfo,
100 public ::com::sun::star::util::XNumberFormatsSupplier,
101 public ::com::sun::star::drawing::XDrawPageSupplier,
102 public ::com::sun::star::lang::XUnoTunnel,
103 public SfxBaseModel, // : XModel
104 public SvxUnoDrawMSFactory // : XMultiServiceFactory
106 private:
107 ChartModel* m_pModel;
108 SvxItemPropertySet m_aPropSet;
109 SchChartDocShell* m_pDocShell;
111 ::osl::Mutex maMutex;
113 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
115 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > m_rXDiagram;
116 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartData > m_xChartData;
117 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener > m_xEventListener;
118 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mrNumberFormatter;
119 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mrDrawPage;
121 // some shape references (ChXChartObjects)
122 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxMainTitle;
123 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxSubTitle;
124 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxLegend;
125 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxArea;
127 // used by AddIns to access core functionality
128 ::rtl::OUString maBaseDiagramType;
130 // tables for drawing styles
131 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xDashTable;
132 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xGradientTable;
133 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xHatchTable;
134 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xBitmapTable;
135 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xTransparencyGradientTable;
136 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xMarkerTable;
138 static sal_Int32 mnInstanceCounter;
139 static SchAddInCollection * mpAddInCollection;
140 static SchAddInCollection & GetAddInCollection();
142 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > GetAdditionalShapes();
144 public:
145 ChXChartDocument( SchChartDocShell* pShell );
146 virtual ~ChXChartDocument();
148 ::osl::Mutex& GetMutex() { return maMutex; }
150 void setDiagramType( const ::rtl::OUString&, sal_Bool bKeepAddin = sal_False ) throw();
151 sal_Bool setBaseDiagramType( sal_Bool bSet ) throw();
153 void SetChartModel( ChartModel* ) throw();
154 void RefreshData( const ::com::sun::star::chart::ChartDataChangeEvent& ) throw();
155 void InitNumberFormatter() throw( ::com::sun::star::uno::RuntimeException );
156 void ClearNumberFormatter() { mrNumberFormatter = NULL; }
157 ::com::sun::star::uno::Sequence< sal_Int32 > GetTransSequence( SchMemChart* pData, bool bColumns );
158 bool SetTransSequence( SchMemChart* pData, bool bColumns, const ::com::sun::star::uno::Sequence< sal_Int32 >& rSeq );
160 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
161 static ChXChartDocument* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw();
163 // XInterface
164 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
165 throw( ::com::sun::star::uno::RuntimeException );
166 virtual void SAL_CALL acquire() throw();
167 virtual void SAL_CALL release() throw();
169 // XMultiServiceFactory ( ::SvxUnoDrawMSFactory )
170 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(
171 const ::rtl::OUString& aServiceSpecifier )
172 throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
173 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(
174 const ::rtl::OUString& ServiceSpecifier,
175 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments )
176 throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
177 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames()
178 throw( ::com::sun::star::uno::RuntimeException );
180 // XPropertySet
181 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
182 throw( ::com::sun::star::uno::RuntimeException );
183 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
184 const ::com::sun::star::uno::Any& aValue )
185 throw( ::com::sun::star::beans::UnknownPropertyException,
186 ::com::sun::star::beans::PropertyVetoException,
187 ::com::sun::star::lang::IllegalArgumentException,
188 ::com::sun::star::lang::WrappedTargetException,
189 ::com::sun::star::uno::RuntimeException );
190 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
191 throw( ::com::sun::star::beans::UnknownPropertyException,
192 ::com::sun::star::lang::WrappedTargetException,
193 ::com::sun::star::uno::RuntimeException );
194 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
195 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
196 throw( ::com::sun::star::beans::UnknownPropertyException,
197 ::com::sun::star::lang::WrappedTargetException,
198 ::com::sun::star::uno::RuntimeException );
199 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
200 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
201 throw( ::com::sun::star::beans::UnknownPropertyException,
202 ::com::sun::star::lang::WrappedTargetException,
203 ::com::sun::star::uno::RuntimeException );
204 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
205 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
206 throw( ::com::sun::star::beans::UnknownPropertyException,
207 ::com::sun::star::lang::WrappedTargetException,
208 ::com::sun::star::uno::RuntimeException );
209 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
210 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
211 throw( ::com::sun::star::beans::UnknownPropertyException,
212 ::com::sun::star::lang::WrappedTargetException,
213 ::com::sun::star::uno::RuntimeException );
215 // XChartDocument
216 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getTitle()
217 throw( ::com::sun::star::uno::RuntimeException );
218 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getSubTitle()
219 throw( ::com::sun::star::uno::RuntimeException );
220 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getLegend()
221 throw( ::com::sun::star::uno::RuntimeException );
222 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getArea()
223 throw( ::com::sun::star::uno::RuntimeException );
224 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > SAL_CALL getDiagram()
225 throw( ::com::sun::star::uno::RuntimeException );
226 virtual void SAL_CALL setDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& )
227 throw( ::com::sun::star::uno::RuntimeException );
228 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartData > SAL_CALL getData()
229 throw( ::com::sun::star::uno::RuntimeException );
230 virtual void SAL_CALL attachData( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartData >& )
231 throw( ::com::sun::star::uno::RuntimeException );
233 // XModel ( ::SfxBaseModel )
234 virtual sal_Bool SAL_CALL attachResource(
235 const ::rtl::OUString& aURL,
236 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs )
237 throw( ::com::sun::star::uno::RuntimeException);
238 virtual ::rtl::OUString SAL_CALL getURL() throw( ::com::sun::star::uno::RuntimeException);
239 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs()
240 throw( ::com::sun::star::uno::RuntimeException);
241 virtual void SAL_CALL connectController(
242 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
243 throw( ::com::sun::star::uno::RuntimeException);
244 virtual void SAL_CALL disconnectController(
245 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
246 throw( ::com::sun::star::uno::RuntimeException);
247 virtual void SAL_CALL lockControllers() throw( ::com::sun::star::uno::RuntimeException );
248 virtual void SAL_CALL unlockControllers() throw( ::com::sun::star::uno::RuntimeException );
249 virtual sal_Bool SAL_CALL hasControllersLocked() throw( ::com::sun::star::uno::RuntimeException );
250 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController()
251 throw( ::com::sun::star::uno::RuntimeException);
252 virtual void SAL_CALL setCurrentController(
253 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
254 throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
255 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection()
256 throw( ::com::sun::star::uno::RuntimeException);
258 // XTypeProvider ( ::SfxBaseModel )
259 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
260 throw( ::com::sun::star::uno::RuntimeException );
261 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
262 throw( ::com::sun::star::uno::RuntimeException );
264 // XComponent ( ::XModel ::SfxBaseModel )
265 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
266 virtual void SAL_CALL addEventListener(
267 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
268 throw( ::com::sun::star::uno::RuntimeException );
269 virtual void SAL_CALL removeEventListener(
270 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
271 throw( ::com::sun::star::uno::RuntimeException );
273 // XNumberFormatsSupplier
274 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getNumberFormatSettings()
275 throw( ::com::sun::star::uno::RuntimeException );
276 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL getNumberFormats()
277 throw( ::com::sun::star::uno::RuntimeException );
279 // XServiceInfo
280 virtual ::rtl::OUString SAL_CALL getImplementationName()
281 throw( ::com::sun::star::uno::RuntimeException );
282 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
283 throw( ::com::sun::star::uno::RuntimeException );
284 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
285 throw( ::com::sun::star::uno::RuntimeException );
287 // XDrawPageSupplier
288 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getDrawPage()
289 throw( ::com::sun::star::uno::RuntimeException );
291 // XUnoTunnel
292 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
293 throw( ::com::sun::star::uno::RuntimeException );
295 // XEventListener
296 virtual void SAL_CALL
297 disposing
298 (const ::com::sun::star::lang::EventObject & Source)
299 throw (::com::sun::star::uno::RuntimeException);
302 } //namespace binfilter
303 #endif // _SCH_CHXCHARTDOCUMENT_HXX