bump product version to 4.1.6.2
[LibreOffice.git] / chart2 / source / model / inc / Diagram.hxx
blobf31c3c509a12479eb77485e6e7ea61ab442e7811
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 CHART_DIAGRAM_HXX
20 #define CHART_DIAGRAM_HXX
22 #include "OPropertySet.hxx"
23 #include "MutexContainer.hxx"
24 #include <cppuhelper/implbase8.hxx>
25 #include <comphelper/uno3.hxx>
26 #include <com/sun/star/beans/PropertyValue.hpp>
27 #include <com/sun/star/chart2/data/XDataSource.hpp>
28 #include <com/sun/star/chart2/XDiagram.hpp>
29 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
30 #include <com/sun/star/chart2/XTitled.hpp>
31 #include <com/sun/star/chart/X3DDefaultSetter.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/util/XCloneable.hpp>
35 #include <com/sun/star/util/XModifyBroadcaster.hpp>
36 #include <com/sun/star/util/XModifyListener.hpp>
38 #include "ServiceMacros.hxx"
40 #include <map>
41 #include <vector>
43 namespace chart
46 namespace impl
48 typedef ::cppu::WeakImplHelper8<
49 ::com::sun::star::chart2::XDiagram,
50 ::com::sun::star::lang::XServiceInfo,
51 ::com::sun::star::chart2::XCoordinateSystemContainer,
52 ::com::sun::star::chart2::XTitled,
53 ::com::sun::star::chart::X3DDefaultSetter,
54 ::com::sun::star::util::XModifyBroadcaster,
55 ::com::sun::star::util::XModifyListener,
56 ::com::sun::star::util::XCloneable >
57 Diagram_Base;
60 class Diagram :
61 public MutexContainer,
62 public impl::Diagram_Base,
63 public ::property::OPropertySet
65 public:
66 Diagram( ::com::sun::star::uno::Reference<
67 ::com::sun::star::uno::XComponentContext > const & xContext );
68 virtual ~Diagram();
70 /// establish methods for factory instatiation
71 APPHELPER_SERVICE_FACTORY_HELPER( Diagram )
73 /// XServiceInfo declarations
74 APPHELPER_XSERVICEINFO_DECL()
76 /// merge XInterface implementations
77 DECLARE_XINTERFACE()
78 /// merge XTypeProvider implementations
79 DECLARE_XTYPEPROVIDER()
81 protected:
82 explicit Diagram( const Diagram & rOther );
84 // ____ OPropertySet ____
85 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
86 throw(::com::sun::star::beans::UnknownPropertyException);
88 // ____ OPropertySet ____
89 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
91 // ____ XPropertySet ____
92 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
93 getPropertySetInfo()
94 throw (::com::sun::star::uno::RuntimeException);
96 // ____ XFastPropertySet ____
97 virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
98 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);
100 /// make original interface function visible again
101 using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
103 virtual void SAL_CALL getFastPropertyValue(
104 ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
106 // ____ XDiagram ____
107 virtual ::com::sun::star::uno::Reference<
108 ::com::sun::star::beans::XPropertySet > SAL_CALL getWall()
109 throw (::com::sun::star::uno::RuntimeException);
110 virtual ::com::sun::star::uno::Reference<
111 ::com::sun::star::beans::XPropertySet > SAL_CALL getFloor()
112 throw (::com::sun::star::uno::RuntimeException);
113 virtual ::com::sun::star::uno::Reference<
114 ::com::sun::star::chart2::XLegend > SAL_CALL getLegend()
115 throw (::com::sun::star::uno::RuntimeException);
116 virtual void SAL_CALL setLegend( const ::com::sun::star::uno::Reference<
117 ::com::sun::star::chart2::XLegend >& xLegend )
118 throw (::com::sun::star::uno::RuntimeException);
119 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme > SAL_CALL getDefaultColorScheme()
120 throw (::com::sun::star::uno::RuntimeException);
121 virtual void SAL_CALL setDefaultColorScheme(
122 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme >& xColorScheme )
123 throw (::com::sun::star::uno::RuntimeException);
124 virtual void SAL_CALL setDiagramData(
125 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource,
126 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
127 throw (::com::sun::star::uno::RuntimeException);
129 // ____ XCoordinateSystemContainer ____
130 virtual void SAL_CALL addCoordinateSystem(
131 const ::com::sun::star::uno::Reference<
132 ::com::sun::star::chart2::XCoordinateSystem >& aCoordSys )
133 throw (::com::sun::star::lang::IllegalArgumentException,
134 ::com::sun::star::uno::RuntimeException);
135 virtual void SAL_CALL removeCoordinateSystem(
136 const ::com::sun::star::uno::Reference<
137 ::com::sun::star::chart2::XCoordinateSystem >& aCoordSys )
138 throw (::com::sun::star::container::NoSuchElementException,
139 ::com::sun::star::uno::RuntimeException);
140 virtual ::com::sun::star::uno::Sequence<
141 ::com::sun::star::uno::Reference<
142 ::com::sun::star::chart2::XCoordinateSystem > > SAL_CALL getCoordinateSystems()
143 throw (::com::sun::star::uno::RuntimeException);
144 virtual void SAL_CALL setCoordinateSystems(
145 const ::com::sun::star::uno::Sequence<
146 ::com::sun::star::uno::Reference<
147 ::com::sun::star::chart2::XCoordinateSystem > >& aCoordinateSystems )
148 throw (::com::sun::star::lang::IllegalArgumentException,
149 ::com::sun::star::uno::RuntimeException);
151 // ____ XTitled ____
152 virtual ::com::sun::star::uno::Reference<
153 ::com::sun::star::chart2::XTitle > SAL_CALL getTitleObject()
154 throw (::com::sun::star::uno::RuntimeException);
155 virtual void SAL_CALL setTitleObject( const ::com::sun::star::uno::Reference<
156 ::com::sun::star::chart2::XTitle >& Title )
157 throw (::com::sun::star::uno::RuntimeException);
159 // ____ X3DDefaultSetter ____
160 virtual void SAL_CALL set3DSettingsToDefault() throw (::com::sun::star::uno::RuntimeException);
161 virtual void SAL_CALL setDefaultRotation() throw (::com::sun::star::uno::RuntimeException);
162 virtual void SAL_CALL setDefaultIllumination() throw (::com::sun::star::uno::RuntimeException);
164 // ____ XCloneable ____
165 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
166 throw (::com::sun::star::uno::RuntimeException);
168 // ____ XModifyBroadcaster ____
169 virtual void SAL_CALL addModifyListener(
170 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
171 throw (::com::sun::star::uno::RuntimeException);
172 virtual void SAL_CALL removeModifyListener(
173 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
174 throw (::com::sun::star::uno::RuntimeException);
176 // ____ XModifyListener ____
177 virtual void SAL_CALL modified(
178 const ::com::sun::star::lang::EventObject& aEvent )
179 throw (::com::sun::star::uno::RuntimeException);
181 // ____ XEventListener (base of XModifyListener) ____
182 virtual void SAL_CALL disposing(
183 const ::com::sun::star::lang::EventObject& Source )
184 throw (::com::sun::star::uno::RuntimeException);
186 // ____ OPropertySet ____
187 virtual void firePropertyChangeEvent();
188 using OPropertySet::disposing;
190 void fireModifyEvent();
192 private:
193 ::com::sun::star::uno::Reference<
194 ::com::sun::star::uno::XComponentContext > m_xContext;
196 typedef
197 ::std::vector< ::com::sun::star::uno::Reference<
198 ::com::sun::star::chart2::XCoordinateSystem > >
199 tCoordinateSystemContainerType;
201 tCoordinateSystemContainerType m_aCoordSystems;
203 ::com::sun::star::uno::Reference<
204 ::com::sun::star::beans::XPropertySet >
205 m_xWall;
207 ::com::sun::star::uno::Reference<
208 ::com::sun::star::beans::XPropertySet >
209 m_xFloor;
211 ::com::sun::star::uno::Reference<
212 ::com::sun::star::chart2::XTitle >
213 m_xTitle;
215 ::com::sun::star::uno::Reference<
216 ::com::sun::star::chart2::XLegend >
217 m_xLegend;
219 ::com::sun::star::uno::Reference<
220 ::com::sun::star::chart2::XColorScheme >
221 m_xColorScheme;
223 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
226 } // namespace chart
228 // CHART_DIAGRAM_HXX
229 #endif
231 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */