1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_inspection_XObjectInspectorUI_idl__
24*b1cdbd2cSJim Jagielski#define __com_sun_star_inspection_XObjectInspectorUI_idl__
25*b1cdbd2cSJim Jagielski
26*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_inspection_XPropertyControl_idl__
27*b1cdbd2cSJim Jagielski#include <com/sun/star/inspection/XPropertyControl.idl>
28*b1cdbd2cSJim Jagielski#endif
29*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_beans_Optional_idl__
30*b1cdbd2cSJim Jagielski#include <com/sun/star/beans/Optional.idl>
31*b1cdbd2cSJim Jagielski#endif
32*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_container_NoSuchElementException_idl__
33*b1cdbd2cSJim Jagielski#include <com/sun/star/container/NoSuchElementException.idl>
34*b1cdbd2cSJim Jagielski#endif
35*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_lang_NoSupportException_idl__
36*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/NoSupportException.idl>
37*b1cdbd2cSJim Jagielski#endif
38*b1cdbd2cSJim Jagielski
39*b1cdbd2cSJim Jagielski//=============================================================================
40*b1cdbd2cSJim Jagielskimodule com {  module sun {  module star {  module inspection {
41*b1cdbd2cSJim Jagielski
42*b1cdbd2cSJim Jagielskipublished interface XPropertyControlObserver;
43*b1cdbd2cSJim Jagielski
44*b1cdbd2cSJim Jagielski//-----------------------------------------------------------------------------
45*b1cdbd2cSJim Jagielski/** grants access to certain aspects of the user interface of an object
46*b1cdbd2cSJim Jagielski    inspector
47*b1cdbd2cSJim Jagielski
48*b1cdbd2cSJim Jagielski    <p>This interface is used as callback for <type>XPropertyHandler</type>s.</p>
49*b1cdbd2cSJim Jagielski
50*b1cdbd2cSJim Jagielski    <p>As a consequence, methods operating on the UI for a property, and taking the name of this property,
51*b1cdbd2cSJim Jagielski    are tolerant against properties which do not exist. For instance, if a property handler tries to
52*b1cdbd2cSJim Jagielski    disable the UI for property <code>Foo</code>, but another handler has superseded this property, then
53*b1cdbd2cSJim Jagielski    the <type>ObjectInspector</type> will not <em>have</em> any UI for it. In this case, the call to
54*b1cdbd2cSJim Jagielski    <code>enablePropertyUI( "Foo" )</code> will simply be ignored.</p>
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielski    @since OpenOffice 2.0.3
57*b1cdbd2cSJim Jagielski*/
58*b1cdbd2cSJim Jagielskipublished interface XObjectInspectorUI
59*b1cdbd2cSJim Jagielski{
60*b1cdbd2cSJim Jagielski    /** enables or disables all components belonging to the UI representation of a property
61*b1cdbd2cSJim Jagielski
62*b1cdbd2cSJim Jagielski        <p>This is usually used by an <type>XPropertyHandler</type> if it handles properties,
63*b1cdbd2cSJim Jagielski        where one does only make sense if another one has a certain value.</p>
64*b1cdbd2cSJim Jagielski
65*b1cdbd2cSJim Jagielski        @param  PropertyName
66*b1cdbd2cSJim Jagielski            denotes the name of the property whose UI is to be enabled or disabled.
67*b1cdbd2cSJim Jagielski        @param  Enable
68*b1cdbd2cSJim Jagielski            <TRUE/> if and only if the UI should be disabled, <FALSE/> otherwise.
69*b1cdbd2cSJim Jagielski    */
70*b1cdbd2cSJim Jagielski    void    enablePropertyUI( [in] string PropertyName, [in] boolean Enable );
71*b1cdbd2cSJim Jagielski
72*b1cdbd2cSJim Jagielski    /** enables or disables the single elements which can be part of the UI representation of a property
73*b1cdbd2cSJim Jagielski
74*b1cdbd2cSJim Jagielski        <p>Note that the complete UI for the property must be enabled in order for these settings to
75*b1cdbd2cSJim Jagielski        be evaluated. That is, <member>enablePropertyUIElements</member> does not have any effect if
76*b1cdbd2cSJim Jagielski        somebody previously disabled the complete UI for this property with <member>enablePropertyUI</member>.</p>
77*b1cdbd2cSJim Jagielski
78*b1cdbd2cSJim Jagielski        @param  PropertyName
79*b1cdbd2cSJim Jagielski            the name of the property whose user interface elements are to be enabled or disabled
80*b1cdbd2cSJim Jagielski
81*b1cdbd2cSJim Jagielski        @param  Elements
82*b1cdbd2cSJim Jagielski            a combination of <type>PropertyLineElement</type> flags specifying which elements are to be
83*b1cdbd2cSJim Jagielski            enabled or disabled.<br/>
84*b1cdbd2cSJim Jagielski            Note that if you don't set a particular bit here (say, <member>PropertyLineElement::PrimaryButton</member>),
85*b1cdbd2cSJim Jagielski            this does mean that this element's state is not affected by the call - it does
86*b1cdbd2cSJim Jagielski            <em>not</em> mean that it is disabled.
87*b1cdbd2cSJim Jagielski        @param  Enable
88*b1cdbd2cSJim Jagielski            <TRUE/> if the elements denoted by <arg>_nElements</arg> should be enabled, <FALSE/> if
89*b1cdbd2cSJim Jagielski            they should be disabled.
90*b1cdbd2cSJim Jagielski    */
91*b1cdbd2cSJim Jagielski    void    enablePropertyUIElements(
92*b1cdbd2cSJim Jagielski                        [in] string PropertyName,
93*b1cdbd2cSJim Jagielski                        [in] short Elements,
94*b1cdbd2cSJim Jagielski                        [in] boolean Enable
95*b1cdbd2cSJim Jagielski                    );
96*b1cdbd2cSJim Jagielski
97*b1cdbd2cSJim Jagielski    /** completely rebuilds the UI for the given property.
98*b1cdbd2cSJim Jagielski
99*b1cdbd2cSJim Jagielski        <p>This method might be used by an <type>XPropertyHandler</type> if it wants to change the type
100*b1cdbd2cSJim Jagielski        of control (see <type>PropertyControlType</type>) used to display a certain property.</p>
101*b1cdbd2cSJim Jagielski
102*b1cdbd2cSJim Jagielski        <p>The object inspector will then call describePropertyLine again, and update its UI accordingly.</p>
103*b1cdbd2cSJim Jagielski
104*b1cdbd2cSJim Jagielski        <p>Note that the property whose UI should be rebuilt must not necessarily be (though usually <em>is</em>)
105*b1cdbd2cSJim Jagielski        in the responsibility of the handler which calls this method. The object inspector will look up the
106*b1cdbd2cSJim Jagielski        handler with the responsibility for <arg>PropertyName</arg> and call its
107*b1cdbd2cSJim Jagielski        <member>XPropertyHandler::describePropertyLine</member></p>
108*b1cdbd2cSJim Jagielski
109*b1cdbd2cSJim Jagielski        @param PropertyName
110*b1cdbd2cSJim Jagielski            the name of the property whose UI is to be completely rebuilt.
111*b1cdbd2cSJim Jagielski    */
112*b1cdbd2cSJim Jagielski    void    rebuildPropertyUI( [in] string PropertyName );
113*b1cdbd2cSJim Jagielski
114*b1cdbd2cSJim Jagielski    /** shows the UI for a given property
115*b1cdbd2cSJim Jagielski
116*b1cdbd2cSJim Jagielski        @param  PropertyName
117*b1cdbd2cSJim Jagielski            the name of the property whose UI is to be shown
118*b1cdbd2cSJim Jagielski    */
119*b1cdbd2cSJim Jagielski    void    showPropertyUI( [in] string PropertyName );
120*b1cdbd2cSJim Jagielski
121*b1cdbd2cSJim Jagielski    /** hides the UI for a given property
122*b1cdbd2cSJim Jagielski
123*b1cdbd2cSJim Jagielski        @param  PropertyName
124*b1cdbd2cSJim Jagielski            the name of the property whose UI is to be hidden
125*b1cdbd2cSJim Jagielski    */
126*b1cdbd2cSJim Jagielski    void    hidePropertyUI( [in] string PropertyName );
127*b1cdbd2cSJim Jagielski
128*b1cdbd2cSJim Jagielski    /** shows or hides all properties belonging to a given category
129*b1cdbd2cSJim Jagielski        @see LineDescriptor::Category
130*b1cdbd2cSJim Jagielski        @see XObjectInspectorModel::describeCategories
131*b1cdbd2cSJim Jagielski    */
132*b1cdbd2cSJim Jagielski    void    showCategory( [in] string Category, [in] boolean Show );
133*b1cdbd2cSJim Jagielski
134*b1cdbd2cSJim Jagielski    /** retrieves the control currently used to display a given property
135*b1cdbd2cSJim Jagielski
136*b1cdbd2cSJim Jagielski        @param PropertyName
137*b1cdbd2cSJim Jagielski            the name of the property whose control should be retrieved
138*b1cdbd2cSJim Jagielski
139*b1cdbd2cSJim Jagielski        @return
140*b1cdbd2cSJim Jagielski            the <type>XPropertyControl</type> representing the given property, or <NULL/>
141*b1cdbd2cSJim Jagielski            if there is no such property control.
142*b1cdbd2cSJim Jagielski    */
143*b1cdbd2cSJim Jagielski    XPropertyControl
144*b1cdbd2cSJim Jagielski            getPropertyControl( [in] string PropertyName );
145*b1cdbd2cSJim Jagielski
146*b1cdbd2cSJim Jagielski    /** registers an observer for all property controls
147*b1cdbd2cSJim Jagielski
148*b1cdbd2cSJim Jagielski        <p>The given XPropertyControlObserver will be notified of all changes
149*b1cdbd2cSJim Jagielski        in all property controls.</p>
150*b1cdbd2cSJim Jagielski
151*b1cdbd2cSJim Jagielski        @see revokeControlObserver
152*b1cdbd2cSJim Jagielski
153*b1cdbd2cSJim Jagielski        @since OpenOffice 2.2
154*b1cdbd2cSJim Jagielski    */
155*b1cdbd2cSJim Jagielski    void    registerControlObserver( [in] XPropertyControlObserver Observer );
156*b1cdbd2cSJim Jagielski
157*b1cdbd2cSJim Jagielski    /** revokes a previously registered control observer
158*b1cdbd2cSJim Jagielski
159*b1cdbd2cSJim Jagielski        @see registerControlObserver
160*b1cdbd2cSJim Jagielski
161*b1cdbd2cSJim Jagielski        @since OpenOffice 2.2
162*b1cdbd2cSJim Jagielski    */
163*b1cdbd2cSJim Jagielski    void    revokeControlObserver( [in] XPropertyControlObserver Observer );
164*b1cdbd2cSJim Jagielski
165*b1cdbd2cSJim Jagielski    /** sets the text of the help section, if the object inspector contains
166*b1cdbd2cSJim Jagielski        one.
167*b1cdbd2cSJim Jagielski
168*b1cdbd2cSJim Jagielski        @throws NoSupportException
169*b1cdbd2cSJim Jagielski            if the <member>XObjectInspectorModel::HasHelpSection</member> property
170*b1cdbd2cSJim Jagielski            requires the help section to be unavailable.
171*b1cdbd2cSJim Jagielski
172*b1cdbd2cSJim Jagielski        @since OpenOffice 2.2
173*b1cdbd2cSJim Jagielski    */
174*b1cdbd2cSJim Jagielski    void setHelpSectionText( [in] string HelpText )
175*b1cdbd2cSJim Jagielski        raises ( ::com::sun::star::lang::NoSupportException );
176*b1cdbd2cSJim Jagielski};
177*b1cdbd2cSJim Jagielski
178*b1cdbd2cSJim Jagielski//=============================================================================
179*b1cdbd2cSJim Jagielski
180*b1cdbd2cSJim Jagielski}; }; }; };
181*b1cdbd2cSJim Jagielski
182*b1cdbd2cSJim Jagielski#endif
183*b1cdbd2cSJim Jagielski
184