xref: /aoo41x/main/chart2/source/model/main/Axis.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_AXIS_HXX
28 #define CHART_AXIS_HXX
29 
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include "MutexContainer.hxx"
32 #include "OPropertySet.hxx"
33 #include <cppuhelper/implbase6.hxx>
34 #include <comphelper/uno3.hxx>
35 
36 #include "ServiceMacros.hxx"
37 #include "ModifyListenerHelper.hxx"
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/chart2/XAxis.hpp>
40 #include <com/sun/star/chart2/XTitled.hpp>
41 #include <com/sun/star/util/XCloneable.hpp>
42 #include <com/sun/star/util/XModifyBroadcaster.hpp>
43 #include <com/sun/star/util/XModifyListener.hpp>
44 
45 namespace chart
46 {
47 
48 namespace impl
49 {
50 typedef ::cppu::WeakImplHelper6<
51         ::com::sun::star::chart2::XAxis,
52         ::com::sun::star::chart2::XTitled,
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     Axis_Base;
58 }
59 
60 class Axis :
61     public MutexContainer,
62     public impl::Axis_Base,
63     public ::property::OPropertySet
64 {
65 public:
66 	Axis( ::com::sun::star::uno::Reference<
67           ::com::sun::star::uno::XComponentContext > const & xContext );
68 	virtual ~Axis();
69 
70     /// establish methods for factory instatiation
71     APPHELPER_SERVICE_FACTORY_HELPER( Axis )
72     /// XServiceInfo declarations
73     APPHELPER_XSERVICEINFO_DECL()
74 
75     /// merge XInterface implementations
76  	DECLARE_XINTERFACE()
77     /// merge XTypeProvider implementations
78  	DECLARE_XTYPEPROVIDER()
79 
80 protected:
81     explicit Axis( const Axis & rOther );
82 
83     // late initialization to call after copy-constructing
84     void Init( const Axis & rOther );
85 
86     // ____ OPropertySet ____
87     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
88         throw(::com::sun::star::beans::UnknownPropertyException);
89 
90     // ____ OPropertySet ____
91 	virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
92 
93     // ____ XPropertySet ____
94     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
95         getPropertySetInfo()
96         throw (::com::sun::star::uno::RuntimeException);
97 
98 // 	virtual sal_Bool SAL_CALL convertFastPropertyValue
99 //         ( ::com::sun::star::uno::Any & rConvertedValue,
100 //           ::com::sun::star::uno::Any & rOldValue,
101 //           sal_Int32 nHandle,
102 //           const ::com::sun::star::uno::Any& rValue )
103 // 		throw (::com::sun::star::lang::IllegalArgumentException);
104 
105     // ____ XAxis ____
106     virtual void SAL_CALL setScaleData( const ::com::sun::star::chart2::ScaleData& rScaleData )
107         throw (::com::sun::star::uno::RuntimeException);
108     virtual ::com::sun::star::chart2::ScaleData SAL_CALL getScaleData()
109         throw (::com::sun::star::uno::RuntimeException);
110     virtual ::com::sun::star::uno::Reference<
111                 ::com::sun::star::beans::XPropertySet > SAL_CALL getGridProperties()
112                     throw (::com::sun::star::uno::RuntimeException);
113     virtual ::com::sun::star::uno::Sequence<
114                 ::com::sun::star::uno::Reference<
115                         ::com::sun::star::beans::XPropertySet > > SAL_CALL getSubGridProperties()
116                     throw (::com::sun::star::uno::RuntimeException);
117     virtual ::com::sun::star::uno::Sequence<
118                 ::com::sun::star::uno::Reference<
119                     ::com::sun::star::beans::XPropertySet > > SAL_CALL getSubTickProperties()
120                     throw (::com::sun::star::uno::RuntimeException);
121 
122     // ____ XTitled ____
123     virtual ::com::sun::star::uno::Reference<
124                 ::com::sun::star::chart2::XTitle > SAL_CALL getTitleObject()
125         throw (::com::sun::star::uno::RuntimeException);
126     virtual void SAL_CALL setTitleObject(
127         const ::com::sun::star::uno::Reference<
128             ::com::sun::star::chart2::XTitle >& Title )
129         throw (::com::sun::star::uno::RuntimeException);
130 
131     // ____ XCloneable ____
132     // Note: the coordinate systems are not cloned!
133     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
134         throw (::com::sun::star::uno::RuntimeException);
135 
136     // ____ XModifyBroadcaster ____
137     virtual void SAL_CALL addModifyListener(
138         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
139         throw (::com::sun::star::uno::RuntimeException);
140     virtual void SAL_CALL removeModifyListener(
141         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
142         throw (::com::sun::star::uno::RuntimeException);
143 
144     // ____ XModifyListener ____
145     virtual void SAL_CALL modified(
146         const ::com::sun::star::lang::EventObject& aEvent )
147         throw (::com::sun::star::uno::RuntimeException);
148 
149     // ____ XEventListener (base of XModifyListener) ____
150     virtual void SAL_CALL disposing(
151         const ::com::sun::star::lang::EventObject& Source )
152         throw (::com::sun::star::uno::RuntimeException);
153 
154     // ____ OPropertySet ____
155     virtual void firePropertyChangeEvent();
156 	using OPropertySet::disposing;
157 
158     void fireModifyEvent();
159 
160 private: //methods
161     void AllocateSubGrids();
162 
163 private: //member
164 
165     ::com::sun::star::uno::Reference<
166         ::com::sun::star::util::XModifyListener >   m_xModifyEventForwarder;
167 
168     ::com::sun::star::chart2::ScaleData             m_aScaleData;
169 
170     ::com::sun::star::uno::Reference<
171         ::com::sun::star::beans::XPropertySet >     m_xGrid;
172 
173     ::com::sun::star::uno::Sequence<
174         ::com::sun::star::uno::Reference<
175             ::com::sun::star::beans::XPropertySet > >     m_aSubGridProperties;
176 
177     ::com::sun::star::uno::Reference<
178         ::com::sun::star::chart2::XTitle >          m_xTitle;
179 };
180 
181 } //  namespace chart
182 
183 // CHART_AXIS_HXX
184 #endif
185