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_frame_XUIElementFactoryRegistration_idl__ 25*b1cdbd2cSJim Jagielski#define __com_sun_star_frame_XUIElementFactoryRegistration_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 31*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_ui_XUIElementFactory_idl__ 32*b1cdbd2cSJim Jagielski#include <com/sun/star/ui/XUIElementFactory.idl> 33*b1cdbd2cSJim Jagielski#endif 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_container_ElementExistException_idl__ 36*b1cdbd2cSJim Jagielski#include <com/sun/star/container/ElementExistException.idl> 37*b1cdbd2cSJim Jagielski#endif 38*b1cdbd2cSJim Jagielski 39*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_container_NoSuchElementException_idl__ 40*b1cdbd2cSJim Jagielski#include <com/sun/star/container/NoSuchElementException.idl> 41*b1cdbd2cSJim Jagielski#endif 42*b1cdbd2cSJim Jagielski 43*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_beans_PropertyValue_idl__ 44*b1cdbd2cSJim Jagielski#include <com/sun/star/beans/PropertyValue.idl> 45*b1cdbd2cSJim Jagielski#endif 46*b1cdbd2cSJim Jagielski 47*b1cdbd2cSJim Jagielski//============================================================================= 48*b1cdbd2cSJim Jagielski 49*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module ui { 50*b1cdbd2cSJim Jagielski 51*b1cdbd2cSJim Jagielski//============================================================================= 52*b1cdbd2cSJim Jagielski 53*b1cdbd2cSJim Jagielski/** is used to query, register and deregister user interface element factories. 54*b1cdbd2cSJim Jagielski 55*b1cdbd2cSJim Jagielski <p> 56*b1cdbd2cSJim Jagielski A user interface element factory is registered for a set of three properties. 57*b1cdbd2cSJim Jagielski <ul> 58*b1cdbd2cSJim Jagielski <li><b>Type</b>a string that identifies a type of a user interface element.</li> 59*b1cdbd2cSJim Jagielski <li><b>Name</b>a string that identifies a single user interface element within a type class.</li> 60*b1cdbd2cSJim Jagielski <li><b>Module</b>a string that identifies a single module of OpenOffice.</li> 61*b1cdbd2cSJim Jagielski <ul> 62*b1cdbd2cSJim Jagielski A combination of these three property values can uniquely identifiy every user interface 63*b1cdbd2cSJim Jagielski element within OpenOffice. 64*b1cdbd2cSJim Jagielski 65*b1cdbd2cSJim Jagielski Currently the following user interface element types are defined: 66*b1cdbd2cSJim Jagielski <ul> 67*b1cdbd2cSJim Jagielski <li><b>menubar</b></li> 68*b1cdbd2cSJim Jagielski <li><b>popupmenu</b></li> 69*b1cdbd2cSJim Jagielski <li><b>toolbar</b></li> 70*b1cdbd2cSJim Jagielski <li><b>statusbar</b></li> 71*b1cdbd2cSJim Jagielski <li><b>floater</b></li> 72*b1cdbd2cSJim Jagielski </ul> 73*b1cdbd2cSJim Jagielski </p> 74*b1cdbd2cSJim Jagielski 75*b1cdbd2cSJim Jagielski @since OpenOffice 2.0 76*b1cdbd2cSJim Jagielski */ 77*b1cdbd2cSJim Jagielski 78*b1cdbd2cSJim Jagielskiinterface XUIElementFactoryRegistration : com::sun::star::uno::XInterface 79*b1cdbd2cSJim Jagielski{ 80*b1cdbd2cSJim Jagielski /** function to retrieve a list of all registered user interface element factories 81*b1cdbd2cSJim Jagielski 82*b1cdbd2cSJim Jagielski @returns 83*b1cdbd2cSJim Jagielski a sequence of sequence of propert values which describe every registered 84*b1cdbd2cSJim Jagielski user interface element factory.<br/> 85*b1cdbd2cSJim Jagielski 86*b1cdbd2cSJim Jagielski The following properties are defined: 87*b1cdbd2cSJim Jagielski <ul> 88*b1cdbd2cSJim Jagielski <li><b>Type</b>a string property that identifies the type of the user interface 89*b1cdbd2cSJim Jagielski element which this factory can create.</li> 90*b1cdbd2cSJim Jagielski <li><b>Name</b>an optional string property which identifies a single user interface 91*b1cdbd2cSJim Jagielski element within a type class which this factory can create. If this property is not 92*b1cdbd2cSJim Jagielski returned, the factory is a generic factory for all user interface elements of the 93*b1cdbd2cSJim Jagielski same type.</li> 94*b1cdbd2cSJim Jagielski <li><b>Module</b>an optional string property that specifies to which module this factory is 95*b1cdbd2cSJim Jagielski bound to. If this property is not returned, the factory is a generic factory.</li> 96*b1cdbd2cSJim Jagielski </ul> 97*b1cdbd2cSJim Jagielski */ 98*b1cdbd2cSJim Jagielski sequence< sequence< com::sun::star::beans::PropertyValue > > getRegisteredFactories(); 99*b1cdbd2cSJim Jagielski 100*b1cdbd2cSJim Jagielski /** function to retrieve a previously registered user interface element factory. 101*b1cdbd2cSJim Jagielski 102*b1cdbd2cSJim Jagielski @returns 103*b1cdbd2cSJim Jagielski a reference to a registered user interface element factory if a factory has been 104*b1cdbd2cSJim Jagielski found. An empty reference when no factory has been found. 105*b1cdbd2cSJim Jagielski <b>The defined search order of factories must be from special to generic ones.</b> 106*b1cdbd2cSJim Jagielski 107*b1cdbd2cSJim Jagielski @param ResourceURL 108*b1cdbd2cSJim Jagielski a resource URL which identifies a user interface element. A resource URL uses the 109*b1cdbd2cSJim Jagielski following syntax: "private:resource/$type/$name". It is only allowed to use ascii 110*b1cdbd2cSJim Jagielski characters for type and name. 111*b1cdbd2cSJim Jagielski 112*b1cdbd2cSJim Jagielski @param ModuleName 113*b1cdbd2cSJim Jagielski an optional module identifier. This value can remain empty, if a generic factory is requested. 114*b1cdbd2cSJim Jagielski The module identifier can be retrieved from the <type scope="com::sun::star::frame">ModuleManager</type> service. 115*b1cdbd2cSJim Jagielski */ 116*b1cdbd2cSJim Jagielski ::com::sun::star::ui::XUIElementFactory getFactory( [in] string ResourceURL, [in] string ModuleIdentifier ); 117*b1cdbd2cSJim Jagielski 118*b1cdbd2cSJim Jagielski /** function to register a user interface element factory. 119*b1cdbd2cSJim Jagielski 120*b1cdbd2cSJim Jagielski @param aType 121*b1cdbd2cSJim Jagielski a string that identifies a type of a user interface element. Currently the following types 122*b1cdbd2cSJim Jagielski are supported: 123*b1cdbd2cSJim Jagielski <ul> 124*b1cdbd2cSJim Jagielski <li><b>menubar</b></li> 125*b1cdbd2cSJim Jagielski <li><b>toolbar</b></li> 126*b1cdbd2cSJim Jagielski <li><b>statusbar</b></li> 127*b1cdbd2cSJim Jagielski </ul> 128*b1cdbd2cSJim Jagielski 129*b1cdbd2cSJim Jagielski @param aName 130*b1cdbd2cSJim Jagielski an optional name of a single user interface element. This name must be unique within a user 131*b1cdbd2cSJim Jagielski interface element type class. This value can remain empty if no special factory for a single 132*b1cdbd2cSJim Jagielski user interface element is needed. 133*b1cdbd2cSJim Jagielski 134*b1cdbd2cSJim Jagielski @param aModuleIdentifier 135*b1cdbd2cSJim Jagielski an optional module identifier that can be used to register a factory only for a single module. This value 136*b1cdbd2cSJim Jagielski can remain empty if no special factory for a single module is needed. The module identifier can be retrieved 137*b1cdbd2cSJim Jagielski from the <type scope="com::sun::star::frame">ModuleManager</type> service. 138*b1cdbd2cSJim Jagielski 139*b1cdbd2cSJim Jagielski @param aFactoryImplementationName 140*b1cdbd2cSJim Jagielski a UNO implementation name that can be used by an implementation to create a factory instance. 141*b1cdbd2cSJim Jagielski */ 142*b1cdbd2cSJim Jagielski void registerFactory( [in] string aType, [in] string aName, [in] string aModuleIdentifier, [in] string aFactoryImplementationName ) raises (com::sun::star::container::ElementExistException); 143*b1cdbd2cSJim Jagielski 144*b1cdbd2cSJim Jagielski /** function to remove a previously defined user interface element factory. 145*b1cdbd2cSJim Jagielski 146*b1cdbd2cSJim Jagielski @param aType 147*b1cdbd2cSJim Jagielski a string that identifies a type of a user interface element. Currently the following types 148*b1cdbd2cSJim Jagielski are supported: 149*b1cdbd2cSJim Jagielski <ul> 150*b1cdbd2cSJim Jagielski <li><b>menubar</b></li> 151*b1cdbd2cSJim Jagielski <li><b>toolbar</b></li> 152*b1cdbd2cSJim Jagielski <li><b>statusbar</b></li> 153*b1cdbd2cSJim Jagielski </ul> 154*b1cdbd2cSJim Jagielski 155*b1cdbd2cSJim Jagielski @param aName 156*b1cdbd2cSJim Jagielski an optional name of a single user interface element. This name must be unique within a user 157*b1cdbd2cSJim Jagielski interface element type class. This value can remain empty if no special factory for a single 158*b1cdbd2cSJim Jagielski user interface element should be deregistered. 159*b1cdbd2cSJim Jagielski 160*b1cdbd2cSJim Jagielski @param aModuleName 161*b1cdbd2cSJim Jagielski an optional module name that can be used to deregister a factory only for a single module. This value 162*b1cdbd2cSJim Jagielski can remain empty if not a module based factory should be deregisted. The module identifier can be retrieved 163*b1cdbd2cSJim Jagielski from the <type scope="com::sun::star::frame">ModuleManager</type> service. 164*b1cdbd2cSJim Jagielski 165*b1cdbd2cSJim Jagielski <p> 166*b1cdbd2cSJim Jagielski <b>Using this function can be very dangerous as other implementation with OpenOffice may not be able to create their 167*b1cdbd2cSJim Jagielski user interface element anymore. 168*b1cdbd2cSJim Jagielski </b> 169*b1cdbd2cSJim Jagielski </p> 170*b1cdbd2cSJim Jagielski */ 171*b1cdbd2cSJim Jagielski void deregisterFactory( [in] string aType, [in] string aName, [in] string aModuleIdentifier ) raises (com::sun::star::container::NoSuchElementException); 172*b1cdbd2cSJim Jagielski}; 173*b1cdbd2cSJim Jagielski 174*b1cdbd2cSJim Jagielski}; }; }; }; 175*b1cdbd2cSJim Jagielski 176*b1cdbd2cSJim Jagielski//============================================================================= 177*b1cdbd2cSJim Jagielski 178*b1cdbd2cSJim Jagielski#endif 179