fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / model / inc / Diagram.hxx
blobd1a17c3e3f33808c3c48121291a14fbc198ca41f
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 INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX
20 #define INCLUDED_CHART2_SOURCE_MODEL_INC_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 <map>
39 #include <vector>
41 namespace chart
44 namespace impl
46 typedef ::cppu::WeakImplHelper8<
47 ::com::sun::star::chart2::XDiagram,
48 ::com::sun::star::lang::XServiceInfo,
49 ::com::sun::star::chart2::XCoordinateSystemContainer,
50 ::com::sun::star::chart2::XTitled,
51 ::com::sun::star::chart::X3DDefaultSetter,
52 ::com::sun::star::util::XModifyBroadcaster,
53 ::com::sun::star::util::XModifyListener,
54 ::com::sun::star::util::XCloneable >
55 Diagram_Base;
58 class Diagram :
59 public MutexContainer,
60 public impl::Diagram_Base,
61 public ::property::OPropertySet
63 public:
64 Diagram( ::com::sun::star::uno::Reference<
65 ::com::sun::star::uno::XComponentContext > const & xContext );
66 virtual ~Diagram();
68 /// establish methods for factory instatiation
69 static css::uno::Reference< css::uno::XInterface > SAL_CALL create( css::uno::Reference< css::uno::XComponentContext > const & xContext)
70 throw(css::uno::Exception)
72 return (::cppu::OWeakObject *)new Diagram( xContext );
75 /// XServiceInfo declarations
76 virtual OUString SAL_CALL getImplementationName()
77 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
78 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
79 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
80 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
81 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
83 static OUString getImplementationName_Static();
84 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
86 /// merge XInterface implementations
87 DECLARE_XINTERFACE()
88 /// merge XTypeProvider implementations
89 DECLARE_XTYPEPROVIDER()
91 protected:
92 explicit Diagram( const Diagram & rOther );
94 // ____ OPropertySet ____
95 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
96 throw(::com::sun::star::beans::UnknownPropertyException) SAL_OVERRIDE;
98 // ____ OPropertySet ____
99 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
101 // ____ XPropertySet ____
102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
103 getPropertySetInfo()
104 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 // ____ XFastPropertySet ____
107 virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
108 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, std::exception) SAL_OVERRIDE;
110 /// make original interface function visible again
111 using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
113 virtual void SAL_CALL getFastPropertyValue(
114 ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const SAL_OVERRIDE;
116 // ____ XDiagram ____
117 virtual ::com::sun::star::uno::Reference<
118 ::com::sun::star::beans::XPropertySet > SAL_CALL getWall()
119 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
120 virtual ::com::sun::star::uno::Reference<
121 ::com::sun::star::beans::XPropertySet > SAL_CALL getFloor()
122 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
123 virtual ::com::sun::star::uno::Reference<
124 ::com::sun::star::chart2::XLegend > SAL_CALL getLegend()
125 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 virtual void SAL_CALL setLegend( const ::com::sun::star::uno::Reference<
127 ::com::sun::star::chart2::XLegend >& xLegend )
128 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
129 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme > SAL_CALL getDefaultColorScheme()
130 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
131 virtual void SAL_CALL setDefaultColorScheme(
132 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme >& xColorScheme )
133 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 virtual void SAL_CALL setDiagramData(
135 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource,
136 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
137 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
139 // ____ XCoordinateSystemContainer ____
140 virtual void SAL_CALL addCoordinateSystem(
141 const ::com::sun::star::uno::Reference<
142 ::com::sun::star::chart2::XCoordinateSystem >& aCoordSys )
143 throw (::com::sun::star::lang::IllegalArgumentException,
144 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 virtual void SAL_CALL removeCoordinateSystem(
146 const ::com::sun::star::uno::Reference<
147 ::com::sun::star::chart2::XCoordinateSystem >& aCoordSys )
148 throw (::com::sun::star::container::NoSuchElementException,
149 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 virtual ::com::sun::star::uno::Sequence<
151 ::com::sun::star::uno::Reference<
152 ::com::sun::star::chart2::XCoordinateSystem > > SAL_CALL getCoordinateSystems()
153 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
154 virtual void SAL_CALL setCoordinateSystems(
155 const ::com::sun::star::uno::Sequence<
156 ::com::sun::star::uno::Reference<
157 ::com::sun::star::chart2::XCoordinateSystem > >& aCoordinateSystems )
158 throw (::com::sun::star::lang::IllegalArgumentException,
159 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
161 // ____ XTitled ____
162 virtual ::com::sun::star::uno::Reference<
163 ::com::sun::star::chart2::XTitle > SAL_CALL getTitleObject()
164 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
165 virtual void SAL_CALL setTitleObject( const ::com::sun::star::uno::Reference<
166 ::com::sun::star::chart2::XTitle >& Title )
167 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
169 // ____ X3DDefaultSetter ____
170 virtual void SAL_CALL set3DSettingsToDefault() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
171 virtual void SAL_CALL setDefaultRotation() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
172 virtual void SAL_CALL setDefaultIllumination() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
174 // ____ XCloneable ____
175 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
176 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
178 // ____ XModifyBroadcaster ____
179 virtual void SAL_CALL addModifyListener(
180 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
181 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
182 virtual void SAL_CALL removeModifyListener(
183 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
184 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
186 // ____ XModifyListener ____
187 virtual void SAL_CALL modified(
188 const ::com::sun::star::lang::EventObject& aEvent )
189 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
191 // ____ XEventListener (base of XModifyListener) ____
192 virtual void SAL_CALL disposing(
193 const ::com::sun::star::lang::EventObject& Source )
194 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 // ____ OPropertySet ____
197 virtual void firePropertyChangeEvent() SAL_OVERRIDE;
198 using OPropertySet::disposing;
200 void fireModifyEvent();
202 private:
203 ::com::sun::star::uno::Reference<
204 ::com::sun::star::uno::XComponentContext > m_xContext;
206 typedef
207 ::std::vector< ::com::sun::star::uno::Reference<
208 ::com::sun::star::chart2::XCoordinateSystem > >
209 tCoordinateSystemContainerType;
211 tCoordinateSystemContainerType m_aCoordSystems;
213 ::com::sun::star::uno::Reference<
214 ::com::sun::star::beans::XPropertySet >
215 m_xWall;
217 ::com::sun::star::uno::Reference<
218 ::com::sun::star::beans::XPropertySet >
219 m_xFloor;
221 ::com::sun::star::uno::Reference<
222 ::com::sun::star::chart2::XTitle >
223 m_xTitle;
225 ::com::sun::star::uno::Reference<
226 ::com::sun::star::chart2::XLegend >
227 m_xLegend;
229 ::com::sun::star::uno::Reference<
230 ::com::sun::star::chart2::XColorScheme >
231 m_xColorScheme;
233 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
236 } // namespace chart
238 // INCLUDED_CHART2_SOURCE_MODEL_INC_DIAGRAM_HXX
239 #endif
241 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */