Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svtools / itemprop.hxx
blobac225a117c5e1307f03a70cade9bcec43374b0c8
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: itemprop.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 _SFX_ITEMPROP_HXX
31 #define _SFX_ITEMPROP_HXX
33 #include <tools/solar.h>
34 #include <tools/string.hxx>
35 #include <bf_svtools/itemset.hxx>
36 #include <cppuhelper/implbase1.hxx>
37 #include <com/sun/star/beans/XPropertySetInfo.hpp>
38 #include <com/sun/star/beans/PropertyState.hpp>
39 #include <com/sun/star/lang/IllegalArgumentException.hpp>
41 namespace binfilter
44 /* -----------------------------21.02.00 11:03--------------------------------
45 UNO III - Implementation
46 ---------------------------------------------------------------------------*/
47 #define MAP_CHAR_LEN(cchar) cchar, sizeof(cchar) - 1
48 struct SfxItemPropertyMap
50 const char* pName;
51 USHORT nNameLen;
52 USHORT nWID;
53 const ::com::sun::star::uno::Type* pType;
54 long nFlags;
55 BYTE nMemberId;
57 static const SfxItemPropertyMap* GetByName(
58 const SfxItemPropertyMap *pMap,
59 const ::rtl::OUString &rName );
61 /* -----------------------------21.02.00 11:19--------------------------------
63 ---------------------------------------------------------------------------*/
64 class SfxItemPropertySet
66 const SfxItemPropertyMap* _pMap;
67 protected:
68 virtual BOOL FillItem(SfxItemSet& rSet, USHORT nWhich, BOOL bGetProperty) const;
70 public:
71 SfxItemPropertySet( const SfxItemPropertyMap *pMap ) :
72 _pMap(pMap) {}
74 void getPropertyValue( const SfxItemPropertyMap& rMap,
75 const SfxItemSet& rSet,
76 ::com::sun::star::uno::Any& rAny) const
77 throw(::com::sun::star::uno::RuntimeException);
78 ::com::sun::star::uno::Any
79 getPropertyValue( const SfxItemPropertyMap& rMap,
80 const SfxItemSet& rSet ) const
81 throw(::com::sun::star::uno::RuntimeException);
82 void getPropertyValue( const ::rtl::OUString &rName,
83 const SfxItemSet& rSet,
84 ::com::sun::star::uno::Any& rAny) const
85 throw(::com::sun::star::uno::RuntimeException,
86 ::com::sun::star::beans::UnknownPropertyException);
87 ::com::sun::star::uno::Any
88 getPropertyValue( const ::rtl::OUString &rName,
89 const SfxItemSet& rSet ) const
90 throw(::com::sun::star::uno::RuntimeException,
91 ::com::sun::star::beans::UnknownPropertyException);
92 void setPropertyValue( const SfxItemPropertyMap& rMap,
93 const ::com::sun::star::uno::Any& aVal,
94 SfxItemSet& rSet ) const
95 throw(::com::sun::star::uno::RuntimeException,
96 ::com::sun::star::lang::IllegalArgumentException);
97 void setPropertyValue( const ::rtl::OUString& rPropertyName,
98 const ::com::sun::star::uno::Any& aVal,
99 SfxItemSet& rSet ) const
100 throw(::com::sun::star::uno::RuntimeException,
101 ::com::sun::star::lang::IllegalArgumentException,
102 ::com::sun::star::beans::UnknownPropertyException);
104 ::com::sun::star::beans::PropertyState
105 getPropertyState(const ::rtl::OUString& rName, const SfxItemSet& rSet)
106 throw(::com::sun::star::beans::UnknownPropertyException);
107 ::com::sun::star::beans::PropertyState
108 getPropertyState(const SfxItemPropertyMap& rMap, const SfxItemSet& rSet)
109 throw();
111 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
112 getPropertySetInfo() const;
113 const SfxItemPropertyMap*
114 getPropertyMap() const {return _pMap;}
118 class SfxItemPropertySetInfo : public cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertySetInfo>
120 const SfxItemPropertyMap* _pMap;
122 public:
123 SfxItemPropertySetInfo(const SfxItemPropertyMap *pMap ) :
124 _pMap(pMap) {}
126 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL
127 getProperties( )
128 throw(::com::sun::star::uno::RuntimeException);
130 virtual ::com::sun::star::beans::Property SAL_CALL
131 getPropertyByName( const ::rtl::OUString& aName )
132 throw(::com::sun::star::beans::UnknownPropertyException,
133 ::com::sun::star::uno::RuntimeException);
135 virtual sal_Bool SAL_CALL
136 hasPropertyByName( const ::rtl::OUString& Name )
137 throw(::com::sun::star::uno::RuntimeException);
139 const SfxItemPropertyMap* getMap() const { return _pMap; }
141 // XInterface
142 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
143 virtual void SAL_CALL acquire( ) throw ();
144 virtual void SAL_CALL release( ) throw ();
146 /* -----------------------------21.02.00 12:01--------------------------------
148 ---------------------------------------------------------------------------*/
149 class SfxExtItemPropertySetInfo: public cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertySetInfo >
151 const SfxItemPropertyMap* _pExtMap;
152 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property> aPropertySeq;
153 public:
154 SfxExtItemPropertySetInfo(
155 const SfxItemPropertyMap *pMap,
156 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& rPropSeq );
158 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL
159 getProperties( )
160 throw(::com::sun::star::uno::RuntimeException);
162 virtual ::com::sun::star::beans::Property SAL_CALL
163 getPropertyByName( const ::rtl::OUString& aName )
164 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
166 virtual sal_Bool SAL_CALL
167 hasPropertyByName( const ::rtl::OUString& Name )
168 throw(::com::sun::star::uno::RuntimeException);
170 // XInterface
171 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
172 virtual void SAL_CALL acquire( ) throw ();
173 virtual void SAL_CALL release( ) throw ();
178 #endif