merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / model / template / ChartType.hxx
blob07e72ea2890bc60b79a9a333198a1e21069370b8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART_CHARTTYPE_HXX
28 #define CHART_CHARTTYPE_HXX
30 #include "MutexContainer.hxx"
31 #include "OPropertySet.hxx"
32 #include <cppuhelper/implbase5.hxx>
33 #include <comphelper/uno3.hxx>
34 #include "ServiceMacros.hxx"
35 #include "ModifyListenerHelper.hxx"
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/chart2/XChartType.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
40 #include <com/sun/star/util/XCloneable.hpp>
42 #include <vector>
44 namespace chart
47 namespace impl
49 typedef ::cppu::WeakImplHelper5<
50 ::com::sun::star::chart2::XChartType,
51 ::com::sun::star::chart2::XDataSeriesContainer,
52 ::com::sun::star::util::XCloneable,
53 ::com::sun::star::util::XModifyBroadcaster,
54 ::com::sun::star::util::XModifyListener >
55 ChartType_Base;
58 class ChartType :
59 public MutexContainer,
60 public impl::ChartType_Base,
61 public ::property::OPropertySet
63 public:
64 explicit ChartType(
65 ::com::sun::star::uno::Reference<
66 ::com::sun::star::uno::XComponentContext > const & xContext );
67 virtual ~ChartType();
69 protected:
70 explicit ChartType( const ChartType & rOther );
72 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
73 GetComponentContext() const;
75 // ____ XChartType ____
76 // still abstract ! implement !
77 virtual ::rtl::OUString SAL_CALL getChartType()
78 throw (::com::sun::star::uno::RuntimeException) = 0;
79 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
80 createCoordinateSystem( ::sal_Int32 DimensionCount )
81 throw (::com::sun::star::lang::IllegalArgumentException,
82 ::com::sun::star::uno::RuntimeException);
83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
84 getSupportedMandatoryRoles()
85 throw (::com::sun::star::uno::RuntimeException);
86 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
87 getSupportedOptionalRoles()
88 throw (::com::sun::star::uno::RuntimeException);
89 virtual ::rtl::OUString SAL_CALL getRoleOfSequenceForSeriesLabel()
90 throw (::com::sun::star::uno::RuntimeException);
92 // ____ XDataSeriesContainer ____
93 virtual void SAL_CALL addDataSeries(
94 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& aDataSeries )
95 throw (::com::sun::star::lang::IllegalArgumentException,
96 ::com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL removeDataSeries(
98 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& aDataSeries )
99 throw (::com::sun::star::container::NoSuchElementException,
100 ::com::sun::star::uno::RuntimeException);
101 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > > SAL_CALL getDataSeries()
102 throw (::com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL setDataSeries(
104 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aDataSeries )
105 throw (::com::sun::star::lang::IllegalArgumentException,
106 ::com::sun::star::uno::RuntimeException);
108 // ____ XModifyBroadcaster ____
109 virtual void SAL_CALL addModifyListener(
110 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
111 throw (::com::sun::star::uno::RuntimeException);
112 virtual void SAL_CALL removeModifyListener(
113 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
114 throw (::com::sun::star::uno::RuntimeException);
116 // ____ XModifyListener ____
117 virtual void SAL_CALL modified(
118 const ::com::sun::star::lang::EventObject& aEvent )
119 throw (::com::sun::star::uno::RuntimeException);
121 // ____ XEventListener (base of XModifyListener) ____
122 virtual void SAL_CALL disposing(
123 const ::com::sun::star::lang::EventObject& Source )
124 throw (::com::sun::star::uno::RuntimeException);
126 void fireModifyEvent();
128 // ____ OPropertySet ____
129 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
130 throw(::com::sun::star::beans::UnknownPropertyException);
131 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
133 virtual void firePropertyChangeEvent();
134 using OPropertySet::disposing;
136 // ____ XPropertySet ____
137 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
138 getPropertySetInfo()
139 throw (::com::sun::star::uno::RuntimeException);
141 // virtual sal_Bool SAL_CALL convertFastPropertyValue
142 // ( ::com::sun::star::uno::Any & rConvertedValue,
143 // ::com::sun::star::uno::Any & rOldValue,
144 // sal_Int32 nHandle,
145 // const ::com::sun::star::uno::Any& rValue )
146 // throw (::com::sun::star::lang::IllegalArgumentException);
148 /// merge XInterface implementations
149 DECLARE_XINTERFACE()
150 /// merge XTypeProvider implementations
151 DECLARE_XTYPEPROVIDER()
153 // not implemented
154 // ____ XCloneable ____
155 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
156 // throw (::com::sun::star::uno::RuntimeException);
158 protected:
159 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
161 private:
162 void impl_addDataSeriesWithoutNotification(
163 const ::com::sun::star::uno::Reference<
164 ::com::sun::star::chart2::XDataSeries >& aDataSeries );
166 private:
167 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
168 m_xContext;
170 typedef
171 ::std::vector< ::com::sun::star::uno::Reference<
172 ::com::sun::star::chart2::XDataSeries > >
173 tDataSeriesContainerType;
175 tDataSeriesContainerType m_aDataSeries;
177 bool m_bNotifyChanges;
180 } // namespace chart
182 // CHART_CHARTTYPE_HXX
183 #endif