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