xref: /trunk/main/chart2/source/model/inc/StockBar.hxx (revision de7b3f82)
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 CHART_STOCKBAR_HXX
24 #define CHART_STOCKBAR_HXX
25 
26 #include <com/sun/star/util/XCloneable.hpp>
27 #include <com/sun/star/util/XModifyBroadcaster.hpp>
28 #include <com/sun/star/util/XModifyListener.hpp>
29 #include "MutexContainer.hxx"
30 #include "OPropertySet.hxx"
31 
32 #include "ServiceMacros.hxx"
33 #include <cppuhelper/implbase3.hxx>
34 #include <comphelper/uno3.hxx>
35 
36 namespace chart
37 {
38 
39 namespace impl
40 {
41 typedef ::cppu::WeakImplHelper3<
42         ::com::sun::star::util::XCloneable,
43         ::com::sun::star::util::XModifyBroadcaster,
44         ::com::sun::star::util::XModifyListener >
45     StockBar_Base;
46 }
47 
48 class StockBar :
49         public MutexContainer,
50         public impl::StockBar_Base,
51         public ::property::OPropertySet
52 {
53 public:
54 	explicit StockBar( bool bRisingCourse );
55 	virtual ~StockBar();
56 
57 
58     /// XServiceInfo declarations
59     APPHELPER_XSERVICEINFO_DECL()
60 
61     /// merge XInterface implementations
62  	DECLARE_XINTERFACE()
63 
64 protected:
65     explicit StockBar( const StockBar & rOther );
66 
67     // ____ OPropertySet ____
68     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
69         throw(::com::sun::star::beans::UnknownPropertyException);
70 
71 	virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
72 
73     // ____ XPropertySet ____
74     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
75         getPropertySetInfo()
76         throw (::com::sun::star::uno::RuntimeException);
77 
78 
79     // ____ XCloneable ____
80     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
81         throw (::com::sun::star::uno::RuntimeException);
82 
83     // ____ XModifyBroadcaster ____
84     virtual void SAL_CALL addModifyListener(
85         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
86         throw (::com::sun::star::uno::RuntimeException);
87     virtual void SAL_CALL removeModifyListener(
88         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
89         throw (::com::sun::star::uno::RuntimeException);
90 
91     // ____ XModifyListener ____
92     virtual void SAL_CALL modified(
93         const ::com::sun::star::lang::EventObject& aEvent )
94         throw (::com::sun::star::uno::RuntimeException);
95 
96     // ____ XEventListener (base of XModifyListener) ____
97     virtual void SAL_CALL disposing(
98         const ::com::sun::star::lang::EventObject& Source )
99         throw (::com::sun::star::uno::RuntimeException);
100 
101     // ____ OPropertySet ____
102     virtual void firePropertyChangeEvent();
103 	using OPropertySet::disposing;
104 
105     void fireModifyEvent();
106 
107 private:
108     const bool m_bRisingCourse;
109     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
110 };
111 
112 } //  namespace chart
113 
114 // CHART_STOCKBAR_HXX
115 #endif
116