merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / tools / ImplOPropertySet.hxx
blob12cac0112e3b335d860f4a251be575353482dadc
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: ImplOPropertySet.hxx,v $
10 * $Revision: 1.4 $
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_IMPLOPROPERTYSET_HXX
31 #define CHART_IMPLOPROPERTYSET_HXX
33 #include <com/sun/star/beans/PropertyState.hpp>
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/style/XStyle.hpp>
37 #include <map>
38 #include <vector>
40 namespace property
42 namespace impl
45 class ImplOPropertySet
47 public:
48 ImplOPropertySet();
49 explicit ImplOPropertySet( const ImplOPropertySet & rOther );
51 /** supports states DIRECT_VALUE and DEFAULT_VALUE
53 ::com::sun::star::beans::PropertyState
54 GetPropertyStateByHandle( sal_Int32 nHandle ) const;
56 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState >
57 GetPropertyStatesByHandle( const ::std::vector< sal_Int32 > & aHandles ) const;
59 void SetPropertyToDefault( sal_Int32 nHandle );
60 void SetPropertiesToDefault( const ::std::vector< sal_Int32 > & aHandles );
61 void SetAllPropertiesToDefault();
63 /** @param rValue is set to the value for the property given in nHandle. If
64 the property is not set, the style chain is searched for any
65 instance set there. If there was no value found either in the
66 property set itself or any of its styles, rValue remains
67 unchanged and false is returned.
69 @return false if the property is default, true otherwise.
71 bool GetPropertyValueByHandle(
72 ::com::sun::star::uno::Any & rValue,
73 sal_Int32 nHandle ) const;
75 void SetPropertyValueByHandle( sal_Int32 nHandle,
76 const ::com::sun::star::uno::Any & rValue,
77 ::com::sun::star::uno::Any * pOldValue = NULL );
79 bool SetStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > & xStyle );
80 ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
81 GetStyle() const;
83 typedef
84 ::std::map< sal_Int32, ::com::sun::star::uno::Any >
85 tPropertyMap;
87 private:
88 void cloneInterfaceProperties();
90 tPropertyMap m_aProperties;
91 ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
92 m_xStyle;
95 } // namespace impl
96 } // namespace chart
98 // CHART_IMPLOPROPERTYSET_HXX
99 #endif