xref: /trunk/main/chart2/source/model/inc/StockBar.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 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 
70     virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
71 
72     // ____ XPropertySet ____
73     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
74         getPropertySetInfo();
75 
76 
77     // ____ XCloneable ____
78     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone();
79 
80     // ____ XModifyBroadcaster ____
81     virtual void SAL_CALL addModifyListener(
82         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener );
83     virtual void SAL_CALL removeModifyListener(
84         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener );
85 
86     // ____ XModifyListener ____
87     virtual void SAL_CALL modified(
88         const ::com::sun::star::lang::EventObject& aEvent );
89 
90     // ____ XEventListener (base of XModifyListener) ____
91     virtual void SAL_CALL disposing(
92         const ::com::sun::star::lang::EventObject& Source );
93 
94     // ____ OPropertySet ____
95     virtual void firePropertyChangeEvent();
96     using OPropertySet::disposing;
97 
98     void fireModifyEvent();
99 
100 private:
101     const bool m_bRisingCourse;
102     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
103 };
104 
105 } //  namespace chart
106 
107 // CHART_STOCKBAR_HXX
108 #endif
109