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