1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_beans_XPropertySet_idl__
24#define __com_sun_star_beans_XPropertySet_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_beans_XPropertySetInfo_idl__
31#include <com/sun/star/beans/XPropertySetInfo.idl>
32#endif
33
34#ifndef __com_sun_star_beans_UnknownPropertyException_idl__
35#include <com/sun/star/beans/UnknownPropertyException.idl>
36#endif
37
38#ifndef __com_sun_star_beans_PropertyVetoException_idl__
39#include <com/sun/star/beans/PropertyVetoException.idl>
40#endif
41
42#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
43#include <com/sun/star/lang/IllegalArgumentException.idl>
44#endif
45
46#ifndef __com_sun_star_lang_WrappedTargetException_idl__
47#include <com/sun/star/lang/WrappedTargetException.idl>
48#endif
49
50#ifndef __com_sun_star_beans_XPropertyChangeListener_idl__
51#include <com/sun/star/beans/XPropertyChangeListener.idl>
52#endif
53
54#ifndef __com_sun_star_beans_XVetoableChangeListener_idl__
55#include <com/sun/star/beans/XVetoableChangeListener.idl>
56#endif
57
58
59//=============================================================================
60
61module com {  module sun {  module star {  module beans {
62
63//=============================================================================
64
65/** provides information about and access to the
66	properties from an implementation.
67
68	<p>There are three types of properties: </p>
69
70	<ul>
71		<li>bound properties </li>
72		<li>constrained properties </li>
73		<li>free properties </li>
74	</ul>
75
76	<p>You can listen to changes of bound properties with the
77	<type>XPropertyChangeListener</type> and you can veto changes
78	of constrained properties with the <type>XVetoableChangeListener</type>.  </p>
79
80	<p>To implement inaccurate name access, you must support the
81	interface <type>XExactName</type>. </p>
82
83	@see com::sun::star::beans::XExactName
84 */
85published interface XPropertySet: com::sun::star::uno::XInterface
86{
87	//-------------------------------------------------------------------------
88
89	/** @returns
90			the <type>XPropertySetInfo</type> interface, which
91			describes all properties of the object which supplies this
92			interface.
93
94		@returns
95			<const>NULL</const> if the implementation cannot or will
96			not provide information about the properties; otherwise the
97			interface <type>XPropertySetInfo</type> is returned.
98	 */
99	com::sun::star::beans::XPropertySetInfo getPropertySetInfo();
100
101	//-------------------------------------------------------------------------
102
103	/** sets the value of the property with the specified name.
104
105		<p>If it is a bound property the value will be changed before
106		the change event is fired.  If it is a constrained property
107		a vetoable event is fired before the property value can be
108		changed.  </p>
109
110		@throws com::sun::star::beans::PropertyVetoException
111			if the property is read-only or vetoable
112			and one of the listeners throws this exception
113			because of an unaccepted new value.
114	 */
115	void setPropertyValue( [in] string aPropertyName,
116			 [in] any aValue )
117			raises( com::sun::star::beans::UnknownPropertyException,
118					com::sun::star::beans::PropertyVetoException,
119					com::sun::star::lang::IllegalArgumentException,
120					com::sun::star::lang::WrappedTargetException );
121
122	//-------------------------------------------------------------------------
123
124	/** @returns
125			the value of the property with the specified name.
126
127		@param PropertyName
128			This parameter specifies the name of the property.
129
130		@throws UnknownPropertyException
131			if the property does not exist.
132
133		@throws com::sun::star::lang::WrappedTargetException
134			if the implementation has an internal reason for the exception.
135			In this case the original exception is wrapped into that
136			<type scope="com::sun::star::lang">WrappedTargetException</type>.
137	 */
138	any getPropertyValue( [in] string PropertyName )
139			raises( com::sun::star::beans::UnknownPropertyException,
140					com::sun::star::lang::WrappedTargetException );
141
142	//-------------------------------------------------------------------------
143
144	/** adds an <type>XPropertyChangeListener</type> to the specified property.
145
146		<p>An empty name ("") registers the listener to all bound
147		properties. If the property is not bound, the behavior is
148		not specified.  </p>
149
150		<p>It is suggested to allow multiple registration of the same listener,
151		thus for each time a listener is added, it has to be removed.
152
153		@see removePropertyChangeListener
154	 */
155	void addPropertyChangeListener( [in] string aPropertyName,
156			 [in] com::sun::star::beans::XPropertyChangeListener xListener )
157			raises( com::sun::star::beans::UnknownPropertyException,
158					com::sun::star::lang::WrappedTargetException );
159
160	//-------------------------------------------------------------------------
161
162	/** removes an <type>XPropertyChangeListener</type> from
163		the listener list.
164
165		<p>It is a "noop" if the listener is not registered.  </p>
166
167		<p>It is suggested to allow multiple registration of the same listener,
168		thus for each time a listener is added, it has to be removed.
169
170		@see addPropertyChangeListener
171	 */
172	void removePropertyChangeListener( [in] string aPropertyName,
173			 [in] com::sun::star::beans::XPropertyChangeListener aListener )
174			raises( com::sun::star::beans::UnknownPropertyException,
175					com::sun::star::lang::WrappedTargetException );
176
177	//-------------------------------------------------------------------------
178
179	/** adds an <type>XVetoableChangeListener</type> to the specified
180		property with the name PropertyName.
181
182		<p>An empty name ("") registers the listener to all
183		constrained properties. If the property is not constrained,
184		the behavior is not specified.  </p>
185
186		@see removeVetoableChangeListener
187	 */
188	void addVetoableChangeListener( [in] string PropertyName,
189			 [in] com::sun::star::beans::XVetoableChangeListener aListener )
190			raises( com::sun::star::beans::UnknownPropertyException,
191					com::sun::star::lang::WrappedTargetException );
192
193	//-------------------------------------------------------------------------
194
195	/** removes an <type>XVetoableChangeListener</type> from the
196		listener list.
197
198		<p>It is a "noop" if the listener is not registered.  </p>
199
200		@see addVetoableChangeListener
201	 */
202	void removeVetoableChangeListener( [in] string PropertyName,
203			 [in] com::sun::star::beans::XVetoableChangeListener aListener )
204			raises( com::sun::star::beans::UnknownPropertyException,
205					com::sun::star::lang::WrappedTargetException );
206
207};
208
209//=============================================================================
210
211}; }; }; };
212
213#endif
214