merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / tools / ImplOPropertySet.hxx
blob505ab598d7da6accb3c970d26cddf9f055ef3554
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_IMPLOPROPERTYSET_HXX
28 #define CHART_IMPLOPROPERTYSET_HXX
30 #include <com/sun/star/beans/PropertyState.hpp>
31 #include <com/sun/star/uno/Sequence.hxx>
32 #include <com/sun/star/style/XStyle.hpp>
34 #include <map>
35 #include <vector>
37 namespace property
39 namespace impl
42 class ImplOPropertySet
44 public:
45 ImplOPropertySet();
46 explicit ImplOPropertySet( const ImplOPropertySet & rOther );
48 /** supports states DIRECT_VALUE and DEFAULT_VALUE
50 ::com::sun::star::beans::PropertyState
51 GetPropertyStateByHandle( sal_Int32 nHandle ) const;
53 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState >
54 GetPropertyStatesByHandle( const ::std::vector< sal_Int32 > & aHandles ) const;
56 void SetPropertyToDefault( sal_Int32 nHandle );
57 void SetPropertiesToDefault( const ::std::vector< sal_Int32 > & aHandles );
58 void SetAllPropertiesToDefault();
60 /** @param rValue is set to the value for the property given in nHandle. If
61 the property is not set, the style chain is searched for any
62 instance set there. If there was no value found either in the
63 property set itself or any of its styles, rValue remains
64 unchanged and false is returned.
66 @return false if the property is default, true otherwise.
68 bool GetPropertyValueByHandle(
69 ::com::sun::star::uno::Any & rValue,
70 sal_Int32 nHandle ) const;
72 void SetPropertyValueByHandle( sal_Int32 nHandle,
73 const ::com::sun::star::uno::Any & rValue,
74 ::com::sun::star::uno::Any * pOldValue = NULL );
76 bool SetStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > & xStyle );
77 ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
78 GetStyle() const;
80 typedef
81 ::std::map< sal_Int32, ::com::sun::star::uno::Any >
82 tPropertyMap;
84 private:
85 void cloneInterfaceProperties();
87 tPropertyMap m_aProperties;
88 ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
89 m_xStyle;
92 } // namespace impl
93 } // namespace chart
95 // CHART_IMPLOPROPERTYSET_HXX
96 #endif