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_LineDescriptor_idl__
25cdf0e10cSrcweir#define __com_sun_star_inspection_LineDescriptor_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef com_sun_star_graphic_XGraphic_idl
28cdf0e10cSrcweir#include <com/sun/star/graphic/XGraphic.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir//=============================================================================
32cdf0e10cSrcweirmodule com {  module sun {  module star {  module inspection {
33cdf0e10cSrcweir
34cdf0e10cSrcweirpublished interface XPropertyControl;
35cdf0e10cSrcweir
36cdf0e10cSrcweir//-----------------------------------------------------------------------------
37cdf0e10cSrcweir/** describes the appearance of a line representing a single property in an <type>ObjectInspector</type>.
38cdf0e10cSrcweir
39cdf0e10cSrcweir    Such a line consists of
40cdf0e10cSrcweir    <ul><li>a label with a human-readable name for the property</li>
41cdf0e10cSrcweir        <li>a control which is used for user interaction - i.e. it displays the current property
42cdf0e10cSrcweir            value, and allows the user entering a new one.</li>
43cdf0e10cSrcweir        <li>(optional) one or two buttons which, when clicked, can start a more complex, interactive
44cdf0e10cSrcweir            property value input. For instance, if you have a property whose value is a path in the
45cdf0e10cSrcweir            file system, such a button could be used to let the user browse for a path with a
46cdf0e10cSrcweir            usual file picker.</li>
47cdf0e10cSrcweir    </ul>
48cdf0e10cSrcweir
49cdf0e10cSrcweir    @see XPropertyHandler::describePropertyLine
50cdf0e10cSrcweir    @see PropertyLineElement
51cdf0e10cSrcweir
52*d695a2a0SJürgen Schmidt    @since OpenOffice 2.0.3
53cdf0e10cSrcweir*/
54cdf0e10cSrcweirpublished struct LineDescriptor
55cdf0e10cSrcweir{
56cdf0e10cSrcweir    /** denotes the human-readable display name used to present a property to the user
57cdf0e10cSrcweir    */
58cdf0e10cSrcweir    string  DisplayName;
59cdf0e10cSrcweir
60cdf0e10cSrcweir    /** denotes the control which should be used to represent the property at the UI.
61cdf0e10cSrcweir
62cdf0e10cSrcweir        @see XPropertyControlFactory
63cdf0e10cSrcweir    */
64cdf0e10cSrcweir    XPropertyControl Control;
65cdf0e10cSrcweir
66cdf0e10cSrcweir    /** specifies the URL to the help topic to be associated with the property
67cdf0e10cSrcweir    */
68cdf0e10cSrcweir    string HelpURL;
69cdf0e10cSrcweir
70cdf0e10cSrcweir    /** detetrmines whether a button exists which can be used for a more complex, interactive
71cdf0e10cSrcweir        property value input.
72cdf0e10cSrcweir
73cdf0e10cSrcweir        <p>If no image for the primary button is specified, but a primary button is present,
74cdf0e10cSrcweir        the three dots will be displayed on the button.</p>
75cdf0e10cSrcweir
76cdf0e10cSrcweir        @see XPropertyHandler::onInteractivePropertySelection
77cdf0e10cSrcweir        @see HasSecondaryButton
78cdf0e10cSrcweir        @see PrimaryButtonImageURL
79cdf0e10cSrcweir        @see PrimaryButtonImage
80cdf0e10cSrcweir    */
81cdf0e10cSrcweir    boolean HasPrimaryButton;
82cdf0e10cSrcweir
83cdf0e10cSrcweir    /** describes a unique id to associate with the primary button
84cdf0e10cSrcweir
85cdf0e10cSrcweir        <p>In OpenOffice.org, UI elements sometimes require a so-called UniqueID, which can be
86cdf0e10cSrcweir        used to uniquely (within the whole application) identify this UI element. For instance,
87cdf0e10cSrcweir        automating the OpenOffice.org UI via a dedicated separate application ("TestTool") requires
88cdf0e10cSrcweir        such IDs.</p>
89cdf0e10cSrcweir
90cdf0e10cSrcweir        <p>If a primary button exists for a property's UI representation (<member>HasPrimaryButton</member>),
91cdf0e10cSrcweir        it gets the ID specified herein.</p>
92cdf0e10cSrcweir    */
93cdf0e10cSrcweir    string PrimaryButtonId;
94cdf0e10cSrcweir
95cdf0e10cSrcweir    /** describes the URL of an image to display on the primary button, if any.
96cdf0e10cSrcweir
97cdf0e10cSrcweir        <p>This URL will be used to obtain an actual <type scope="com::sun::star::graphic">XGraphic</type>
98cdf0e10cSrcweir        object from an <type scope="com::sun::star::graphic">GraphicProvider</type>.</p>
99cdf0e10cSrcweir
100cdf0e10cSrcweir        <p>The property will be ignored if <member>HasPrimaryButton</member> is <FALSE/>.</p>
101cdf0e10cSrcweir
102cdf0e10cSrcweir        <p>If you need to specify a graphic which does not have an URL, but is available as
103cdf0e10cSrcweir        <type scope="com::sun::star::graphic">XGraphic</type> only, then you must leave
104cdf0e10cSrcweir        <code>PrimaryButtonImageURL</code> empty, and use the <member>PrimaryButtonImage</member> property.
105cdf0e10cSrcweir
106cdf0e10cSrcweir        @see PrimaryButtonImage
107cdf0e10cSrcweir    */
108cdf0e10cSrcweir    string  PrimaryButtonImageURL;
109cdf0e10cSrcweir
110cdf0e10cSrcweir    /** describes a graphics to display at the primary button, if any.
111cdf0e10cSrcweir
112cdf0e10cSrcweir        <p>The property will be ignored if <member>HasPrimaryButton</member> is <FALSE/>, or
113cdf0e10cSrcweir        if <member>PrimaryButtonImageURL</member> is a non-empty string.</p>
114cdf0e10cSrcweir
115cdf0e10cSrcweir        @see HasPrimaryButton
116cdf0e10cSrcweir        @see PrimaryButtonImageURL
117cdf0e10cSrcweir    */
118cdf0e10cSrcweir    com::sun::star::graphic::XGraphic PrimaryButtonImage;
119cdf0e10cSrcweir
120cdf0e10cSrcweir    /** detetrmines whether a secondary button exists which can be used for a more complex, interactive
121cdf0e10cSrcweir        property value input.
122cdf0e10cSrcweir
123cdf0e10cSrcweir        <p>A secondary button subordinated to the primary button. If no primary button exists
124cdf0e10cSrcweir        (<member>HasPrimaryButton</member>), this member is ignored.</p>
125cdf0e10cSrcweir
126cdf0e10cSrcweir        @see XPropertyHandler::onInteractivePropertySelection
127cdf0e10cSrcweir        @see HasSecondaryButton
128cdf0e10cSrcweir    */
129cdf0e10cSrcweir    boolean HasSecondaryButton;
130cdf0e10cSrcweir
131cdf0e10cSrcweir    /** describes a unique id to associate with the primary button
132cdf0e10cSrcweir
133cdf0e10cSrcweir        <p>If a secondary button exists for a property's UI representation (<member>HasSecondaryButton</member>),
134cdf0e10cSrcweir        it gets the ID specified herein.</p>
135cdf0e10cSrcweir
136cdf0e10cSrcweir        @see PrimaryButtonId
137cdf0e10cSrcweir    */
138cdf0e10cSrcweir    string SecondaryButtonId;
139cdf0e10cSrcweir
140cdf0e10cSrcweir    /** describes the URL of an image to display on the secondary button, if any.
141cdf0e10cSrcweir
142cdf0e10cSrcweir        <p>This URL will be used to obtain an actual <type scope="com::sun::star::graphic">XGraphic</type>
143cdf0e10cSrcweir        object from an <type scope="com::sun::star::graphic">GraphicProvider</type>.</p>
144cdf0e10cSrcweir
145cdf0e10cSrcweir        <p>The property will be ignored if <member>HasSecondaryButton</member> is <FALSE/>.</p>
146cdf0e10cSrcweir
147cdf0e10cSrcweir        <p>If you need to specify a graphic which does not have an URL, but is available as
148cdf0e10cSrcweir        <type scope="com::sun::star::graphic">XGraphic</type> only, then you must leave
149cdf0e10cSrcweir        <code>SecondaryButtonImageURL</code> empty, and use the <member>SecondaryButtonImage</member> property.
150cdf0e10cSrcweir
151cdf0e10cSrcweir        @see SecondaryButtonImage
152cdf0e10cSrcweir    */
153cdf0e10cSrcweir    string  SecondaryButtonImageURL;
154cdf0e10cSrcweir
155cdf0e10cSrcweir    /** describes a graphics to display at the secondary button, if any.
156cdf0e10cSrcweir
157cdf0e10cSrcweir        <p>The property will be ignored if <member>HasSecondaryButton</member> is <FALSE/>, or
158cdf0e10cSrcweir        if <member>SecondaryButtonImageURL</member> is a non-empty string.</p>
159cdf0e10cSrcweir
160cdf0e10cSrcweir        @see HasSecondaryButton
161cdf0e10cSrcweir        @see SecondaryButtonImageURL
162cdf0e10cSrcweir    */
163cdf0e10cSrcweir    com::sun::star::graphic::XGraphic SecondaryButtonImage;
164cdf0e10cSrcweir
165cdf0e10cSrcweir    /** describes the indent level for the property
166cdf0e10cSrcweir
167cdf0e10cSrcweir        <p>If a given property semantically depends on another one, the indent level
168cdf0e10cSrcweir        can be used to visually represent this fact. For this, the dependent property's
169cdf0e10cSrcweir        indent level would be one larger than the indent level of the other property.</p>
170cdf0e10cSrcweir
171cdf0e10cSrcweir        <p>Normally, <type>XPropertyHandler</type>s will set this to <code>0</code> when describing
172cdf0e10cSrcweir        the UI for a normal property.
173cdf0e10cSrcweir    */
174cdf0e10cSrcweir    short IndentLevel;
175cdf0e10cSrcweir
176cdf0e10cSrcweir    /** describes the category into which the property should be sorted by the <type>ObjectInspector</type>.
177cdf0e10cSrcweir
178cdf0e10cSrcweir        <p>An <type>ObjectInspector</type> can visually group properties which semantically belong
179cdf0e10cSrcweir        together (for instance using tab pages). The decision which properties actually belong together
180cdf0e10cSrcweir        is made using this <member>Category</member> attribute.</p>
181cdf0e10cSrcweir
182cdf0e10cSrcweir        <p>For your implementation of <type>XPropertyHandler</type>, it's recommended that you document the programmatic
183cdf0e10cSrcweir        names used for property categories. This way, your handler might be re-used in
184cdf0e10cSrcweir        different contexts, where only the <type>XObjectInspectorModel</type> needs to provide consistent
185cdf0e10cSrcweir        UI names for the categories.</p>
186cdf0e10cSrcweir
187cdf0e10cSrcweir        @see XObjectInspectorModel::describeCategories
188cdf0e10cSrcweir    */
189cdf0e10cSrcweir    string Category;
190cdf0e10cSrcweir};
191cdf0e10cSrcweir
192cdf0e10cSrcweir//=============================================================================
193cdf0e10cSrcweir
194cdf0e10cSrcweir}; }; }; };
195cdf0e10cSrcweir
196cdf0e10cSrcweir#endif
197cdf0e10cSrcweir
198