update dev300-m58
[ooovba.git] / configmgr / source / api2 / propertysetaccess.hxx
blob0cf8d0580f1dae7284e9ad810a64a0379563f666
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: propertysetaccess.hxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
31 #ifndef CONFIGMGR_API_PROPERTYSET_HXX_
32 #define CONFIGMGR_API_PROPERTYSET_HXX_
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
36 #include <com/sun/star/beans/XMultiPropertySet.hpp>
37 #include <com/sun/star/beans/XMultiHierarchicalPropertySet.hpp>
38 #include <com/sun/star/beans/XPropertyState.hpp>
39 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
40 #include <cppuhelper/implbase6.hxx>
42 namespace configmgr
44 /////////////////////////////////////////////////////////////////////////////////////////////
45 namespace css = ::com::sun::star;
46 namespace uno = css::uno;
47 namespace lang = css::lang;
48 namespace beans = css::beans;
50 namespace configapi
52 class NodeGroupAccess;
53 class NodeGroupInfoAccess;
56 /////////////////////////////////////////////////////////////////////////////////////////////
58 /** implements the interfaces supported by a group node, viewed as a property set
59 within the configuration tree.
60 <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeGroup(Info)Access</type>.</p>
62 class BasicPropertySet
63 : public ::cppu::ImplHelper6
64 < beans::XPropertySet
65 , beans::XMultiPropertySet
66 , beans::XHierarchicalPropertySet
67 , beans::XMultiHierarchicalPropertySet
68 , beans::XPropertyState
69 , beans::XMultiPropertyStates
72 protected:
73 // Constructors & Destructors
74 virtual ~BasicPropertySet() {}
76 public:
77 // getting Property Metadata
78 // XPropertySet & XMultiPropertySet
79 virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL
80 getPropertySetInfo( )
81 throw(uno::RuntimeException);
83 // XHierarchicalPropertySet & XHierarchicalMultiPropertySet
84 virtual uno::Reference< beans::XHierarchicalPropertySetInfo > SAL_CALL
85 getHierarchicalPropertySetInfo( )
86 throw(uno::RuntimeException);
88 // setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
89 // XPropertySet
90 virtual void SAL_CALL
91 setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
92 throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
93 lang::WrappedTargetException, uno::RuntimeException);
95 // XMultiPropertySet
96 virtual void SAL_CALL
97 setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
98 throw(beans::PropertyVetoException, lang::IllegalArgumentException,
99 lang::WrappedTargetException, uno::RuntimeException);
101 // XHierarchicalPropertySet
102 virtual void SAL_CALL
103 setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
104 throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
105 lang::WrappedTargetException, uno::RuntimeException);
107 // XMultiHierarchicalPropertySet
108 virtual void SAL_CALL
109 setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
110 throw(beans::PropertyVetoException, lang::IllegalArgumentException,
111 lang::WrappedTargetException, uno::RuntimeException);
113 // getting values
114 // XPropertySet
115 virtual uno::Any SAL_CALL
116 getPropertyValue( const rtl::OUString& PropertyName )
117 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
119 // XMultiPropertySet
120 virtual uno::Sequence< uno::Any > SAL_CALL
121 getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
122 throw(uno::RuntimeException);
124 // XHierarchicalPropertySet
125 virtual uno::Any SAL_CALL
126 getHierarchicalPropertyValue( const rtl::OUString& PropertyName )
127 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
129 // XMultiHierarchicalPropertySet
130 virtual uno::Sequence< uno::Any > SAL_CALL
131 getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
132 throw(uno::RuntimeException);
134 // adding listeners
135 // XPropertySet
136 virtual void SAL_CALL
137 addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
138 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
140 // XMultiPropertySet
141 virtual void SAL_CALL
142 addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
143 throw(uno::RuntimeException);
145 // removing listeners
146 // XPropertySet
147 virtual void SAL_CALL
148 removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
149 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
151 // XMultiPropertySet
152 virtual void SAL_CALL
153 removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& Listener )
154 throw(uno::RuntimeException);
156 // SPECIAL: support for VetoableChangeListeners
157 // XPropertySet
158 virtual void SAL_CALL
159 addVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
160 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
162 virtual void SAL_CALL
163 removeVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
164 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
166 // SPECIAL: firePropertiesChangeEvent
167 // XMultiPropertySet
168 virtual void SAL_CALL
169 firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
170 throw(uno::RuntimeException);
172 // XPropertyState
173 virtual beans::PropertyState SAL_CALL
174 getPropertyState( const rtl::OUString& PropertyName )
175 throw(beans::UnknownPropertyException, uno::RuntimeException);
177 // see below:
178 // virtual uno::Sequence< beans::PropertyState > SAL_CALL
179 // getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
180 // throw(beans::UnknownPropertyException, uno::RuntimeException);
182 virtual void SAL_CALL
183 setPropertyToDefault( const rtl::OUString& PropertyName )
184 throw(beans::UnknownPropertyException, uno::RuntimeException);
186 virtual uno::Any SAL_CALL
187 getPropertyDefault( const rtl::OUString& aPropertyName )
188 throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
190 // XMultiPropertyStates
191 virtual uno::Sequence< beans::PropertyState > SAL_CALL
192 getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
193 throw (beans::UnknownPropertyException, uno::RuntimeException);
195 virtual void SAL_CALL
196 setAllPropertiesToDefault( )
197 throw (uno::RuntimeException);
199 virtual void SAL_CALL
200 setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
201 throw (beans::UnknownPropertyException, uno::RuntimeException);
203 virtual uno::Sequence< uno::Any > SAL_CALL
204 getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
205 throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
207 protected:
208 virtual configapi::NodeGroupInfoAccess& getNode() = 0;
209 configapi::NodeGroupAccess& getGroupNode();
210 virtual configapi::NodeGroupAccess* maybeGetUpdateAccess() = 0;
213 //--------------------------------------------------------------------------
216 #endif // CONFIGMGR_API_PROPERTYSET_HXX_