Update ooo320-m1
[ooovba.git] / chart2 / source / controller / inc / ChartDocumentWrapper.hxx
blob88d2bcad3ae6be19f80d45f223358c6da815f393
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: ChartDocumentWrapper.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_CHARTDOCUMENTWRAPPER_HXX
31 #define CHART_CHARTDOCUMENTWRAPPER_HXX
33 #include "WrappedPropertySet.hxx"
34 //#include "OPropertySet.hxx"
35 #include "ServiceMacros.hxx"
36 #include <com/sun/star/chart2/XChartDocument.hpp>
37 #include <com/sun/star/chart/XChartDocument.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
40 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
41 #include <com/sun/star/uno/XAggregation.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/util/XRefreshable.hpp>
44 #include <cppuhelper/implbase5.hxx>
45 #include <osl/mutex.hxx>
46 #include <unotools/eventlisteneradapter.hxx>
47 #include <comphelper/uno3.hxx>
49 #include <boost/shared_ptr.hpp>
51 namespace chart
54 namespace wrapper
57 class Chart2ModelContact;
59 class ChartDocumentWrapper_Base : public ::cppu::ImplInheritanceHelper5
60 < WrappedPropertySet
61 , ::com::sun::star::chart::XChartDocument
62 , ::com::sun::star::drawing::XDrawPageSupplier
63 , ::com::sun::star::lang::XMultiServiceFactory
64 , ::com::sun::star::lang::XServiceInfo
65 , ::com::sun::star::uno::XAggregation
70 class ChartDocumentWrapper : public ChartDocumentWrapper_Base
71 , public ::utl::OEventListenerAdapter
73 public:
74 explicit ChartDocumentWrapper(
75 const ::com::sun::star::uno::Reference<
76 ::com::sun::star::uno::XComponentContext > & xContext );
77 virtual ~ChartDocumentWrapper();
79 /// XServiceInfo declarations
80 APPHELPER_XSERVICEINFO_DECL()
81 APPHELPER_SERVICE_FACTORY_HELPER(ChartDocumentWrapper)
83 void setAddIn( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshable >& xAddIn );
84 ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshable > getAddIn() const;
86 void setUpdateAddIn( sal_Bool bUpdateAddIn );
87 sal_Bool getUpdateAddIn() const;
89 void setBaseDiagram( const rtl::OUString& rBaseDiagram );
90 rtl::OUString getBaseDiagram() const;
92 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getAdditionalShapes() const;
94 ::com::sun::star::uno::Reference<
95 ::com::sun::star::drawing::XDrawPage > impl_getDrawPage() const
96 throw (::com::sun::star::uno::RuntimeException);
98 protected:
100 // ____ chart::XChartDocument ____
101 virtual ::com::sun::star::uno::Reference<
102 ::com::sun::star::drawing::XShape > SAL_CALL getTitle()
103 throw (::com::sun::star::uno::RuntimeException);
104 virtual ::com::sun::star::uno::Reference<
105 ::com::sun::star::drawing::XShape > SAL_CALL getSubTitle()
106 throw (::com::sun::star::uno::RuntimeException);
107 virtual ::com::sun::star::uno::Reference<
108 ::com::sun::star::drawing::XShape > SAL_CALL getLegend()
109 throw (::com::sun::star::uno::RuntimeException);
110 virtual ::com::sun::star::uno::Reference<
111 ::com::sun::star::beans::XPropertySet > SAL_CALL getArea()
112 throw (::com::sun::star::uno::RuntimeException);
113 virtual ::com::sun::star::uno::Reference<
114 ::com::sun::star::chart::XDiagram > SAL_CALL getDiagram()
115 throw (::com::sun::star::uno::RuntimeException);
116 virtual void SAL_CALL setDiagram( const ::com::sun::star::uno::Reference<
117 ::com::sun::star::chart::XDiagram >& xDiagram )
118 throw (::com::sun::star::uno::RuntimeException);
119 virtual ::com::sun::star::uno::Reference<
120 ::com::sun::star::chart::XChartData > SAL_CALL getData()
121 throw (::com::sun::star::uno::RuntimeException);
122 virtual void SAL_CALL attachData( const ::com::sun::star::uno::Reference<
123 ::com::sun::star::chart::XChartData >& xData )
124 throw (::com::sun::star::uno::RuntimeException);
126 // ____ XModel ____
127 virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& URL, const ::com::sun::star::uno::Sequence<
128 ::com::sun::star::beans::PropertyValue >& Arguments )
129 throw (::com::sun::star::uno::RuntimeException);
130 virtual ::rtl::OUString SAL_CALL getURL()
131 throw (::com::sun::star::uno::RuntimeException);
132 virtual ::com::sun::star::uno::Sequence<
133 ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs()
134 throw (::com::sun::star::uno::RuntimeException);
135 virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference<
136 ::com::sun::star::frame::XController >& Controller )
137 throw (::com::sun::star::uno::RuntimeException);
138 virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference<
139 ::com::sun::star::frame::XController >& Controller )
140 throw (::com::sun::star::uno::RuntimeException);
141 virtual void SAL_CALL lockControllers()
142 throw (::com::sun::star::uno::RuntimeException);
143 virtual void SAL_CALL unlockControllers()
144 throw (::com::sun::star::uno::RuntimeException);
145 virtual sal_Bool SAL_CALL hasControllersLocked()
146 throw (::com::sun::star::uno::RuntimeException);
147 virtual ::com::sun::star::uno::Reference<
148 ::com::sun::star::frame::XController > SAL_CALL getCurrentController()
149 throw (::com::sun::star::uno::RuntimeException);
150 virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference<
151 ::com::sun::star::frame::XController >& Controller )
152 throw (::com::sun::star::container::NoSuchElementException,
153 ::com::sun::star::uno::RuntimeException);
154 virtual ::com::sun::star::uno::Reference<
155 ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection()
156 throw (::com::sun::star::uno::RuntimeException);
158 // ____ XComponent ____
159 virtual void SAL_CALL dispose()
160 throw (::com::sun::star::uno::RuntimeException);
161 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
162 ::com::sun::star::lang::XEventListener >& xListener )
163 throw (::com::sun::star::uno::RuntimeException);
164 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
165 ::com::sun::star::lang::XEventListener >& aListener )
166 throw (::com::sun::star::uno::RuntimeException);
168 // ____ XInterface (for new interfaces) ____
169 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
170 throw (::com::sun::star::uno::RuntimeException);
172 // ____ ::utl::OEventListenerAdapter ____
173 virtual void _disposing( const ::com::sun::star::lang::EventObject& rSource );
175 // ____ XDrawPageSupplier ____
176 virtual ::com::sun::star::uno::Reference<
177 ::com::sun::star::drawing::XDrawPage > SAL_CALL getDrawPage()
178 throw (::com::sun::star::uno::RuntimeException);
180 // ____ XMultiServiceFactory ____
181 virtual ::com::sun::star::uno::Reference<
182 ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier )
183 throw (::com::sun::star::uno::Exception,
184 ::com::sun::star::uno::RuntimeException);
185 virtual ::com::sun::star::uno::Reference<
186 ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(
187 const ::rtl::OUString& ServiceSpecifier,
188 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments )
189 throw (::com::sun::star::uno::Exception,
190 ::com::sun::star::uno::RuntimeException);
191 virtual ::com::sun::star::uno::Sequence<
192 ::rtl::OUString > SAL_CALL getAvailableServiceNames()
193 throw (::com::sun::star::uno::RuntimeException);
195 // ____ XAggregation ____
196 virtual void SAL_CALL setDelegator(
197 const ::com::sun::star::uno::Reference<
198 ::com::sun::star::uno::XInterface >& rDelegator )
199 throw (::com::sun::star::uno::RuntimeException);
200 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType )
201 throw (::com::sun::star::uno::RuntimeException);
203 // ____ WrappedPropertySet ____
204 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
205 virtual const std::vector< WrappedProperty* > createWrappedProperties();
206 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
208 private: //methods
209 void impl_resetAddIn();
211 private: //member
212 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
214 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDelegator;
216 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xTitle;
217 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xSubTitle;
218 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xLegend;
219 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartData > m_xChartData;
220 ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > m_xDiagram;
221 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xArea;
223 ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshable > m_xAddIn;
224 rtl::OUString m_aBaseDiagram;
225 sal_Bool m_bUpdateAddIn;
227 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xChartView;
228 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>
229 m_xShapeFactory;
231 bool m_bIsDisposed;
234 } // namespace wrapper
235 } // namespace chart
237 // CHART_CHARTDOCUMENT_HXX
238 #endif