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