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