xref: /trunk/main/chart2/source/inc/ErrorBar.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 instantiation
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     virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
89     using OPropertySet::disposing;
90 
91     // ____ XPropertySet ____
92     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
93         getPropertySetInfo();
94 
95     // ____ XCloneable ____
96     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone();
97 
98     // ____ XModifyBroadcaster ____
99     virtual void SAL_CALL addModifyListener(
100         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener );
101     virtual void SAL_CALL removeModifyListener(
102         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener );
103 
104     // ____ XModifyListener ____
105     virtual void SAL_CALL modified(
106         const ::com::sun::star::lang::EventObject& aEvent );
107 
108     // ____ XEventListener (base of XModifyListener) ____
109     virtual void SAL_CALL disposing(
110         const ::com::sun::star::lang::EventObject& Source );
111 
112     // ____ XDataSink ____
113     virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >& aData );
114 
115     // ____ XDataSource ____
116     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences();
117 
118     // ____ XChild ____
119     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent();
120     virtual void SAL_CALL setParent(
121         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent );
122 
123     // ____ OPropertySet ____
124     virtual void firePropertyChangeEvent();
125 
126     void fireModifyEvent();
127 
128 private:
129     ::com::sun::star::uno::Reference<
130         ::com::sun::star::uno::XComponentContext >
131                         m_xContext;
132 
133     typedef ::std::vector< ::com::sun::star::uno::Reference<
134             ::com::sun::star::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
135     tDataSequenceContainer m_aDataSequences;
136 
137     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
138     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
139 };
140 
141 } //  namespace chart
142 
143 // CHART2_ERRORBAR_HXX
144 #endif
145