1de7b3f82SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3de7b3f82SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4de7b3f82SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5de7b3f82SAndrew Rist  * distributed with this work for additional information
6de7b3f82SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7de7b3f82SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8de7b3f82SAndrew Rist  * "License"); you may not use this file except in compliance
9de7b3f82SAndrew Rist  * with the License.  You may obtain a copy of the License at
10de7b3f82SAndrew Rist  *
11de7b3f82SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12de7b3f82SAndrew Rist  *
13de7b3f82SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14de7b3f82SAndrew Rist  * software distributed under the License is distributed on an
15de7b3f82SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16de7b3f82SAndrew Rist  * KIND, either express or implied.  See the License for the
17de7b3f82SAndrew Rist  * specific language governing permissions and limitations
18de7b3f82SAndrew Rist  * under the License.
19de7b3f82SAndrew Rist  *
20de7b3f82SAndrew Rist  *************************************************************/
21de7b3f82SAndrew Rist 
22de7b3f82SAndrew Rist 
23cdf0e10cSrcweir #ifndef CHART_DATASERIESPOINTWRAPPER_HXX
24cdf0e10cSrcweir #define CHART_DATASERIESPOINTWRAPPER_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "ServiceMacros.hxx"
27cdf0e10cSrcweir #include "WrappedPropertySet.hxx"
28cdf0e10cSrcweir #include "ReferenceSizePropertyProvider.hxx"
29cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx>
30cdf0e10cSrcweir #include <comphelper/uno3.hxx>
31cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
32cdf0e10cSrcweir #include <com/sun/star/chart2/XDataSeries.hpp>
33cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
34cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp>
35cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
36cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
38cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir namespace chart
43cdf0e10cSrcweir {
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace wrapper
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class Chart2ModelContact;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir class DataSeriesPointWrapper : public ::cppu::ImplInheritanceHelper4<
51cdf0e10cSrcweir                                           WrappedPropertySet
52cdf0e10cSrcweir                                         , com::sun::star::lang::XServiceInfo
53cdf0e10cSrcweir                                         , com::sun::star::lang::XInitialization
54cdf0e10cSrcweir    	                                    , com::sun::star::lang::XComponent
55cdf0e10cSrcweir    	                                    , com::sun::star::lang::XEventListener
56cdf0e10cSrcweir                                         >
57cdf0e10cSrcweir                                         , public ReferenceSizePropertyProvider
58cdf0e10cSrcweir 
59cdf0e10cSrcweir {
60cdf0e10cSrcweir public:
61cdf0e10cSrcweir     enum eType
62cdf0e10cSrcweir     {
63cdf0e10cSrcweir         DATA_SERIES,
64cdf0e10cSrcweir         DATA_POINT
65cdf0e10cSrcweir     };
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     //this constructor needs an initialize call afterwards
68cdf0e10cSrcweir     DataSeriesPointWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     DataSeriesPointWrapper( eType eType
71cdf0e10cSrcweir             , sal_Int32 nSeriesIndexInNewAPI
72cdf0e10cSrcweir             , sal_Int32 nPointIndex //ignored for series
73cdf0e10cSrcweir             , ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact  );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     virtual ~DataSeriesPointWrapper();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     bool isSupportingAreaProperties();
78cdf0e10cSrcweir     bool isLinesForbidden();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     /// XServiceInfo declarations
81cdf0e10cSrcweir     APPHELPER_XSERVICEINFO_DECL()
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     // ___lang::XInitialization___
84cdf0e10cSrcweir     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
85cdf0e10cSrcweir                 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     //ReferenceSizePropertyProvider
88cdf0e10cSrcweir     virtual void updateReferenceSize();
89cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any getReferenceSize();
90cdf0e10cSrcweir     virtual ::com::sun::star::awt::Size getCurrentSizeForReference();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir protected:
93cdf0e10cSrcweir     // ____ XComponent ____
94cdf0e10cSrcweir     virtual void SAL_CALL dispose()
95cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
97cdf0e10cSrcweir                                             ::com::sun::star::lang::XEventListener >& xListener )
98cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
100cdf0e10cSrcweir                                                ::com::sun::star::lang::XEventListener >& aListener )
101cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     // ____ XEventListener ____
104cdf0e10cSrcweir     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
105cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir protected:
108cdf0e10cSrcweir     // ____ WrappedPropertySet ____
109cdf0e10cSrcweir     virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
110cdf0e10cSrcweir     virtual const std::vector< WrappedProperty* > createWrappedProperties();
111cdf0e10cSrcweir     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
112cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
113cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
114cdf0e10cSrcweir                         ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
117cdf0e10cSrcweir     virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
118cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     //own methods
121cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > getDataSeries();
122cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getDataPointProperties();
123cdf0e10cSrcweir 
124cdf0e10cSrcweir private:
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	void SAL_CALL getStatisticsPropertyValue
127cdf0e10cSrcweir         ( ::com::sun::star::uno::Any& rValue,
128cdf0e10cSrcweir           sal_Int32 nHandle ) const;
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     void SAL_CALL setStatisticsPropertyValue_NoBroadcast(
131cdf0e10cSrcweir         sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
132cdf0e10cSrcweir         throw (::com::sun::star::uno::Exception);
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     // ----------------------------------------
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
137cdf0e10cSrcweir 	::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir     eType               m_eType;
140cdf0e10cSrcweir     sal_Int32           m_nSeriesIndexInNewAPI;
141cdf0e10cSrcweir     sal_Int32           m_nPointIndex;
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     sal_Bool            m_bLinesAllowed;
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     //this should only be used, if the DataSeriesPointWrapper is initialized via the XInitialize interface
146*796b7e2aSmseidel     //because a big change in the chartmodel may leed to an dataseriespointer that's not connected to the model anymore
147cdf0e10cSrcweir     //with the indizes instead we are can aleays get the new dataseries
148cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
149cdf0e10cSrcweir         ::com::sun::star::chart2::XDataSeries >     m_xDataSeries;
150cdf0e10cSrcweir };
151cdf0e10cSrcweir 
152cdf0e10cSrcweir } //  namespace wrapper
153cdf0e10cSrcweir } //  namespace chart
154cdf0e10cSrcweir 
155cdf0e10cSrcweir // CHART_DATASERIESPOINTWRAPPER_HXX
156cdf0e10cSrcweir #endif
157