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