CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / animations / STLPropertySet.hxx
blob2d5d95b5d7f49b66523efbd699b181d52a83eb99
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 ************************************************************************/
28 #ifndef _SD_STLPROPERTYSET_HXX
29 #define _SD_STLPROPERTYSET_HXX
31 #include <com/sun/star/beans/PropertyValue.hpp>
33 #ifndef _UTL_STLTYPES_HXX_
34 #include <comphelper/stl_types.hxx>
35 #endif
37 #include <list>
38 #include <map>
40 namespace sd
43 const sal_Int32 STLPropertyState_DEFAULT = 0;
44 const sal_Int32 STLPropertyState_DIRECT = 1;
45 const sal_Int32 STLPropertyState_AMBIGUOUS = 3;
47 struct STLPropertyMapEntry
49 ::com::sun::star::uno::Any maValue;
50 sal_Int32 mnState;
52 STLPropertyMapEntry()
53 : mnState( STLPropertyState_AMBIGUOUS ) {}
54 STLPropertyMapEntry( ::com::sun::star::uno::Any aValue, sal_Int32 nState = STLPropertyState_DEFAULT )
55 : maValue( aValue ), mnState( nState ) {}
59 typedef std::map<sal_Int32, STLPropertyMapEntry > PropertyMap;
60 typedef PropertyMap::iterator PropertyMapIter;
61 typedef PropertyMap::const_iterator PropertyMapConstIter;
63 class STLPropertySet
65 public:
66 STLPropertySet();
67 ~STLPropertySet();
69 void setPropertyDefaultValue( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue );
70 void setPropertyValue( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue, sal_Int32 nState = STLPropertyState_DIRECT );
71 ::com::sun::star::uno::Any getPropertyValue( sal_Int32 nHandle ) const;
73 sal_Int32 getPropertyState( sal_Int32 nHandle ) const;
74 void setPropertyState( sal_Int32 nHandle, sal_Int32 nState );
76 private:
77 bool findProperty( sal_Int32 nHandle, PropertyMapIter& rIter );
78 bool findProperty( sal_Int32 nHandle, PropertyMapConstIter& rIter ) const;
80 private:
81 PropertyMap maPropertyMap;
86 #endif // _SD_STLPROPERTYSET_HXX