merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / model / main / DataPoint.hxx
blob6917ee9bba492e7abee284b9f518925d39312bd9
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: DataPoint.hxx,v $
10 * $Revision: 1.6.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_DATAPOINT_HXX
31 #define CHART_DATAPOINT_HXX
33 #include <osl/mutex.hxx>
34 #include <cppuhelper/implbase5.hxx>
35 #include <comphelper/uno3.hxx>
36 #include <com/sun/star/container/XChild.hpp>
37 #include <com/sun/star/util/XCloneable.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include "OPropertySet.hxx"
41 #include "MutexContainer.hxx"
42 #include "ModifyListenerHelper.hxx"
43 #include "ServiceMacros.hxx"
45 //for auto_ptr
46 #include <memory>
48 namespace chart
51 namespace impl
53 typedef ::cppu::WeakImplHelper5<
54 ::com::sun::star::container::XChild,
55 ::com::sun::star::util::XCloneable,
56 ::com::sun::star::util::XModifyBroadcaster,
57 ::com::sun::star::util::XModifyListener,
58 ::com::sun::star::lang::XServiceInfo >
59 DataPoint_Base;
62 class DataPoint :
63 public MutexContainer,
64 public impl::DataPoint_Base,
65 public ::property::OPropertySet
67 public:
68 DataPoint( const ::com::sun::star::uno::Reference<
69 ::com::sun::star::beans::XPropertySet > & rParentProperties );
70 virtual ~DataPoint();
72 /// merge XInterface implementations
73 DECLARE_XINTERFACE()
74 /// XServiceInfo declarations
75 APPHELPER_XSERVICEINFO_DECL()
77 protected:
78 explicit DataPoint( const DataPoint & rOther );
80 // ____ OPropertySet ____
81 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
82 throw(::com::sun::star::beans::UnknownPropertyException);
83 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
84 virtual void SAL_CALL setFastPropertyValue_NoBroadcast
85 ( sal_Int32 nHandle,
86 const ::com::sun::star::uno::Any& rValue )
87 throw (::com::sun::star::uno::Exception);
89 // ____ XPropertySet ____
90 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
91 getPropertySetInfo()
92 throw (::com::sun::star::uno::RuntimeException);
94 // ____ XCloneable ____
95 // Note: m_xParentProperties are not cloned!
96 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
97 throw (::com::sun::star::uno::RuntimeException);
99 // ____ XChild ____
100 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent()
101 throw (::com::sun::star::uno::RuntimeException);
102 virtual void SAL_CALL setParent(
103 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
104 throw (::com::sun::star::lang::NoSupportException,
105 ::com::sun::star::uno::RuntimeException);
107 /** const variant of getInfoHelper()
109 ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
111 // ____ XModifyBroadcaster ____
112 virtual void SAL_CALL addModifyListener(
113 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
114 throw (::com::sun::star::uno::RuntimeException);
115 virtual void SAL_CALL removeModifyListener(
116 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
117 throw (::com::sun::star::uno::RuntimeException);
119 // ____ XModifyListener ____
120 virtual void SAL_CALL modified(
121 const ::com::sun::star::lang::EventObject& aEvent )
122 throw (::com::sun::star::uno::RuntimeException);
124 // ____ XEventListener (base of XModifyListener) ____
125 virtual void SAL_CALL disposing(
126 const ::com::sun::star::lang::EventObject& Source )
127 throw (::com::sun::star::uno::RuntimeException);
129 // ____ OPropertySet ____
130 virtual void firePropertyChangeEvent();
131 using OPropertySet::disposing;
133 void fireModifyEvent();
135 private:
136 ::com::sun::star::uno::Reference<
137 ::com::sun::star::beans::XPropertySet > m_xParentProperties;
139 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
140 bool m_bNoParentPropAllowed;
143 } // namespace chart
145 // CHART_DATAPOINT_HXX
146 #endif