xref: /aoo4110/main/chart2/source/inc/ErrorBar.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CHART2_ERRORBAR_HXX
24 #define CHART2_ERRORBAR_HXX
25 
26 #include "MutexContainer.hxx"
27 #include "OPropertySet.hxx"
28 #include "ServiceMacros.hxx"
29 #include "ModifyListenerHelper.hxx"
30 #include "charttoolsdllapi.hxx"
31 
32 #include <cppuhelper/implbase6.hxx>
33 #include <comphelper/uno3.hxx>
34 
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/lang/XServiceName.hpp>
38 #include <com/sun/star/util/XCloneable.hpp>
39 #include <com/sun/star/container/XChild.hpp>
40 #include <com/sun/star/chart2/data/XDataSink.hpp>
41 #include <com/sun/star/chart2/data/XDataSource.hpp>
42 
43 namespace chart
44 {
45 
46 OOO_DLLPUBLIC_CHARTTOOLS    ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createErrorBar(
47     const ::com::sun::star::uno::Reference<
48             ::com::sun::star::uno::XComponentContext > & xContext );
49 
50 namespace impl
51 {
52 typedef ::cppu::WeakImplHelper6<
53         ::com::sun::star::lang::XServiceInfo,
54         ::com::sun::star::util::XCloneable,
55         ::com::sun::star::util::XModifyBroadcaster,
56         ::com::sun::star::util::XModifyListener,
57         ::com::sun::star::chart2::data::XDataSource,
58         ::com::sun::star::chart2::data::XDataSink >
59     ErrorBar_Base;
60 }
61 
62 class ErrorBar :
63         public MutexContainer,
64         public impl::ErrorBar_Base,
65         public ::property::OPropertySet
66 {
67 public:
68 	explicit ErrorBar(
69         const ::com::sun::star::uno::Reference<
70             ::com::sun::star::uno::XComponentContext > & xContext );
71 	virtual ~ErrorBar();
72 
73     /// XServiceInfo declarations
74     APPHELPER_XSERVICEINFO_DECL()
75     /// establish methods for factory instatiation
76 	APPHELPER_SERVICE_FACTORY_HELPER( ErrorBar )
77 
78     /// merge XInterface implementations
79  	DECLARE_XINTERFACE()
80     /// merge XTypeProvider implementations
81  	DECLARE_XTYPEPROVIDER()
82 
83 protected:
84     ErrorBar( const ErrorBar & rOther );
85 
86     // ____ OPropertySet ____
87     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
88         throw(::com::sun::star::beans::UnknownPropertyException);
89 	virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
90 	using OPropertySet::disposing;
91 
92     // ____ XPropertySet ____
93     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
94         getPropertySetInfo()
95         throw (::com::sun::star::uno::RuntimeException);
96 
97     // ____ XCloneable ____
98     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
99         throw (::com::sun::star::uno::RuntimeException);
100 
101     // ____ XModifyBroadcaster ____
102     virtual void SAL_CALL addModifyListener(
103         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
104         throw (::com::sun::star::uno::RuntimeException);
105     virtual void SAL_CALL removeModifyListener(
106         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
107         throw (::com::sun::star::uno::RuntimeException);
108 
109     // ____ XModifyListener ____
110     virtual void SAL_CALL modified(
111         const ::com::sun::star::lang::EventObject& aEvent )
112         throw (::com::sun::star::uno::RuntimeException);
113 
114     // ____ XEventListener (base of XModifyListener) ____
115     virtual void SAL_CALL disposing(
116         const ::com::sun::star::lang::EventObject& Source )
117         throw (::com::sun::star::uno::RuntimeException);
118 
119     // ____ XDataSink ____
120     virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >& aData )
121         throw (::com::sun::star::uno::RuntimeException);
122 
123     // ____ XDataSource ____
124     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences()
125         throw (::com::sun::star::uno::RuntimeException);
126 
127     // ____ XChild ____
128     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent()
129         throw (::com::sun::star::uno::RuntimeException);
130     virtual void SAL_CALL setParent(
131         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
132         throw (::com::sun::star::lang::NoSupportException,
133                ::com::sun::star::uno::RuntimeException);
134 
135     // ____ OPropertySet ____
136     virtual void firePropertyChangeEvent();
137 
138     void fireModifyEvent();
139 
140 private:
141     ::com::sun::star::uno::Reference<
142         ::com::sun::star::uno::XComponentContext >
143                         m_xContext;
144 
145     typedef ::std::vector< ::com::sun::star::uno::Reference<
146             ::com::sun::star::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
147     tDataSequenceContainer m_aDataSequences;
148 
149     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
150     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
151 };
152 
153 } //  namespace chart
154 
155 // CHART2_ERRORBAR_HXX
156 #endif
157