update dev300-m58
[ooovba.git] / chart2 / source / model / template / ChartType.hxx
blob600de8ff25b552bb56996a324769aacbf4c65c94
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: ChartType.hxx,v $
10 * $Revision: 1.6 $
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_CHARTTYPE_HXX
31 #define CHART_CHARTTYPE_HXX
33 #include "MutexContainer.hxx"
34 #include "OPropertySet.hxx"
35 #include <cppuhelper/implbase5.hxx>
36 #include <comphelper/uno3.hxx>
37 #include "ServiceMacros.hxx"
38 #include "ModifyListenerHelper.hxx"
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/chart2/XChartType.hpp>
41 #include <com/sun/star/uno/XComponentContext.hpp>
42 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
43 #include <com/sun/star/util/XCloneable.hpp>
45 #include <vector>
47 namespace chart
50 namespace impl
52 typedef ::cppu::WeakImplHelper5<
53 ::com::sun::star::chart2::XChartType,
54 ::com::sun::star::chart2::XDataSeriesContainer,
55 ::com::sun::star::util::XCloneable,
56 ::com::sun::star::util::XModifyBroadcaster,
57 ::com::sun::star::util::XModifyListener >
58 ChartType_Base;
61 class ChartType :
62 public MutexContainer,
63 public impl::ChartType_Base,
64 public ::property::OPropertySet
66 public:
67 explicit ChartType(
68 ::com::sun::star::uno::Reference<
69 ::com::sun::star::uno::XComponentContext > const & xContext );
70 virtual ~ChartType();
72 protected:
73 explicit ChartType( const ChartType & rOther );
75 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
76 GetComponentContext() const;
78 // ____ XChartType ____
79 // still abstract ! implement !
80 virtual ::rtl::OUString SAL_CALL getChartType()
81 throw (::com::sun::star::uno::RuntimeException) = 0;
82 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
83 createCoordinateSystem( ::sal_Int32 DimensionCount )
84 throw (::com::sun::star::lang::IllegalArgumentException,
85 ::com::sun::star::uno::RuntimeException);
86 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
87 getSupportedMandatoryRoles()
88 throw (::com::sun::star::uno::RuntimeException);
89 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
90 getSupportedOptionalRoles()
91 throw (::com::sun::star::uno::RuntimeException);
92 virtual ::rtl::OUString SAL_CALL getRoleOfSequenceForSeriesLabel()
93 throw (::com::sun::star::uno::RuntimeException);
95 // ____ XDataSeriesContainer ____
96 virtual void SAL_CALL addDataSeries(
97 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& aDataSeries )
98 throw (::com::sun::star::lang::IllegalArgumentException,
99 ::com::sun::star::uno::RuntimeException);
100 virtual void SAL_CALL removeDataSeries(
101 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& aDataSeries )
102 throw (::com::sun::star::container::NoSuchElementException,
103 ::com::sun::star::uno::RuntimeException);
104 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > > SAL_CALL getDataSeries()
105 throw (::com::sun::star::uno::RuntimeException);
106 virtual void SAL_CALL setDataSeries(
107 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aDataSeries )
108 throw (::com::sun::star::lang::IllegalArgumentException,
109 ::com::sun::star::uno::RuntimeException);
111 // ____ XModifyBroadcaster ____
112 virtual void SAL_CALL addModifyListener(
113 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
114 throw (::com::sun::star::uno::RuntimeException);
115 virtual void SAL_CALL removeModifyListener(
116 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
117 throw (::com::sun::star::uno::RuntimeException);
119 // ____ XModifyListener ____
120 virtual void SAL_CALL modified(
121 const ::com::sun::star::lang::EventObject& aEvent )
122 throw (::com::sun::star::uno::RuntimeException);
124 // ____ XEventListener (base of XModifyListener) ____
125 virtual void SAL_CALL disposing(
126 const ::com::sun::star::lang::EventObject& Source )
127 throw (::com::sun::star::uno::RuntimeException);
129 void fireModifyEvent();
131 // ____ OPropertySet ____
132 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
133 throw(::com::sun::star::beans::UnknownPropertyException);
134 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
136 virtual void firePropertyChangeEvent();
137 using OPropertySet::disposing;
139 // ____ XPropertySet ____
140 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
141 getPropertySetInfo()
142 throw (::com::sun::star::uno::RuntimeException);
144 // virtual sal_Bool SAL_CALL convertFastPropertyValue
145 // ( ::com::sun::star::uno::Any & rConvertedValue,
146 // ::com::sun::star::uno::Any & rOldValue,
147 // sal_Int32 nHandle,
148 // const ::com::sun::star::uno::Any& rValue )
149 // throw (::com::sun::star::lang::IllegalArgumentException);
151 /// merge XInterface implementations
152 DECLARE_XINTERFACE()
153 /// merge XTypeProvider implementations
154 DECLARE_XTYPEPROVIDER()
156 // not implemented
157 // ____ XCloneable ____
158 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
159 // throw (::com::sun::star::uno::RuntimeException);
161 protected:
162 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
164 private:
165 void impl_addDataSeriesWithoutNotification(
166 const ::com::sun::star::uno::Reference<
167 ::com::sun::star::chart2::XDataSeries >& aDataSeries );
169 private:
170 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
171 m_xContext;
173 typedef
174 ::std::vector< ::com::sun::star::uno::Reference<
175 ::com::sun::star::chart2::XDataSeries > >
176 tDataSeriesContainerType;
178 tDataSeriesContainerType m_aDataSeries;
180 bool m_bNotifyChanges;
183 } // namespace chart
185 // CHART_CHARTTYPE_HXX
186 #endif