merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / controller / chartapiwrapper / DataSeriesPointWrapper.hxx
blobd575ee5e525d0978b4da5a16b2db0971d301fe02
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataSeriesPointWrapper.hxx,v $
10 * $Revision: 1.7.44.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_DATASERIESPOINTWRAPPER_HXX
31 #define CHART_DATASERIESPOINTWRAPPER_HXX
33 #include "ServiceMacros.hxx"
34 #include "WrappedPropertySet.hxx"
35 #include "ReferenceSizePropertyProvider.hxx"
36 #include <cppuhelper/implbase4.hxx>
37 #include <comphelper/uno3.hxx>
38 #include <cppuhelper/interfacecontainer.hxx>
39 #include <com/sun/star/chart2/XDataSeries.hpp>
40 #include <com/sun/star/frame/XModel.hpp>
41 #include <com/sun/star/lang/XComponent.hpp>
42 #include <com/sun/star/lang/XEventListener.hpp>
43 #include <com/sun/star/lang/XInitialization.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/uno/XComponentContext.hpp>
47 #include <boost/shared_ptr.hpp>
49 namespace chart
52 namespace wrapper
55 class Chart2ModelContact;
57 class DataSeriesPointWrapper : public ::cppu::ImplInheritanceHelper4<
58 WrappedPropertySet
59 , com::sun::star::lang::XServiceInfo
60 , com::sun::star::lang::XInitialization
61 , com::sun::star::lang::XComponent
62 , com::sun::star::lang::XEventListener
64 , public ReferenceSizePropertyProvider
67 public:
68 enum eType
70 DATA_SERIES,
71 DATA_POINT
74 //this constructor needs an initialize call afterwards
75 DataSeriesPointWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
77 DataSeriesPointWrapper( eType eType
78 , sal_Int32 nSeriesIndexInNewAPI
79 , sal_Int32 nPointIndex //ignored for series
80 , ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
82 virtual ~DataSeriesPointWrapper();
84 bool isSupportingAreaProperties();
85 bool isLinesForbidden();
87 /// XServiceInfo declarations
88 APPHELPER_XSERVICEINFO_DECL()
90 // ___lang::XInitialization___
91 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
92 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
94 //ReferenceSizePropertyProvider
95 virtual void updateReferenceSize();
96 virtual ::com::sun::star::uno::Any getReferenceSize();
97 virtual ::com::sun::star::awt::Size getCurrentSizeForReference();
99 protected:
100 // ____ XComponent ____
101 virtual void SAL_CALL dispose()
102 throw (::com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
104 ::com::sun::star::lang::XEventListener >& xListener )
105 throw (::com::sun::star::uno::RuntimeException);
106 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
107 ::com::sun::star::lang::XEventListener >& aListener )
108 throw (::com::sun::star::uno::RuntimeException);
110 // ____ XEventListener ____
111 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
112 throw (::com::sun::star::uno::RuntimeException);
114 protected:
115 // ____ WrappedPropertySet ____
116 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
117 virtual const std::vector< WrappedProperty* > createWrappedProperties();
118 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);
119 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);
120 virtual ::com::sun::star::uno::Reference<
121 ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
123 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
124 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
125 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);
127 //own methods
128 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > getDataSeries();
129 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getDataPointProperties();
131 private:
133 void SAL_CALL getStatisticsPropertyValue
134 ( ::com::sun::star::uno::Any& rValue,
135 sal_Int32 nHandle ) const;
137 void SAL_CALL setStatisticsPropertyValue_NoBroadcast(
138 sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
139 throw (::com::sun::star::uno::Exception);
141 // ----------------------------------------
143 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
144 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
146 eType m_eType;
147 sal_Int32 m_nSeriesIndexInNewAPI;
148 sal_Int32 m_nPointIndex;
150 sal_Bool m_bLinesAllowed;
152 //this should only be used, if the DataSeriesPointWrapper is initialized via the XInitialize interface
153 //because a big change in the chartmodel may leed to an dataseriespointer thats not connected to the model anymore
154 //with the indizes instead we are can aleays get the new dataseries
155 ::com::sun::star::uno::Reference<
156 ::com::sun::star::chart2::XDataSeries > m_xDataSeries;
159 } // namespace wrapper
160 } // namespace chart
162 // CHART_DATASERIESPOINTWRAPPER_HXX
163 #endif