xref: /aoo42x/main/chart2/source/inc/ErrorBar.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 #ifndef CHART2_ERRORBAR_HXX
28 #define CHART2_ERRORBAR_HXX
29 
30 #include "MutexContainer.hxx"
31 #include "OPropertySet.hxx"
32 #include "ServiceMacros.hxx"
33 #include "ModifyListenerHelper.hxx"
34 #include "charttoolsdllapi.hxx"
35 
36 #include <cppuhelper/implbase6.hxx>
37 #include <comphelper/uno3.hxx>
38 
39 #include <com/sun/star/uno/XComponentContext.hpp>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/lang/XServiceName.hpp>
42 #include <com/sun/star/util/XCloneable.hpp>
43 #include <com/sun/star/container/XChild.hpp>
44 #include <com/sun/star/chart2/data/XDataSink.hpp>
45 #include <com/sun/star/chart2/data/XDataSource.hpp>
46 
47 namespace chart
48 {
49 
50 OOO_DLLPUBLIC_CHARTTOOLS    ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createErrorBar(
51     const ::com::sun::star::uno::Reference<
52             ::com::sun::star::uno::XComponentContext > & xContext );
53 
54 namespace impl
55 {
56 typedef ::cppu::WeakImplHelper6<
57         ::com::sun::star::lang::XServiceInfo,
58         ::com::sun::star::util::XCloneable,
59         ::com::sun::star::util::XModifyBroadcaster,
60         ::com::sun::star::util::XModifyListener,
61         ::com::sun::star::chart2::data::XDataSource,
62         ::com::sun::star::chart2::data::XDataSink >
63     ErrorBar_Base;
64 }
65 
66 class ErrorBar :
67         public MutexContainer,
68         public impl::ErrorBar_Base,
69         public ::property::OPropertySet
70 {
71 public:
72 	explicit ErrorBar(
73         const ::com::sun::star::uno::Reference<
74             ::com::sun::star::uno::XComponentContext > & xContext );
75 	virtual ~ErrorBar();
76 
77     /// XServiceInfo declarations
78     APPHELPER_XSERVICEINFO_DECL()
79     /// establish methods for factory instatiation
80 	APPHELPER_SERVICE_FACTORY_HELPER( ErrorBar )
81 
82     /// merge XInterface implementations
83  	DECLARE_XINTERFACE()
84     /// merge XTypeProvider implementations
85  	DECLARE_XTYPEPROVIDER()
86 
87 protected:
88     ErrorBar( const ErrorBar & rOther );
89 
90     // ____ OPropertySet ____
91     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
92         throw(::com::sun::star::beans::UnknownPropertyException);
93 	virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
94 	using OPropertySet::disposing;
95 
96     // ____ XPropertySet ____
97     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
98         getPropertySetInfo()
99         throw (::com::sun::star::uno::RuntimeException);
100 
101     // ____ XCloneable ____
102     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
103         throw (::com::sun::star::uno::RuntimeException);
104 
105     // ____ XModifyBroadcaster ____
106     virtual void SAL_CALL addModifyListener(
107         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
108         throw (::com::sun::star::uno::RuntimeException);
109     virtual void SAL_CALL removeModifyListener(
110         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
111         throw (::com::sun::star::uno::RuntimeException);
112 
113     // ____ XModifyListener ____
114     virtual void SAL_CALL modified(
115         const ::com::sun::star::lang::EventObject& aEvent )
116         throw (::com::sun::star::uno::RuntimeException);
117 
118     // ____ XEventListener (base of XModifyListener) ____
119     virtual void SAL_CALL disposing(
120         const ::com::sun::star::lang::EventObject& Source )
121         throw (::com::sun::star::uno::RuntimeException);
122 
123     // ____ XDataSink ____
124     virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >& aData )
125         throw (::com::sun::star::uno::RuntimeException);
126 
127     // ____ XDataSource ____
128     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences()
129         throw (::com::sun::star::uno::RuntimeException);
130 
131     // ____ XChild ____
132     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent()
133         throw (::com::sun::star::uno::RuntimeException);
134     virtual void SAL_CALL setParent(
135         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
136         throw (::com::sun::star::lang::NoSupportException,
137                ::com::sun::star::uno::RuntimeException);
138 
139     // ____ OPropertySet ____
140     virtual void firePropertyChangeEvent();
141 
142     void fireModifyEvent();
143 
144 private:
145     ::com::sun::star::uno::Reference<
146         ::com::sun::star::uno::XComponentContext >
147                         m_xContext;
148 
149     typedef ::std::vector< ::com::sun::star::uno::Reference<
150             ::com::sun::star::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
151     tDataSequenceContainer m_aDataSequences;
152 
153     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
154     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
155 };
156 
157 } //  namespace chart
158 
159 // CHART2_ERRORBAR_HXX
160 #endif
161