merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / model / main / DataPoint.hxx
blob1498b8345963673912e20907372a5a3578b65315
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_DATAPOINT_HXX
28 #define CHART_DATAPOINT_HXX
30 #include <osl/mutex.hxx>
31 #include <cppuhelper/implbase5.hxx>
32 #include <comphelper/uno3.hxx>
33 #include <com/sun/star/container/XChild.hpp>
34 #include <com/sun/star/util/XCloneable.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include "OPropertySet.hxx"
38 #include "MutexContainer.hxx"
39 #include "ModifyListenerHelper.hxx"
40 #include "ServiceMacros.hxx"
42 //for auto_ptr
43 #include <memory>
45 namespace chart
48 namespace impl
50 typedef ::cppu::WeakImplHelper5<
51 ::com::sun::star::container::XChild,
52 ::com::sun::star::util::XCloneable,
53 ::com::sun::star::util::XModifyBroadcaster,
54 ::com::sun::star::util::XModifyListener,
55 ::com::sun::star::lang::XServiceInfo >
56 DataPoint_Base;
59 class DataPoint :
60 public MutexContainer,
61 public impl::DataPoint_Base,
62 public ::property::OPropertySet
64 public:
65 DataPoint( const ::com::sun::star::uno::Reference<
66 ::com::sun::star::beans::XPropertySet > & rParentProperties );
67 virtual ~DataPoint();
69 /// merge XInterface implementations
70 DECLARE_XINTERFACE()
71 /// XServiceInfo declarations
72 APPHELPER_XSERVICEINFO_DECL()
74 protected:
75 explicit DataPoint( const DataPoint & rOther );
77 // ____ OPropertySet ____
78 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
79 throw(::com::sun::star::beans::UnknownPropertyException);
80 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
81 virtual void SAL_CALL setFastPropertyValue_NoBroadcast
82 ( sal_Int32 nHandle,
83 const ::com::sun::star::uno::Any& rValue )
84 throw (::com::sun::star::uno::Exception);
86 // ____ XPropertySet ____
87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
88 getPropertySetInfo()
89 throw (::com::sun::star::uno::RuntimeException);
91 // ____ XCloneable ____
92 // Note: m_xParentProperties are not cloned!
93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
94 throw (::com::sun::star::uno::RuntimeException);
96 // ____ XChild ____
97 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent()
98 throw (::com::sun::star::uno::RuntimeException);
99 virtual void SAL_CALL setParent(
100 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
101 throw (::com::sun::star::lang::NoSupportException,
102 ::com::sun::star::uno::RuntimeException);
104 /** const variant of getInfoHelper()
106 ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
108 // ____ XModifyBroadcaster ____
109 virtual void SAL_CALL addModifyListener(
110 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
111 throw (::com::sun::star::uno::RuntimeException);
112 virtual void SAL_CALL removeModifyListener(
113 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
114 throw (::com::sun::star::uno::RuntimeException);
116 // ____ XModifyListener ____
117 virtual void SAL_CALL modified(
118 const ::com::sun::star::lang::EventObject& aEvent )
119 throw (::com::sun::star::uno::RuntimeException);
121 // ____ XEventListener (base of XModifyListener) ____
122 virtual void SAL_CALL disposing(
123 const ::com::sun::star::lang::EventObject& Source )
124 throw (::com::sun::star::uno::RuntimeException);
126 // ____ OPropertySet ____
127 virtual void firePropertyChangeEvent();
128 using OPropertySet::disposing;
130 void fireModifyEvent();
132 private:
133 ::com::sun::star::uno::Reference<
134 ::com::sun::star::beans::XPropertySet > m_xParentProperties;
136 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
137 bool m_bNoParentPropAllowed;
140 } // namespace chart
142 // CHART_DATAPOINT_HXX
143 #endif