merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / controller / chartapiwrapper / DataSeriesPointWrapper.hxx
blobb7246306959ce1d0f763bad898ac3e5ffd401d93
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef CHART_DATASERIESPOINTWRAPPER_HXX
28 #define CHART_DATASERIESPOINTWRAPPER_HXX
30 #include "ServiceMacros.hxx"
31 #include "WrappedPropertySet.hxx"
32 #include "ReferenceSizePropertyProvider.hxx"
33 #include <cppuhelper/implbase4.hxx>
34 #include <comphelper/uno3.hxx>
35 #include <cppuhelper/interfacecontainer.hxx>
36 #include <com/sun/star/chart2/XDataSeries.hpp>
37 #include <com/sun/star/frame/XModel.hpp>
38 #include <com/sun/star/lang/XComponent.hpp>
39 #include <com/sun/star/lang/XEventListener.hpp>
40 #include <com/sun/star/lang/XInitialization.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/uno/XComponentContext.hpp>
44 #include <boost/shared_ptr.hpp>
46 namespace chart
49 namespace wrapper
52 class Chart2ModelContact;
54 class DataSeriesPointWrapper : public ::cppu::ImplInheritanceHelper4<
55 WrappedPropertySet
56 , com::sun::star::lang::XServiceInfo
57 , com::sun::star::lang::XInitialization
58 , com::sun::star::lang::XComponent
59 , com::sun::star::lang::XEventListener
61 , public ReferenceSizePropertyProvider
64 public:
65 enum eType
67 DATA_SERIES,
68 DATA_POINT
71 //this constructor needs an initialize call afterwards
72 DataSeriesPointWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
74 DataSeriesPointWrapper( eType eType
75 , sal_Int32 nSeriesIndexInNewAPI
76 , sal_Int32 nPointIndex //ignored for series
77 , ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
79 virtual ~DataSeriesPointWrapper();
81 bool isSupportingAreaProperties();
82 bool isLinesForbidden();
84 /// XServiceInfo declarations
85 APPHELPER_XSERVICEINFO_DECL()
87 // ___lang::XInitialization___
88 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
89 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
91 //ReferenceSizePropertyProvider
92 virtual void updateReferenceSize();
93 virtual ::com::sun::star::uno::Any getReferenceSize();
94 virtual ::com::sun::star::awt::Size getCurrentSizeForReference();
96 protected:
97 // ____ XComponent ____
98 virtual void SAL_CALL dispose()
99 throw (::com::sun::star::uno::RuntimeException);
100 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
101 ::com::sun::star::lang::XEventListener >& xListener )
102 throw (::com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
104 ::com::sun::star::lang::XEventListener >& aListener )
105 throw (::com::sun::star::uno::RuntimeException);
107 // ____ XEventListener ____
108 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
109 throw (::com::sun::star::uno::RuntimeException);
111 protected:
112 // ____ WrappedPropertySet ____
113 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
114 virtual const std::vector< WrappedProperty* > createWrappedProperties();
115 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);
116 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);
117 virtual ::com::sun::star::uno::Reference<
118 ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
120 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
121 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
122 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);
124 //own methods
125 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > getDataSeries();
126 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getDataPointProperties();
128 private:
130 void SAL_CALL getStatisticsPropertyValue
131 ( ::com::sun::star::uno::Any& rValue,
132 sal_Int32 nHandle ) const;
134 void SAL_CALL setStatisticsPropertyValue_NoBroadcast(
135 sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
136 throw (::com::sun::star::uno::Exception);
138 // ----------------------------------------
140 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
141 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
143 eType m_eType;
144 sal_Int32 m_nSeriesIndexInNewAPI;
145 sal_Int32 m_nPointIndex;
147 sal_Bool m_bLinesAllowed;
149 //this should only be used, if the DataSeriesPointWrapper is initialized via the XInitialize interface
150 //because a big change in the chartmodel may leed to an dataseriespointer thats not connected to the model anymore
151 //with the indizes instead we are can aleays get the new dataseries
152 ::com::sun::star::uno::Reference<
153 ::com::sun::star::chart2::XDataSeries > m_xDataSeries;
156 } // namespace wrapper
157 } // namespace chart
159 // CHART_DATASERIESPOINTWRAPPER_HXX
160 #endif