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_XObjectInspectorUI_idl__
28*cdf0e10cSrcweir#define __com_sun_star_inspection_XObjectInspectorUI_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_inspection_XPropertyControl_idl__
31*cdf0e10cSrcweir#include <com/sun/star/inspection/XPropertyControl.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir#ifndef __com_sun_star_beans_Optional_idl__
34*cdf0e10cSrcweir#include <com/sun/star/beans/Optional.idl>
35*cdf0e10cSrcweir#endif
36*cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__
37*cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl>
38*cdf0e10cSrcweir#endif
39*cdf0e10cSrcweir#ifndef __com_sun_star_lang_NoSupportException_idl__
40*cdf0e10cSrcweir#include <com/sun/star/lang/NoSupportException.idl>
41*cdf0e10cSrcweir#endif
42*cdf0e10cSrcweir
43*cdf0e10cSrcweir//=============================================================================
44*cdf0e10cSrcweirmodule com {  module sun {  module star {  module inspection {
45*cdf0e10cSrcweir
46*cdf0e10cSrcweirpublished interface XPropertyControlObserver;
47*cdf0e10cSrcweir
48*cdf0e10cSrcweir//-----------------------------------------------------------------------------
49*cdf0e10cSrcweir/** grants access to certain aspects of the user interface of an object
50*cdf0e10cSrcweir    inspector
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir    <p>This interface is used as callback for <type>XPropertyHandler</type>s.</p>
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir    <p>As a consequence, methods operating on the UI for a property, and taking the name of this property,
55*cdf0e10cSrcweir    are tolerant against properties which do not exist. For instance, if a property handler tries to
56*cdf0e10cSrcweir    disable the UI for property <code>Foo</code>, but another handler has superseded this property, then
57*cdf0e10cSrcweir    the <type>ObjectInspector</type> will not <em>have</em> any UI for it. In this case, the call to
58*cdf0e10cSrcweir    <code>enablePropertyUI( "Foo" )</code> will simply be ignored.</p>
59*cdf0e10cSrcweir
60*cdf0e10cSrcweir    @since OOo 2.0.3
61*cdf0e10cSrcweir*/
62*cdf0e10cSrcweirpublished interface XObjectInspectorUI
63*cdf0e10cSrcweir{
64*cdf0e10cSrcweir    /** enables or disables all components belonging to the UI representation of a property
65*cdf0e10cSrcweir
66*cdf0e10cSrcweir        <p>This is usually used by an <type>XPropertyHandler</type> if it handles properties,
67*cdf0e10cSrcweir        where one does only make sense if another one has a certain value.</p>
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir        @param  PropertyName
70*cdf0e10cSrcweir            denotes the name of the property whose UI is to be enabled or disabled.
71*cdf0e10cSrcweir        @param  Enable
72*cdf0e10cSrcweir            <TRUE/> if and only if the UI should be disabled, <FALSE/> otherwise.
73*cdf0e10cSrcweir    */
74*cdf0e10cSrcweir    void    enablePropertyUI( [in] string PropertyName, [in] boolean Enable );
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir    /** enables or disables the single elements which can be part of the UI representation of a property
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir        <p>Note that the complete UI for the property must be enabled in order for these settings to
79*cdf0e10cSrcweir        be evaluated. That is, <member>enablePropertyUIElements</member> does not have any effect if
80*cdf0e10cSrcweir        somebody previously disabled the complete UI for this property with <member>enablePropertyUI</member>.</p>
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir        @param  PropertyName
83*cdf0e10cSrcweir            the name of the property whose user interface elements are to be enabled or disabled
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir        @param  Elements
86*cdf0e10cSrcweir            a combination of <type>PropertyLineElement</type> flags specifying which elements are to be
87*cdf0e10cSrcweir            enabled or disabled.<br/>
88*cdf0e10cSrcweir            Note that if you don't set a particular bit here (say, <member>PropertyLineElement::PrimaryButton</member>),
89*cdf0e10cSrcweir            this does mean that this element's state is not affected by the call - it does
90*cdf0e10cSrcweir            <em>not</em> mean that it is disabled.
91*cdf0e10cSrcweir        @param  Enable
92*cdf0e10cSrcweir            <TRUE/> if the elements denoted by <arg>_nElements</arg> should be enabled, <FALSE/> if
93*cdf0e10cSrcweir            they should be disabled.
94*cdf0e10cSrcweir    */
95*cdf0e10cSrcweir    void    enablePropertyUIElements(
96*cdf0e10cSrcweir                        [in] string PropertyName,
97*cdf0e10cSrcweir                        [in] short Elements,
98*cdf0e10cSrcweir                        [in] boolean Enable
99*cdf0e10cSrcweir                    );
100*cdf0e10cSrcweir
101*cdf0e10cSrcweir    /** completely rebuilds the UI for the given property.
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir        <p>This method might be used by an <type>XPropertyHandler</type> if it wants to change the type
104*cdf0e10cSrcweir        of control (see <type>PropertyControlType</type>) used to display a certain property.</p>
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir        <p>The object inspector will then call describePropertyLine again, and update its UI accordingly.</p>
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir        <p>Note that the property whose UI should be rebuilt must not necessarily be (though usually <em>is</em>)
109*cdf0e10cSrcweir        in the responsibility of the handler which calls this method. The object inspector will look up the
110*cdf0e10cSrcweir        handler with the responsibility for <arg>PropertyName</arg> and call its
111*cdf0e10cSrcweir        <member>XPropertyHandler::describePropertyLine</member></p>
112*cdf0e10cSrcweir
113*cdf0e10cSrcweir        @param PropertyName
114*cdf0e10cSrcweir            the name of the property whose UI is to be completely rebuilt.
115*cdf0e10cSrcweir    */
116*cdf0e10cSrcweir    void    rebuildPropertyUI( [in] string PropertyName );
117*cdf0e10cSrcweir
118*cdf0e10cSrcweir    /** shows the UI for a given property
119*cdf0e10cSrcweir
120*cdf0e10cSrcweir        @param  PropertyName
121*cdf0e10cSrcweir            the name of the property whose UI is to be shown
122*cdf0e10cSrcweir    */
123*cdf0e10cSrcweir    void    showPropertyUI( [in] string PropertyName );
124*cdf0e10cSrcweir
125*cdf0e10cSrcweir    /** hides the UI for a given property
126*cdf0e10cSrcweir
127*cdf0e10cSrcweir        @param  PropertyName
128*cdf0e10cSrcweir            the name of the property whose UI is to be hidden
129*cdf0e10cSrcweir    */
130*cdf0e10cSrcweir    void    hidePropertyUI( [in] string PropertyName );
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir    /** shows or hides all properties belonging to a given category
133*cdf0e10cSrcweir        @see LineDescriptor::Category
134*cdf0e10cSrcweir        @see XObjectInspectorModel::describeCategories
135*cdf0e10cSrcweir    */
136*cdf0e10cSrcweir    void    showCategory( [in] string Category, [in] boolean Show );
137*cdf0e10cSrcweir
138*cdf0e10cSrcweir    /** retrieves the control currently used to display a given property
139*cdf0e10cSrcweir
140*cdf0e10cSrcweir        @param PropertyName
141*cdf0e10cSrcweir            the name of the property whose control should be retrieved
142*cdf0e10cSrcweir
143*cdf0e10cSrcweir        @return
144*cdf0e10cSrcweir            the <type>XPropertyControl</type> representing the given property, or <NULL/>
145*cdf0e10cSrcweir            if there is no such property control.
146*cdf0e10cSrcweir    */
147*cdf0e10cSrcweir    XPropertyControl
148*cdf0e10cSrcweir            getPropertyControl( [in] string PropertyName );
149*cdf0e10cSrcweir
150*cdf0e10cSrcweir    /** registers an observer for all property controls
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir        <p>The given XPropertyControlObserver will be notified of all changes
153*cdf0e10cSrcweir        in all property controls.</p>
154*cdf0e10cSrcweir
155*cdf0e10cSrcweir        @see revokeControlObserver
156*cdf0e10cSrcweir
157*cdf0e10cSrcweir        @since OOo 2.2
158*cdf0e10cSrcweir    */
159*cdf0e10cSrcweir    void    registerControlObserver( [in] XPropertyControlObserver Observer );
160*cdf0e10cSrcweir
161*cdf0e10cSrcweir    /** revokes a previously registered control observer
162*cdf0e10cSrcweir
163*cdf0e10cSrcweir        @see registerControlObserver
164*cdf0e10cSrcweir
165*cdf0e10cSrcweir        @since OOo 2.2
166*cdf0e10cSrcweir    */
167*cdf0e10cSrcweir    void    revokeControlObserver( [in] XPropertyControlObserver Observer );
168*cdf0e10cSrcweir
169*cdf0e10cSrcweir    /** sets the text of the help section, if the object inspector contains
170*cdf0e10cSrcweir        one.
171*cdf0e10cSrcweir
172*cdf0e10cSrcweir        @throws NoSupportException
173*cdf0e10cSrcweir            if the <member>XObjectInspectorModel::HasHelpSection</member> property
174*cdf0e10cSrcweir            requires the help section to be unavailable.
175*cdf0e10cSrcweir
176*cdf0e10cSrcweir        @since OOo 2.2
177*cdf0e10cSrcweir    */
178*cdf0e10cSrcweir    void setHelpSectionText( [in] string HelpText )
179*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::NoSupportException );
180*cdf0e10cSrcweir};
181*cdf0e10cSrcweir
182*cdf0e10cSrcweir//=============================================================================
183*cdf0e10cSrcweir
184*cdf0e10cSrcweir}; }; }; };
185*cdf0e10cSrcweir
186*cdf0e10cSrcweir#endif
187*cdf0e10cSrcweir
188