merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / model / inc / Diagram.hxx
blobd01921ef9dedbb0be4a3e505a44b14a80c8c38d0
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: Diagram.hxx,v $
10 * $Revision: 1.15 $
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_DIAGRAM_HXX
31 #define CHART_DIAGRAM_HXX
33 #include "OPropertySet.hxx"
34 #include "MutexContainer.hxx"
35 #include <cppuhelper/implbase8.hxx>
36 #include <comphelper/uno3.hxx>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/chart2/XDiagram.hpp>
39 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
40 #include <com/sun/star/chart2/XTitled.hpp>
41 #include <com/sun/star/chart/X3DDefaultSetter.hpp>
42 #include <com/sun/star/uno/XComponentContext.hpp>
43 #include <com/sun/star/util/XCloneable.hpp>
44 #include <com/sun/star/util/XModifyBroadcaster.hpp>
45 #include <com/sun/star/util/XModifyListener.hpp>
47 #include "ServiceMacros.hxx"
49 #include <map>
50 #include <vector>
52 namespace chart
55 namespace impl
57 typedef ::cppu::WeakImplHelper8<
58 ::com::sun::star::chart2::XDiagram,
59 ::com::sun::star::lang::XServiceInfo,
60 ::com::sun::star::chart2::XCoordinateSystemContainer,
61 ::com::sun::star::chart2::XTitled,
62 ::com::sun::star::chart::X3DDefaultSetter,
63 ::com::sun::star::util::XModifyBroadcaster,
64 ::com::sun::star::util::XModifyListener,
65 ::com::sun::star::util::XCloneable >
66 Diagram_Base;
69 class Diagram :
70 public MutexContainer,
71 public impl::Diagram_Base,
72 public ::property::OPropertySet
74 public:
75 Diagram( ::com::sun::star::uno::Reference<
76 ::com::sun::star::uno::XComponentContext > const & xContext );
77 virtual ~Diagram();
79 /// establish methods for factory instatiation
80 APPHELPER_SERVICE_FACTORY_HELPER( Diagram )
82 /// XServiceInfo declarations
83 APPHELPER_XSERVICEINFO_DECL()
85 /// merge XInterface implementations
86 DECLARE_XINTERFACE()
87 /// merge XTypeProvider implementations
88 DECLARE_XTYPEPROVIDER()
90 protected:
91 explicit Diagram( const Diagram & rOther );
93 // ____ OPropertySet ____
94 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
95 throw(::com::sun::star::beans::UnknownPropertyException);
97 // ____ OPropertySet ____
98 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
100 // ____ XPropertySet ____
101 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
102 getPropertySetInfo()
103 throw (::com::sun::star::uno::RuntimeException);
105 // ____ XFastPropertySet ____
106 virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
107 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
109 /// make original interface function visible again
110 using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
112 virtual void SAL_CALL getFastPropertyValue(
113 ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
115 // virtual sal_Bool SAL_CALL convertFastPropertyValue
116 // ( ::com::sun::star::uno::Any & rConvertedValue,
117 // ::com::sun::star::uno::Any & rOldValue,
118 // sal_Int32 nHandle,
119 // const ::com::sun::star::uno::Any& rValue )
120 // throw (::com::sun::star::lang::IllegalArgumentException);
122 // ____ XDiagram ____
123 // virtual ::rtl::OUString SAL_CALL getChartTypeTemplateServiceName()
124 // throw (::com::sun::star::uno::RuntimeException);
125 virtual ::com::sun::star::uno::Reference<
126 ::com::sun::star::beans::XPropertySet > SAL_CALL getWall()
127 throw (::com::sun::star::uno::RuntimeException);
128 virtual ::com::sun::star::uno::Reference<
129 ::com::sun::star::beans::XPropertySet > SAL_CALL getFloor()
130 throw (::com::sun::star::uno::RuntimeException);
131 virtual ::com::sun::star::uno::Reference<
132 ::com::sun::star::chart2::XLegend > SAL_CALL getLegend()
133 throw (::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL setLegend( const ::com::sun::star::uno::Reference<
135 ::com::sun::star::chart2::XLegend >& xLegend )
136 throw (::com::sun::star::uno::RuntimeException);
137 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme > SAL_CALL getDefaultColorScheme()
138 throw (::com::sun::star::uno::RuntimeException);
139 virtual void SAL_CALL setDefaultColorScheme(
140 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme >& xColorScheme )
141 throw (::com::sun::star::uno::RuntimeException);
142 virtual void SAL_CALL setUnusedData(
143 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >& aUnusedData )
144 throw (::com::sun::star::uno::RuntimeException);
145 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getUnusedData()
146 throw (::com::sun::star::uno::RuntimeException);
149 // ____ XCoordinateSystemContainer ____
150 virtual void SAL_CALL addCoordinateSystem(
151 const ::com::sun::star::uno::Reference<
152 ::com::sun::star::chart2::XCoordinateSystem >& aCoordSys )
153 throw (::com::sun::star::lang::IllegalArgumentException,
154 ::com::sun::star::uno::RuntimeException);
155 virtual void SAL_CALL removeCoordinateSystem(
156 const ::com::sun::star::uno::Reference<
157 ::com::sun::star::chart2::XCoordinateSystem >& aCoordSys )
158 throw (::com::sun::star::container::NoSuchElementException,
159 ::com::sun::star::uno::RuntimeException);
160 virtual ::com::sun::star::uno::Sequence<
161 ::com::sun::star::uno::Reference<
162 ::com::sun::star::chart2::XCoordinateSystem > > SAL_CALL getCoordinateSystems()
163 throw (::com::sun::star::uno::RuntimeException);
164 virtual void SAL_CALL setCoordinateSystems(
165 const ::com::sun::star::uno::Sequence<
166 ::com::sun::star::uno::Reference<
167 ::com::sun::star::chart2::XCoordinateSystem > >& aCoordinateSystems )
168 throw (::com::sun::star::lang::IllegalArgumentException,
169 ::com::sun::star::uno::RuntimeException);
171 // ____ XTitled ____
172 virtual ::com::sun::star::uno::Reference<
173 ::com::sun::star::chart2::XTitle > SAL_CALL getTitleObject()
174 throw (::com::sun::star::uno::RuntimeException);
175 virtual void SAL_CALL setTitleObject( const ::com::sun::star::uno::Reference<
176 ::com::sun::star::chart2::XTitle >& Title )
177 throw (::com::sun::star::uno::RuntimeException);
179 // ____ X3DDefaultSetter ____
180 virtual void SAL_CALL set3DSettingsToDefault() throw (::com::sun::star::uno::RuntimeException);
181 virtual void SAL_CALL setDefaultRotation() throw (::com::sun::star::uno::RuntimeException);
182 virtual void SAL_CALL setDefaultIllumination() throw (::com::sun::star::uno::RuntimeException);
184 // ____ XCloneable ____
185 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
186 throw (::com::sun::star::uno::RuntimeException);
188 // ____ XModifyBroadcaster ____
189 virtual void SAL_CALL addModifyListener(
190 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
191 throw (::com::sun::star::uno::RuntimeException);
192 virtual void SAL_CALL removeModifyListener(
193 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
194 throw (::com::sun::star::uno::RuntimeException);
196 // ____ XModifyListener ____
197 virtual void SAL_CALL modified(
198 const ::com::sun::star::lang::EventObject& aEvent )
199 throw (::com::sun::star::uno::RuntimeException);
201 // ____ XEventListener (base of XModifyListener) ____
202 virtual void SAL_CALL disposing(
203 const ::com::sun::star::lang::EventObject& Source )
204 throw (::com::sun::star::uno::RuntimeException);
206 // ____ OPropertySet ____
207 virtual void firePropertyChangeEvent();
208 using OPropertySet::disposing;
210 void fireModifyEvent();
212 private:
213 ::com::sun::star::uno::Reference<
214 ::com::sun::star::uno::XComponentContext > m_xContext;
216 typedef
217 ::std::vector< ::com::sun::star::uno::Reference<
218 ::com::sun::star::chart2::XCoordinateSystem > >
219 tCoordinateSystemContainerType;
221 tCoordinateSystemContainerType m_aCoordSystems;
223 ::com::sun::star::uno::Reference<
224 ::com::sun::star::beans::XPropertySet >
225 m_xWall;
227 ::com::sun::star::uno::Reference<
228 ::com::sun::star::beans::XPropertySet >
229 m_xFloor;
231 ::com::sun::star::uno::Reference<
232 ::com::sun::star::chart2::XTitle >
233 m_xTitle;
235 ::com::sun::star::uno::Reference<
236 ::com::sun::star::chart2::XLegend >
237 m_xLegend;
239 ::com::sun::star::uno::Reference<
240 ::com::sun::star::chart2::XColorScheme >
241 m_xColorScheme;
243 ::com::sun::star::uno::Sequence<
244 ::com::sun::star::uno::Reference<
245 ::com::sun::star::chart2::data::XLabeledDataSequence > >
246 m_aUnusedData;
248 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
251 } // namespace chart
253 // CHART_DIAGRAM_HXX
254 #endif