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
24cdf0e10cSrcweir#ifndef __com_sun_star_inspection_XObjectInspectorModel_idl__
25cdf0e10cSrcweir#define __com_sun_star_inspection_XObjectInspectorModel_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
28cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir#ifndef __com_sun_star_inspection_PropertyCategoryDescriptor_idl__
31cdf0e10cSrcweir#include <com/sun/star/inspection/PropertyCategoryDescriptor.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir//=============================================================================
35cdf0e10cSrcweirmodule com {  module sun {  module star {  module inspection {
36cdf0e10cSrcweir
37cdf0e10cSrcweirinterface XPropertyHandler;
38cdf0e10cSrcweir
39cdf0e10cSrcweir//-----------------------------------------------------------------------------
40cdf0e10cSrcweir/** describes the model of an <type>ObjectInspector</type>
41cdf0e10cSrcweir
42cdf0e10cSrcweir    @see ObjectInspector
43cdf0e10cSrcweir
44d695a2a0SJürgen Schmidt    @since OpenOffice 2.0.3
45cdf0e10cSrcweir*/
46cdf0e10cSrcweirpublished interface XObjectInspectorModel
47cdf0e10cSrcweir{
48cdf0e10cSrcweir    /** describes a set of factories for creating <type>XPropertyHandler</type>s
49cdf0e10cSrcweir
50cdf0e10cSrcweir        <p>Every element of the sequence must contain information to create a
51cdf0e10cSrcweir        <type>XPropertyHandler</type> instance. Two ways are currently supported:
52cdf0e10cSrcweir        <ul>
53*a893be29SPedro Giffuni            <li>A service name:</br>
54cdf0e10cSrcweir                If a sequence element contains a string, this string is interpreted
55cdf0e10cSrcweir                as service name, and an <type scope="com::sun::star::lang">XMultiComponentFactory</type>
56cdf0e10cSrcweir                is asked to create an instance of this service.</li>
57cdf0e10cSrcweir            <li>A factory:<br/>
58cdf0e10cSrcweir                If a sequence element contains an instance implementing the
59cdf0e10cSrcweir                <type scope="com::sun::star::lang">XSingleComponentFactory</type> interface, this factory
60cdf0e10cSrcweir                is used to create a property handler.</li>
61cdf0e10cSrcweir        </ul></p>
62cdf0e10cSrcweir
63cdf0e10cSrcweir        <p>This attribute is usually only evaluated by the <type>ObjectInspector</type> instance
64cdf0e10cSrcweir        which the model is currently bound to.</p>
65cdf0e10cSrcweir
66cdf0e10cSrcweir        <p>The order of factories is important: If two property handlers declare themself responsible
67cdf0e10cSrcweir        for the same property, the one whose factory is listed <strong>last</strong> wins. Also,
68cdf0e10cSrcweir        if a handler <code>B</code> wants to supersede a property of another handler <code>A</code>,
69cdf0e10cSrcweir        <code>A</code>'s factory must precede the factory of <code>B</code>.</p>
70cdf0e10cSrcweir
71cdf0e10cSrcweir        @see XPropertyHandler::getSupportedProperties
72cdf0e10cSrcweir        @see XPropertyHandler::getSupersededProperties
73cdf0e10cSrcweir    */
74cdf0e10cSrcweir    [attribute, readonly] sequence< any > HandlerFactories;
75cdf0e10cSrcweir
76cdf0e10cSrcweir    /** describes the property categories used by the property handlers.
77cdf0e10cSrcweir
78cdf0e10cSrcweir        <p>Properties can be sorted into different categories, described by the <member>LineDescriptor::Category</member>
79cdf0e10cSrcweir        attribute, which is filled in <member>XPropertyHandler::describePropertyLine</member>
80cdf0e10cSrcweir        method of your property handler.<br/>
81cdf0e10cSrcweir        Those names provided by the handlers are programmatic names. All other information
82cdf0e10cSrcweir        about categories is part of the <type>PropertyCategoryDescriptor</type>, and
83cdf0e10cSrcweir        <member>describeCategories</member> assembles information about all categories which
84cdf0e10cSrcweir        all property handlers provided by the model use.</p>
85cdf0e10cSrcweir
86cdf0e10cSrcweir        @return
87cdf0e10cSrcweir            a sequence of category descriptors. Their relative ordering also describes
88cdf0e10cSrcweir            the relative ordering of the categories in the <type>ObjectInspector</type>'s
89cdf0e10cSrcweir            user interface.<br/>
90cdf0e10cSrcweir            The sequence must not contain two entries with the same programmatic name.<br/>
91cdf0e10cSrcweir            <br/>
92cdf0e10cSrcweir            The model implementation might return an empty sequence here, in this case, the ObjectInspector
93cdf0e10cSrcweir            automatically builds its category information from the categories provided by the
94cdf0e10cSrcweir            property handlers.
95cdf0e10cSrcweir        @see PropertyCategoryDescriptor
96cdf0e10cSrcweir        @see LineDescriptor::Category
97cdf0e10cSrcweir    */
98cdf0e10cSrcweir    sequence< PropertyCategoryDescriptor > describeCategories();
99cdf0e10cSrcweir
100cdf0e10cSrcweir    /** retrieves an index in a global property ordering, for a given property name
101cdf0e10cSrcweir
102cdf0e10cSrcweir        <p>In the user interface of an ObjectInspector, single properties are represented by
103cdf0e10cSrcweir        single lines, and those lines are displayed successively. To determine an order of
104cdf0e10cSrcweir        the property lines, the inspector model can associate an "order index" with each property.
105cdf0e10cSrcweir        The <type>ObjectInspector</type> will then sort the property lines in a way that they
106cdf0e10cSrcweir        have the same relative ordering as the "order indexes" of their properties.</p>
107cdf0e10cSrcweir
108cdf0e10cSrcweir        <p>Note that the concrete value the model returns for a given property does not
109cdf0e10cSrcweir        matter. All what matters is that if you want a certain property <code>Foo</code>
110cdf0e10cSrcweir        to be displayed after another property <code>Bar</code>, then the order index
111cdf0e10cSrcweir        of <code>Foo</code> should be greater than the order index of <code>Bar</code>.
112cdf0e10cSrcweir
113cdf0e10cSrcweir        <p>If for two different properties the same order index is returned, the
114cdf0e10cSrcweir        <type>ObjectInspector</type> will assume the order in which those properties
115cdf0e10cSrcweir        were provided by the respective property handler
116cdf0e10cSrcweir        (<member>XPropertyHandler::getSupportedProperties</member>).<br/>
117cdf0e10cSrcweir        If two such properties originate from different handlers, they will be ordered according
118cdf0e10cSrcweir        to the order of the handlers, as provided in the <member>HandlerFactories</member> attribute.</p>
119cdf0e10cSrcweir
120cdf0e10cSrcweir        @param PropertyName
121cdf0e10cSrcweir            the property whose global order index should be retrieved
122cdf0e10cSrcweir        @return
123cdf0e10cSrcweir            the global order index of <arg>PropertyName</arg>.
124cdf0e10cSrcweir    */
125cdf0e10cSrcweir    long    getPropertyOrderIndex( [in] string PropertyName );
126cdf0e10cSrcweir
127cdf0e10cSrcweir    /** indicates that the object inspector should have a help section.
128cdf0e10cSrcweir
129cdf0e10cSrcweir        <p>The object inspector displays lines of property/values, optionally grouped
130cdf0e10cSrcweir        into categories, as described by the property handlers.<br/>
131cdf0e10cSrcweir        Additionally, the inspector can optionally display a section dedicated to help
132cdf0e10cSrcweir        texts. Clients could use this section to display context-sensitive help, for
133cdf0e10cSrcweir        instance short texts explaining the currently selected property.</p>
134cdf0e10cSrcweir
135d695a2a0SJürgen Schmidt        @since OpenOffice 2.2
136cdf0e10cSrcweir    */
137cdf0e10cSrcweir    [attribute, readonly] boolean HasHelpSection;
138cdf0e10cSrcweir
139cdf0e10cSrcweir    /** denotes the minimum number of lines of text to be reserved for the help
140cdf0e10cSrcweir        section.
141cdf0e10cSrcweir
142cdf0e10cSrcweir        <p>This property is ignored by the <type>ObjectInspector</type> if
143cdf0e10cSrcweir        <member>HasHelpSection</member> is <FALSE/>.</p>
144cdf0e10cSrcweir
145cdf0e10cSrcweir        <p>The layout of the <type>ObjectInspector</type> is undefined if
146cdf0e10cSrcweir        <member>MinHelpTextLines</member> is larger than
147cdf0e10cSrcweir        <member>MaxHelpTextLines</member>.</p>
148cdf0e10cSrcweir
149d695a2a0SJürgen Schmidt        @since OpenOffice 2.2
150cdf0e10cSrcweir    */
151cdf0e10cSrcweir    [attribute, readonly] long MinHelpTextLines;
152cdf0e10cSrcweir
153cdf0e10cSrcweir    /** denotes the maximum number of lines of text to be reserved for the help
154cdf0e10cSrcweir        section.
155cdf0e10cSrcweir
156cdf0e10cSrcweir        <p>This property is ignored by the <type>ObjectInspector</type> if
157cdf0e10cSrcweir        <member>HasHelpSection</member> is <FALSE/>.</p>
158cdf0e10cSrcweir
159cdf0e10cSrcweir        <p>The layout of the <type>ObjectInspector</type> is undefined if
160cdf0e10cSrcweir        <member>MaxHelpTextLines</member> is smaller than
161cdf0e10cSrcweir        <member>MinHelpTextLines</member>.</p>
162cdf0e10cSrcweir
163d695a2a0SJürgen Schmidt        @since OpenOffice 2.2
164cdf0e10cSrcweir    */
165cdf0e10cSrcweir    [attribute, readonly] long MaxHelpTextLines;
166cdf0e10cSrcweir
167cdf0e10cSrcweir    /** determines whether the object inspector's UI should be read-only.
168cdf0e10cSrcweir
169cdf0e10cSrcweir        <p>In this case, the user is able to browse through all properties, but cannot
170cdf0e10cSrcweir        change any of them.</p>
171cdf0e10cSrcweir
172cdf0e10cSrcweir        <p>In a read-only object inspector, the property controls are readonly or
173cdf0e10cSrcweir        disabled themself, and the primary and secondary buttons of a property line
174cdf0e10cSrcweir        are both disabled.</p>
175cdf0e10cSrcweir
176cdf0e10cSrcweir        @see XPropertyControl
177cdf0e10cSrcweir        @see LineDescriptor
178cdf0e10cSrcweir    */
179cdf0e10cSrcweir    [attribute, bound] boolean IsReadOnly;
180cdf0e10cSrcweir};
181cdf0e10cSrcweir
182cdf0e10cSrcweir//=============================================================================
183cdf0e10cSrcweir
184cdf0e10cSrcweir}; }; }; };
185cdf0e10cSrcweir
186cdf0e10cSrcweir#endif
187cdf0e10cSrcweir
188cdf0e10cSrcweir
189