Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_CHARTTYPE_HXX
20 : #define INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_CHARTTYPE_HXX
21 :
22 : #include "MutexContainer.hxx"
23 : #include "OPropertySet.hxx"
24 : #include <cppuhelper/implbase6.hxx>
25 : #include <comphelper/uno3.hxx>
26 : #include "ServiceMacros.hxx"
27 : #include "ModifyListenerHelper.hxx"
28 : #include <com/sun/star/lang/XServiceInfo.hpp>
29 : #include <com/sun/star/chart2/XChartType.hpp>
30 : #include <com/sun/star/uno/XComponentContext.hpp>
31 : #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
32 : #include <com/sun/star/util/XCloneable.hpp>
33 :
34 : #include <vector>
35 :
36 : namespace chart
37 : {
38 :
39 : namespace impl
40 : {
41 : typedef ::cppu::WeakImplHelper6<
42 : css::lang::XServiceInfo,
43 : ::com::sun::star::chart2::XChartType,
44 : ::com::sun::star::chart2::XDataSeriesContainer,
45 : ::com::sun::star::util::XCloneable,
46 : ::com::sun::star::util::XModifyBroadcaster,
47 : ::com::sun::star::util::XModifyListener >
48 : ChartType_Base;
49 : }
50 :
51 : class ChartType :
52 : public MutexContainer,
53 : public impl::ChartType_Base,
54 : public ::property::OPropertySet
55 : {
56 : public:
57 : explicit ChartType(
58 : ::com::sun::star::uno::Reference<
59 : ::com::sun::star::uno::XComponentContext > const & xContext );
60 : virtual ~ChartType();
61 :
62 : protected:
63 : explicit ChartType( const ChartType & rOther );
64 :
65 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
66 392 : GetComponentContext() const { return m_xContext;}
67 :
68 : // ____ XChartType ____
69 : // still abstract ! implement !
70 : virtual OUString SAL_CALL getChartType()
71 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
72 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
73 : createCoordinateSystem( ::sal_Int32 DimensionCount )
74 : throw (::com::sun::star::lang::IllegalArgumentException,
75 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
77 : getSupportedMandatoryRoles()
78 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
80 : getSupportedOptionalRoles()
81 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 : virtual OUString SAL_CALL getRoleOfSequenceForSeriesLabel()
83 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 : virtual com::sun::star::uno::Sequence< OUString > SAL_CALL
85 : getSupportedPropertyRoles()
86 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 :
88 : // ____ XDataSeriesContainer ____
89 : virtual void SAL_CALL addDataSeries(
90 : const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& aDataSeries )
91 : throw (::com::sun::star::lang::IllegalArgumentException,
92 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
93 : virtual void SAL_CALL removeDataSeries(
94 : const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& aDataSeries )
95 : throw (::com::sun::star::container::NoSuchElementException,
96 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
97 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > > SAL_CALL getDataSeries()
98 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 : virtual void SAL_CALL setDataSeries(
100 : const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aDataSeries )
101 : throw (::com::sun::star::lang::IllegalArgumentException,
102 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 :
104 : // ____ XModifyBroadcaster ____
105 : virtual void SAL_CALL addModifyListener(
106 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
107 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 : virtual void SAL_CALL removeModifyListener(
109 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
110 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 :
112 : // ____ XModifyListener ____
113 : virtual void SAL_CALL modified(
114 : const ::com::sun::star::lang::EventObject& aEvent )
115 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 :
117 : // ____ XEventListener (base of XModifyListener) ____
118 : virtual void SAL_CALL disposing(
119 : const ::com::sun::star::lang::EventObject& Source )
120 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 :
122 : void fireModifyEvent();
123 :
124 : // ____ OPropertySet ____
125 : virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
126 : throw(::com::sun::star::beans::UnknownPropertyException) SAL_OVERRIDE;
127 : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
128 :
129 : virtual void firePropertyChangeEvent() SAL_OVERRIDE;
130 : using OPropertySet::disposing;
131 :
132 : // ____ XPropertySet ____
133 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
134 : getPropertySetInfo()
135 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 :
137 : /// merge XInterface implementations
138 : DECLARE_XINTERFACE()
139 : /// merge XTypeProvider implementations
140 : DECLARE_XTYPEPROVIDER()
141 :
142 : protected:
143 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >
144 : const m_xModifyEventForwarder;
145 :
146 : private:
147 : void impl_addDataSeriesWithoutNotification(
148 : const ::com::sun::star::uno::Reference<
149 : ::com::sun::star::chart2::XDataSeries >& aDataSeries );
150 :
151 : private:
152 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
153 : const m_xContext;
154 :
155 : typedef
156 : ::std::vector< ::com::sun::star::uno::Reference<
157 : ::com::sun::star::chart2::XDataSeries > >
158 : tDataSeriesContainerType;
159 :
160 : // --- mutable members: the following members need mutex guard ---
161 :
162 : tDataSeriesContainerType m_aDataSeries;
163 :
164 : bool m_bNotifyChanges;
165 : };
166 :
167 : } // namespace chart
168 :
169 : // INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_CHARTTYPE_HXX
170 : #endif
171 :
172 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|