1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_inspection_XPropertyHandler_idl__
28*cdf0e10cSrcweir#define __com_sun_star_inspection_XPropertyHandler_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyState_idl__
31*cdf0e10cSrcweir#include <com/sun/star/beans/PropertyState.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir#ifndef __com_sun_star_beans_Property_idl__
34*cdf0e10cSrcweir#include <com/sun/star/beans/Property.idl>
35*cdf0e10cSrcweir#endif
36*cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertyChangeListener_idl__
37*cdf0e10cSrcweir#include <com/sun/star/beans/XPropertyChangeListener.idl>
38*cdf0e10cSrcweir#endif
39*cdf0e10cSrcweir#ifndef __com_sun_star_inspection_LineDescriptor_idl__
40*cdf0e10cSrcweir#include <com/sun/star/inspection/LineDescriptor.idl>
41*cdf0e10cSrcweir#endif
42*cdf0e10cSrcweir#ifndef __com_sun_star_lang_NullPointerException_idl__
43*cdf0e10cSrcweir#include <com/sun/star/lang/NullPointerException.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir#ifndef __com_sun_star_beans_UnknownPropertyException_idl__
46*cdf0e10cSrcweir#include <com/sun/star/beans/UnknownPropertyException.idl>
47*cdf0e10cSrcweir#endif
48*cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
49*cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
50*cdf0e10cSrcweir#endif
51*cdf0e10cSrcweir#ifndef __com_sun_star_inspection_InteractiveSelectionResult_idl__
52*cdf0e10cSrcweir#include <com/sun/star/inspection/InteractiveSelectionResult.idl>
53*cdf0e10cSrcweir#endif
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir//=============================================================================
56*cdf0e10cSrcweirmodule com {  module sun {  module star {  module inspection {
57*cdf0e10cSrcweir
58*cdf0e10cSrcweirpublished interface XObjectInspectorUI;
59*cdf0e10cSrcweirpublished interface XPropertyControlFactory;
60*cdf0e10cSrcweir
61*cdf0e10cSrcweir//-----------------------------------------------------------------------------
62*cdf0e10cSrcweir/** is the basic interface for object inspection.
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir    <p>The <type>ObjectInspector</type> itself does not know anything about the object
65*cdf0e10cSrcweir    it is inspecting, all information is obtained via <type>XPropertyHandler</type>s.
66*cdf0e10cSrcweir    Also, property handlers are responsible for describing the user interface which should
67*cdf0e10cSrcweir    be used to interact with the user, with respect to a given aspect of the inspected
68*cdf0e10cSrcweir    component.</p>
69*cdf0e10cSrcweir
70*cdf0e10cSrcweir    @see ObjectInspector
71*cdf0e10cSrcweir    @see LineDescriptor
72*cdf0e10cSrcweir
73*cdf0e10cSrcweir    @since OOo 2.0.3
74*cdf0e10cSrcweir*/
75*cdf0e10cSrcweirpublished interface XPropertyHandler
76*cdf0e10cSrcweir{
77*cdf0e10cSrcweir    /** used for controlling resources acquired by the handler
78*cdf0e10cSrcweir
79*cdf0e10cSrcweir        <p><member scope="com::sun::star::lang">XComponent::dispose</member> is invoked when the property handler is not
80*cdf0e10cSrcweir        needed by the object inspector anymore. Handler implementations should clean up any
81*cdf0e10cSrcweir        resources here.</p>
82*cdf0e10cSrcweir    */
83*cdf0e10cSrcweir    interface com::sun::star::lang::XComponent;
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir    /** binds the property handler to a new component
86*cdf0e10cSrcweir        @param Component
87*cdf0e10cSrcweir            the component to inspect. Must not be <NULL/>
88*cdf0e10cSrcweir        @throws com::sun::star::lang::NullPointerException
89*cdf0e10cSrcweir            if the component is <NULL/>
90*cdf0e10cSrcweir    */
91*cdf0e10cSrcweir    void inspect( [in] com::sun::star::uno::XInterface Component )
92*cdf0e10cSrcweir        raises( com::sun::star::lang::NullPointerException );
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir    /** retrieves the current value of a property
95*cdf0e10cSrcweir        @param PropertyName
96*cdf0e10cSrcweir            the name of the property whose value is to be retrieved
97*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
98*cdf0e10cSrcweir            if the given property is not supported by the property handler
99*cdf0e10cSrcweir    */
100*cdf0e10cSrcweir    any
101*cdf0e10cSrcweir        getPropertyValue( [in] string PropertyName )
102*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException);
103*cdf0e10cSrcweir
104*cdf0e10cSrcweir    /** sets the value of a property
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir        @param  PropertyName
107*cdf0e10cSrcweir            the name of the property whose value is to be set
108*cdf0e10cSrcweir        @param  Value
109*cdf0e10cSrcweir            the property value to set
110*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
111*cdf0e10cSrcweir            if the given property is not supported by the property handler
112*cdf0e10cSrcweir    */
113*cdf0e10cSrcweir    void
114*cdf0e10cSrcweir        setPropertyValue( [in] string PropertyName, [in] any Value )
115*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException);
116*cdf0e10cSrcweir
117*cdf0e10cSrcweir    /** returns the state of a property
118*cdf0e10cSrcweir
119*cdf0e10cSrcweir        @param  PropertyName
120*cdf0e10cSrcweir            the name of the property whose state is to be retrieved
121*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
122*cdf0e10cSrcweir            if the given property is not supported by the property handler
123*cdf0e10cSrcweir    */
124*cdf0e10cSrcweir    com::sun::star::beans::PropertyState
125*cdf0e10cSrcweir        getPropertyState( [in] string PropertyName )
126*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException);
127*cdf0e10cSrcweir
128*cdf0e10cSrcweir    /** describes the UI to be used to represent the property
129*cdf0e10cSrcweir        @param PropertyName
130*cdf0e10cSrcweir            the name of the property whose user interface is to be described
131*cdf0e10cSrcweir            implementation
132*cdf0e10cSrcweir        @param ControlFactory
133*cdf0e10cSrcweir            a factory for creating <type>XPropertyControl</type> instances. Must not be <NULL/>.
134*cdf0e10cSrcweir        @return
135*cdf0e10cSrcweir            the descriptor of the property line.
136*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
137*cdf0e10cSrcweir            if the given property is not supported by this handler
138*cdf0e10cSrcweir        @throws com::sun::star::lang::NullPointerException
139*cdf0e10cSrcweir            if <arg>ControlFactory</arg> is <NULL/>.
140*cdf0e10cSrcweir        @see PropertyControlType
141*cdf0e10cSrcweir        @see LineDescriptor
142*cdf0e10cSrcweir    */
143*cdf0e10cSrcweir    LineDescriptor
144*cdf0e10cSrcweir        describePropertyLine(
145*cdf0e10cSrcweir            [in] string PropertyName,
146*cdf0e10cSrcweir            [in] XPropertyControlFactory ControlFactory
147*cdf0e10cSrcweir        )
148*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException);
149*cdf0e10cSrcweir
150*cdf0e10cSrcweir    /** converts a given control-compatible value to a property value
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir        <p>In <member>describePropertyLine</member>, a property handler declared which type of control
153*cdf0e10cSrcweir        should be used to display the value of a certain property. To allow to use the same control
154*cdf0e10cSrcweir        type for different properties, and in particular, for properties of different type,
155*cdf0e10cSrcweir        conversions between controls values and property values are needed.</p>
156*cdf0e10cSrcweir
157*cdf0e10cSrcweir        <p>This method converts a control value into a property value, which subsequently can be used
158*cdf0e10cSrcweir        in conjunction with <member>setPropertyValue</member>.</p>
159*cdf0e10cSrcweir
160*cdf0e10cSrcweir        @param PropertyName
161*cdf0e10cSrcweir            The name of the conversion's target property.
162*cdf0e10cSrcweir        @param ControlValue
163*cdf0e10cSrcweir            The to-be-converted control value. This value has been obtained from an <type>XPropertyControl</type>,
164*cdf0e10cSrcweir            using its <member>Value</member> attribute.
165*cdf0e10cSrcweir
166*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
167*cdf0e10cSrcweir            if the given property is not supported by the property handler
168*cdf0e10cSrcweir
169*cdf0e10cSrcweir        @see convertToControlValue
170*cdf0e10cSrcweir        @see describePropertyLine
171*cdf0e10cSrcweir        @see XPropertyControl
172*cdf0e10cSrcweir        @see getPropertyValue
173*cdf0e10cSrcweir    */
174*cdf0e10cSrcweir    any
175*cdf0e10cSrcweir        convertToPropertyValue(
176*cdf0e10cSrcweir            [in] string PropertyName,
177*cdf0e10cSrcweir            [in] any ControlValue
178*cdf0e10cSrcweir        )
179*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException);
180*cdf0e10cSrcweir
181*cdf0e10cSrcweir    /** converts a given property value to a control-compatible value
182*cdf0e10cSrcweir
183*cdf0e10cSrcweir        <p>In <member>describePropertyLine</member>, a property handler declared which type of control
184*cdf0e10cSrcweir        should be used to display the value of a certain property. To allow to use the same control
185*cdf0e10cSrcweir        type for different properties, and in particular, for properties of different type,
186*cdf0e10cSrcweir        conversions between controls values and property values are needed.</p>
187*cdf0e10cSrcweir
188*cdf0e10cSrcweir        <p>This method converts a property value, which has previously been obtained using
189*cdf0e10cSrcweir        <member>getPropertyValue</member>, into a control-compatible value, which can be used
190*cdf0e10cSrcweir        with <type>XPropertyControl</type>'s <member>XPropertyControl::Value</member> attribute.</p>
191*cdf0e10cSrcweir
192*cdf0e10cSrcweir        <p>A usual application of this method are list boxes: There is a generic list box implementation,
193*cdf0e10cSrcweir        which is able to display a simple list of strings. Usually, every string represents one
194*cdf0e10cSrcweir        possible property value. To translate between those property values and the displayed strings,
195*cdf0e10cSrcweir        <member>convertToControlValue</member> and <member>convertToPropertyValue</member> are used.</p>
196*cdf0e10cSrcweir
197*cdf0e10cSrcweir        <p>The method is not invoked if the control's value type (<member>XPropertyControl::ValueType</member>
198*cdf0e10cSrcweir        equals the property's value type.</p>
199*cdf0e10cSrcweir
200*cdf0e10cSrcweir        @param PropertyName
201*cdf0e10cSrcweir            The name of the property whose value is to be converted.
202*cdf0e10cSrcweir        @param PropertyValue
203*cdf0e10cSrcweir            The to-be-converted property value.
204*cdf0e10cSrcweir        @param ControlValueType
205*cdf0e10cSrcweir            The target type of the conversion. This type is determined by the control which
206*cdf0e10cSrcweir            is used to display the property, which in turn is determined by the handler itself
207*cdf0e10cSrcweir            in <member>describePropertyLine</member>.<br/>
208*cdf0e10cSrcweir            Speaking strictly, this is passed for convenience only, since every <type>XPropertyHandler</type>
209*cdf0e10cSrcweir            implementation should know exactly which type to expect, since it implicitly determined this type
210*cdf0e10cSrcweir            in <member>describePropertyLine</member> by creating an appropriate <type>XPropertyControl</type>.
211*cdf0e10cSrcweir
212*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
213*cdf0e10cSrcweir            if the given property is not supported by the property handler
214*cdf0e10cSrcweir
215*cdf0e10cSrcweir        @see convertToPropertyValue
216*cdf0e10cSrcweir        @see describePropertyLine
217*cdf0e10cSrcweir        @see XPropertyControl
218*cdf0e10cSrcweir        @see getPropertyValue
219*cdf0e10cSrcweir    */
220*cdf0e10cSrcweir    any
221*cdf0e10cSrcweir        convertToControlValue(
222*cdf0e10cSrcweir            [in] string PropertyName,
223*cdf0e10cSrcweir            [in] any PropertyValue,
224*cdf0e10cSrcweir            [in] type ControlValueType
225*cdf0e10cSrcweir        )
226*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException);
227*cdf0e10cSrcweir
228*cdf0e10cSrcweir    /** registers a listener for notification about property value changes
229*cdf0e10cSrcweir
230*cdf0e10cSrcweir        <p>An <type>XPropertyHandler</type> implementation might decide to ignore this call.
231*cdf0e10cSrcweir        However, in this case property value changes made by third party components are not
232*cdf0e10cSrcweir        reflected in the object inspector.</p>
233*cdf0e10cSrcweir
234*cdf0e10cSrcweir        <p>If a handler implementation supports property change listeners, it must be able to cope
235*cdf0e10cSrcweir        with a call to <member>addPropertyChangeListener</member> even if currently no component is
236*cdf0e10cSrcweir        being inspected. In this case, the listener must become active as soon as a new introspectee
237*cdf0e10cSrcweir        is set in the next <member>inspect</member> call.</p>
238*cdf0e10cSrcweir
239*cdf0e10cSrcweir        @param Listener
240*cdf0e10cSrcweir            the listener to notify about property changes
241*cdf0e10cSrcweir        @throws com::sun::star::lang::NullPointerException
242*cdf0e10cSrcweir            if the listener is <NULL/>
243*cdf0e10cSrcweir        @see removePropertyChangeListener
244*cdf0e10cSrcweir    */
245*cdf0e10cSrcweir    void
246*cdf0e10cSrcweir        addPropertyChangeListener( [in] com::sun::star::beans::XPropertyChangeListener Listener )
247*cdf0e10cSrcweir            raises ( com::sun::star::lang::NullPointerException );
248*cdf0e10cSrcweir
249*cdf0e10cSrcweir    /** revokes a listener for notification about property value changes
250*cdf0e10cSrcweir        @see addPropertyChangeListener
251*cdf0e10cSrcweir    */
252*cdf0e10cSrcweir    void
253*cdf0e10cSrcweir        removePropertyChangeListener( [in] com::sun::star::beans::XPropertyChangeListener Listener );
254*cdf0e10cSrcweir
255*cdf0e10cSrcweir    /** returns the properties which the handler can handle
256*cdf0e10cSrcweir
257*cdf0e10cSrcweir        <p>A handler is allowed to return an empty sequence here, indicating that for
258*cdf0e10cSrcweir        the given introspectee, no properties handling can be provided. This might happen
259*cdf0e10cSrcweir        when a fixed set of property handlers is used for a variety of components to inspect,
260*cdf0e10cSrcweir        where not all handlers can really cope with all components.</p>
261*cdf0e10cSrcweir
262*cdf0e10cSrcweir        <p>In the case of returning an empty sequence here, the property handler is ignored
263*cdf0e10cSrcweir        by all further processing in the object inspector.</p>
264*cdf0e10cSrcweir    */
265*cdf0e10cSrcweir    sequence< com::sun::star::beans::Property >
266*cdf0e10cSrcweir        getSupportedProperties();
267*cdf0e10cSrcweir
268*cdf0e10cSrcweir    /** returns the properties which are to be superseded by this handler
269*cdf0e10cSrcweir
270*cdf0e10cSrcweir        <p>Besides defining an own set of properties (see <member>getSupportedProperties</member>),
271*cdf0e10cSrcweir        a property handler can also declare that foreign properties (which it is
272*cdf0e10cSrcweir        <em>not</em> responsible for) are superseded by its own properties.</p>
273*cdf0e10cSrcweir
274*cdf0e10cSrcweir        <p>This is usually used if your handler is used with another, more generic one, which
275*cdf0e10cSrcweir        should continue to be responsible for all properties, except a few which your
276*cdf0e10cSrcweir        handler handles more elegantly.</p>
277*cdf0e10cSrcweir
278*cdf0e10cSrcweir        <p>In such a case, simply return those properties here.</p>
279*cdf0e10cSrcweir
280*cdf0e10cSrcweir        <p>There is a precedence in the property handlers used by an <type>ObjectInspector</type>,
281*cdf0e10cSrcweir        which also is important for the superseded properties. This precendence is implied by the
282*cdf0e10cSrcweir        precendence of factories to create the property handlers, as denoted in the
283*cdf0e10cSrcweir        <member>XObjectInspectorModel::HandlerFactories</member> attribute.</p>
284*cdf0e10cSrcweir
285*cdf0e10cSrcweir        <p>With this in mind, property handlers can only supersede properties which are supported
286*cdf0e10cSrcweir        by a handler preceding them, but not properties of handlers succeeding them.</p>
287*cdf0e10cSrcweir
288*cdf0e10cSrcweir        <p>For instance, imaging an <type>XObjectInspectorModel</type> which provides three
289*cdf0e10cSrcweir        factories, for handler <code>A</code>, <code>B</code>, and <code>C</code> - in this order.
290*cdf0e10cSrcweir        Now if <code>A</code> supports the property <code>Foo</code>, <code>C</code> supports
291*cdf0e10cSrcweir        <code>Bar</code>, and <code>B</code> supersedes both <code>Foo</code> and <code>Bar</code>,
292*cdf0e10cSrcweir        them the result is <code>Bar</code> is still present. This is because <code>B</code> precedes
293*cdf0e10cSrcweir        <code>C</code>, so it cannot, by definition, supersede properties which are supported by
294*cdf0e10cSrcweir        <code>C</code>.</p>
295*cdf0e10cSrcweir
296*cdf0e10cSrcweir        <p>If <member>getSupportedProperties</member> returned an empty sequence, this method will
297*cdf0e10cSrcweir        not be called.</p>
298*cdf0e10cSrcweir
299*cdf0e10cSrcweir        @see XObjectInspectorModel::HandlerFactories
300*cdf0e10cSrcweir    */
301*cdf0e10cSrcweir    sequence< string >
302*cdf0e10cSrcweir        getSupersededProperties( );
303*cdf0e10cSrcweir
304*cdf0e10cSrcweir    /** retrieve the actuating properties which this handler is interested in
305*cdf0e10cSrcweir
306*cdf0e10cSrcweir        <p>In general, properties can be declared as "actuating", that is, when their value
307*cdf0e10cSrcweir        changes, the UI for other properties needs to be updated (e.g. enabled or disabled).</p>
308*cdf0e10cSrcweir
309*cdf0e10cSrcweir        <p>With this method, a handler can declare that it feels responsible for some/all
310*cdf0e10cSrcweir        of the depending properties of certain actuating properties.</p>
311*cdf0e10cSrcweir
312*cdf0e10cSrcweir        <p>Whenever the value of an actuating property changes, all handlers which expressed
313*cdf0e10cSrcweir        their interest in this particular actuating properties are called with their
314*cdf0e10cSrcweir        <member>actuatingPropertyChanged</member> method.</p>
315*cdf0e10cSrcweir
316*cdf0e10cSrcweir        <p>If <member>getSupportedProperties</member> returned an empty sequence, this method will
317*cdf0e10cSrcweir        not be called</p>
318*cdf0e10cSrcweir    */
319*cdf0e10cSrcweir    sequence< string >
320*cdf0e10cSrcweir        getActuatingProperties( );
321*cdf0e10cSrcweir
322*cdf0e10cSrcweir    /** determines whether a given property, which the handler is responsible for, is composable.
323*cdf0e10cSrcweir
324*cdf0e10cSrcweir        <p>An object inspector can inspect multiple components at once, displaying the <em>intersection</em>
325*cdf0e10cSrcweir        of their properties. For this, all components are examined for their properties, and all properties
326*cdf0e10cSrcweir        which exist for all components, <em>and</em> are declared to be composable by their respective handler,
327*cdf0e10cSrcweir        are displayed in the inspector UI.</p>
328*cdf0e10cSrcweir
329*cdf0e10cSrcweir        @param PropertyName
330*cdf0e10cSrcweir            the name of the property whose composability is to be determined
331*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
332*cdf0e10cSrcweir            if the given property is not supported by the property handler
333*cdf0e10cSrcweir    */
334*cdf0e10cSrcweir    boolean isComposable( [in] string PropertyName )
335*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException);
336*cdf0e10cSrcweir
337*cdf0e10cSrcweir    /** called when a browse button belonging to a property UI represenation has been clicked
338*cdf0e10cSrcweir
339*cdf0e10cSrcweir        <p>Property handlers can raise a dedicated UI for entering or somehow changing a property value.
340*cdf0e10cSrcweir        Usually, this will be a modal dialog, but it can also be a non-modal user interface component.</p>
341*cdf0e10cSrcweir
342*cdf0e10cSrcweir        <p>Availability of this feature is indicated by the <member>LineDescriptor::HasPrimaryButton</member>
343*cdf0e10cSrcweir        and <member>LineDescriptor::HasSecondaryButton</member> members of a <type>LineDescriptor</type>,
344*cdf0e10cSrcweir        which the <type>XPropertyHandler</type> fills in its <member>describePropertyLine</member> method.</p>
345*cdf0e10cSrcweir
346*cdf0e10cSrcweir        <p>When this method is called, the property handler should raise the UI needed to enter the
347*cdf0e10cSrcweir        property value, and return the result of this (see <type>InteractiveSelectionResult</type>).</p>
348*cdf0e10cSrcweir
349*cdf0e10cSrcweir        <p>It is recommended that property handlers do not directly set the property value which has
350*cdf0e10cSrcweir        been obatined from the user, but store it in the output-parameter Data, and return
351*cdf0e10cSrcweir        <member>InteractiveSelectionResult::ObtainedValue</member>.</p>
352*cdf0e10cSrcweir
353*cdf0e10cSrcweir        <p>If a handler sets the new property value directly, and returns
354*cdf0e10cSrcweir        <member>InteractiveSelectionResult::ObtainedValue</member>, this implies that the property
355*cdf0e10cSrcweir        cannot properly be handled in case the object inspector is inspecting an intersection of
356*cdf0e10cSrcweir        multiple components, since in this case <member>onInteractivePropertySelection</member>
357*cdf0e10cSrcweir        will be called at one handler only, however the new property would have to be forwarded to
358*cdf0e10cSrcweir        all handlers.</p>
359*cdf0e10cSrcweir
360*cdf0e10cSrcweir        <p>If a property is not composeable, directly setting the new property value does not yield any problem,
361*cdf0e10cSrcweir        as long as property listeners are properly notified of the change.</p>
362*cdf0e10cSrcweir
363*cdf0e10cSrcweir        @param PropertyName
364*cdf0e10cSrcweir            The name of the property whose browse button has been clicked
365*cdf0e10cSrcweir
366*cdf0e10cSrcweir        @param Primary
367*cdf0e10cSrcweir            <TRUE/> if and only if the primary button has been clicked, <FALSE/> otherwise
368*cdf0e10cSrcweir
369*cdf0e10cSrcweir        @param out_Data
370*cdf0e10cSrcweir            If the method returns <member>InteractiveSelectionResult::ObtainedValue</member>,
371*cdf0e10cSrcweir            then <arg>out_Data</arg> contains the value which has been interactively obtained
372*cdf0e10cSrcweir            from the user, and which still needs to be set at the inspected component.
373*cdf0e10cSrcweir
374*cdf0e10cSrcweir        @param InspectorUI
375*cdf0e10cSrcweir            provides access to the object inspector UI. Implementations should use this if
376*cdf0e10cSrcweir            the property selection requires non-modal user input. In those cases,
377*cdf0e10cSrcweir            <member>onInteractivePropertySelection</member> should return <member>InteractiveSelectionResult::Pending</member>,
378*cdf0e10cSrcweir            and the UI for (at least) the property whose input is still pending should be disabled.
379*cdf0e10cSrcweir
380*cdf0e10cSrcweir        @return
381*cdf0e10cSrcweir            the result of the interactive property value selection.
382*cdf0e10cSrcweir
383*cdf0e10cSrcweir        @throws com::sun::star::beans::UnknownPropertyException
384*cdf0e10cSrcweir            if the given property is not supported by the property handler
385*cdf0e10cSrcweir        @throws com::sun::star::lang::NullPointerException
386*cdf0e10cSrcweir            if <arg>InspectorUI</arg> is <NULL/>
387*cdf0e10cSrcweir
388*cdf0e10cSrcweir        @see describePropertyLine
389*cdf0e10cSrcweir        @see addPropertyChangeListener
390*cdf0e10cSrcweir        @see isComposable
391*cdf0e10cSrcweir    */
392*cdf0e10cSrcweir    ::com::sun::star::inspection::InteractiveSelectionResult
393*cdf0e10cSrcweir        onInteractivePropertySelection(
394*cdf0e10cSrcweir            [in] string PropertyName,
395*cdf0e10cSrcweir            [in] boolean Primary,
396*cdf0e10cSrcweir            [out] any out_Data,
397*cdf0e10cSrcweir            [in] XObjectInspectorUI InspectorUI
398*cdf0e10cSrcweir        )
399*cdf0e10cSrcweir        raises (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException);
400*cdf0e10cSrcweir
401*cdf0e10cSrcweir    /** updates the UI of dependent properties when the value of a certain actuating property changed
402*cdf0e10cSrcweir
403*cdf0e10cSrcweir        <p>This method is called whenever a property value changes, limited to those properties
404*cdf0e10cSrcweir        whose changes the handler expressed interest in (see <member>getActuatingProperties</member>).</p>
405*cdf0e10cSrcweir
406*cdf0e10cSrcweir        @param ActuatingPropertyName
407*cdf0e10cSrcweir            the id of the actuating property.
408*cdf0e10cSrcweir        @param NewValue
409*cdf0e10cSrcweir            the new value of the property
410*cdf0e10cSrcweir        @param OldValue
411*cdf0e10cSrcweir            the old value of the property
412*cdf0e10cSrcweir        @param InspectorUI
413*cdf0e10cSrcweir            a callback for updating the object inspector UI
414*cdf0e10cSrcweir        @param FirstTimeInit
415*cdf0e10cSrcweir            If <TRUE/>, the method is called for the first-time update of the respective property, that
416*cdf0e10cSrcweir            is, when the property browser is just initializing with the properties of the introspected
417*cdf0e10cSrcweir            object.<br/>
418*cdf0e10cSrcweir            If <FALSE/>, there was a real <member scope="com::sun::star::beans">XPropertyChangeListener::propertyChange</member>
419*cdf0e10cSrcweir            event which triggered the call.<br/>
420*cdf0e10cSrcweir            <br/>
421*cdf0e10cSrcweir            In some cases it may be necessary to differentiate between both situations. For instance,
422*cdf0e10cSrcweir            if you want to set the value of another property when an actuating property's value changed,
423*cdf0e10cSrcweir            you should definately not do this when <arg>FirstTimeInit</arg> is <TRUE/>.
424*cdf0e10cSrcweir        @throws com::sun::star::lang::NullPointerException
425*cdf0e10cSrcweir            if <arg>InspectorUI</arg> is <NULL/>
426*cdf0e10cSrcweir    */
427*cdf0e10cSrcweir    void
428*cdf0e10cSrcweir        actuatingPropertyChanged(
429*cdf0e10cSrcweir            [in] string ActuatingPropertyName,
430*cdf0e10cSrcweir            [in] any NewValue,
431*cdf0e10cSrcweir            [in] any OldValue,
432*cdf0e10cSrcweir            [in] XObjectInspectorUI InspectorUI,
433*cdf0e10cSrcweir            [in] boolean FirstTimeInit
434*cdf0e10cSrcweir        )
435*cdf0e10cSrcweir        raises (::com::sun::star::lang::NullPointerException);
436*cdf0e10cSrcweir
437*cdf0e10cSrcweir    /** suspends the handler
438*cdf0e10cSrcweir
439*cdf0e10cSrcweir        <p>A <type>XPropertyHandler</type> is used by a <type>XObjectInspector</type> instance,
440*cdf0e10cSrcweir        which implements the XController interface. By definition, a XObjectInspector always forwards
441*cdf0e10cSrcweir        all suspend requests (<member scope="com::sun::star::frame">XController::suspend</member>) to
442*cdf0e10cSrcweir        all it's handlers.</p>
443*cdf0e10cSrcweir
444*cdf0e10cSrcweir        <p>The usual use case for this method are non-modal user interface components used
445*cdf0e10cSrcweir        for property value input. Such a component might have been opened during
446*cdf0e10cSrcweir        <member>onInteractivePropertySelection</member>. If a property handler receives a
447*cdf0e10cSrcweir        <member>suspend</member> call, it should forward the suspension request to the UI
448*cdf0e10cSrcweir        component, and veto suspension of the <type>XObjectInspector</type> as appropriate.</p>
449*cdf0e10cSrcweir
450*cdf0e10cSrcweir        <p>If suspension is not to be vetoed, then all non-modal UI components opened
451*cdf0e10cSrcweir        by the handler should have been closed when it returns from the <member>suspend</member> call.</p>
452*cdf0e10cSrcweir
453*cdf0e10cSrcweir        @param Suspend
454*cdf0e10cSrcweir            Whether the handler is to be suspended <TRUE/> or reactivated (<FALSE/>). The
455*cdf0e10cSrcweir            latter happens if a handler was successfully suspended, but an external instance
456*cdf0e10cSrcweir            vetoed the whole suspension process.
457*cdf0e10cSrcweir
458*cdf0e10cSrcweir        @return
459*cdf0e10cSrcweir            <TRUE/> if the handler does allow suspension, <FALSE/> if it vetoes it.
460*cdf0e10cSrcweir    */
461*cdf0e10cSrcweir    boolean suspend( [in] boolean Suspend );
462*cdf0e10cSrcweir};
463*cdf0e10cSrcweir
464*cdf0e10cSrcweir//=============================================================================
465*cdf0e10cSrcweir
466*cdf0e10cSrcweir}; }; }; };
467*cdf0e10cSrcweir
468*cdf0e10cSrcweir#endif
469*cdf0e10cSrcweir
470*cdf0e10cSrcweir
471*cdf0e10cSrcweir
472