xref: /AOO41X/main/udkapi/com/sun/star/beans/XPropertySet.idl (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_beans_XPropertySet_idl__
28#define __com_sun_star_beans_XPropertySet_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_beans_XPropertySetInfo_idl__
35#include <com/sun/star/beans/XPropertySetInfo.idl>
36#endif
37
38#ifndef __com_sun_star_beans_UnknownPropertyException_idl__
39#include <com/sun/star/beans/UnknownPropertyException.idl>
40#endif
41
42#ifndef __com_sun_star_beans_PropertyVetoException_idl__
43#include <com/sun/star/beans/PropertyVetoException.idl>
44#endif
45
46#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
47#include <com/sun/star/lang/IllegalArgumentException.idl>
48#endif
49
50#ifndef __com_sun_star_lang_WrappedTargetException_idl__
51#include <com/sun/star/lang/WrappedTargetException.idl>
52#endif
53
54#ifndef __com_sun_star_beans_XPropertyChangeListener_idl__
55#include <com/sun/star/beans/XPropertyChangeListener.idl>
56#endif
57
58#ifndef __com_sun_star_beans_XVetoableChangeListener_idl__
59#include <com/sun/star/beans/XVetoableChangeListener.idl>
60#endif
61
62
63//=============================================================================
64
65module com {  module sun {  module star {  module beans {
66
67//=============================================================================
68
69/** provides information about and access to the
70	properties from an implementation.
71
72	<p>There are three types of properties: </p>
73
74	<ul>
75		<li>bound properties </li>
76		<li>constrained properties </li>
77		<li>free properties </li>
78	</ul>
79
80	<p>You can listen to changes of bound properties with the
81	<type>XPropertyChangeListener</type> and you can veto changes
82	of constrained properties with the <type>XVetoableChangeListener</type>.  </p>
83
84	<p>To implement inaccurate name access, you must support the
85	interface <type>XExactName</type>. </p>
86
87	@see com::sun::star::beans::XExactName
88 */
89published interface XPropertySet: com::sun::star::uno::XInterface
90{
91	//-------------------------------------------------------------------------
92
93	/** @returns
94			the <type>XPropertySetInfo</type> interface, which
95			describes all properties of the object which supplies this
96			interface.
97
98		@returns
99			<const>NULL</const> if the implementation cannot or will
100			not provide information about the properties; otherwise the
101			interface <type>XPropertySetInfo</type> is returned.
102	 */
103	com::sun::star::beans::XPropertySetInfo getPropertySetInfo();
104
105	//-------------------------------------------------------------------------
106
107	/** sets the value of the property with the specified name.
108
109		<p>If it is a bound property the value will be changed before
110		the change event is fired.  If it is a constrained property
111		a vetoable event is fired before the property value can be
112		changed.  </p>
113
114		@throws com::sun::star::beans::PropertyVetoException
115			if the property is read-only or vetoable
116			and one of the listeners throws this exception
117			because of an unaccepted new value.
118	 */
119	void setPropertyValue( [in] string aPropertyName,
120			 [in] any aValue )
121			raises( com::sun::star::beans::UnknownPropertyException,
122					com::sun::star::beans::PropertyVetoException,
123					com::sun::star::lang::IllegalArgumentException,
124					com::sun::star::lang::WrappedTargetException );
125
126	//-------------------------------------------------------------------------
127
128	/** @returns
129			the value of the property with the specified name.
130
131		@param PropertyName
132			This parameter specifies the name of the property.
133
134		@throws UnknownPropertyException
135			if the property does not exist.
136
137		@throws com::sun::star::lang::WrappedTargetException
138			if the implementation has an internal reason for the exception.
139			In this case the original exception is wrapped into that
140			<type scope="com::sun::star::lang">WrappedTargetException</type>.
141	 */
142	any getPropertyValue( [in] string PropertyName )
143			raises( com::sun::star::beans::UnknownPropertyException,
144					com::sun::star::lang::WrappedTargetException );
145
146	//-------------------------------------------------------------------------
147
148	/** adds an <type>XPropertyChangeListener</type> to the specified property.
149
150		<p>An empty name ("") registers the listener to all bound
151		properties. If the property is not bound, the behavior is
152		not specified.  </p>
153
154		<p>It is suggested to allow multiple registration of the same listener,
155		thus for each time a listener is added, it has to be removed.
156
157		@see removePropertyChangeListener
158	 */
159	void addPropertyChangeListener( [in] string aPropertyName,
160			 [in] com::sun::star::beans::XPropertyChangeListener xListener )
161			raises( com::sun::star::beans::UnknownPropertyException,
162					com::sun::star::lang::WrappedTargetException );
163
164	//-------------------------------------------------------------------------
165
166	/** removes an <type>XPropertyChangeListener</type> from
167		the listener list.
168
169		<p>It is a "noop" if the listener is not registered.  </p>
170
171		<p>It is suggested to allow multiple registration of the same listener,
172		thus for each time a listener is added, it has to be removed.
173
174		@see addPropertyChangeListener
175	 */
176	void removePropertyChangeListener( [in] string aPropertyName,
177			 [in] com::sun::star::beans::XPropertyChangeListener aListener )
178			raises( com::sun::star::beans::UnknownPropertyException,
179					com::sun::star::lang::WrappedTargetException );
180
181	//-------------------------------------------------------------------------
182
183	/** adds an <type>XVetoableChangeListener</type> to the specified
184		property with the name PropertyName.
185
186		<p>An empty name ("") registers the listener to all
187		constrained properties. If the property is not constrained,
188		the behavior is not specified.  </p>
189
190		@see removeVetoableChangeListener
191	 */
192	void addVetoableChangeListener( [in] string PropertyName,
193			 [in] com::sun::star::beans::XVetoableChangeListener aListener )
194			raises( com::sun::star::beans::UnknownPropertyException,
195					com::sun::star::lang::WrappedTargetException );
196
197	//-------------------------------------------------------------------------
198
199	/** removes an <type>XVetoableChangeListener</type> from the
200		listener list.
201
202		<p>It is a "noop" if the listener is not registered.  </p>
203
204		@see addVetoableChangeListener
205	 */
206	void removeVetoableChangeListener( [in] string PropertyName,
207			 [in] com::sun::star::beans::XVetoableChangeListener aListener )
208			raises( com::sun::star::beans::UnknownPropertyException,
209					com::sun::star::lang::WrappedTargetException );
210
211};
212
213//=============================================================================
214
215}; }; }; };
216
217#endif
218