1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_frame_XModuleManager_idl__
25#define __com_sun_star_frame_XModuleManager_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
32#include <com/sun/star/lang/IllegalArgumentException.idl>
33#endif
34
35#ifndef __com_sun_star_frame_UnknownModuleException_idl__
36#include <com/sun/star/frame/UnknownModuleException.idl>
37#endif
38
39//===============================================
40
41module com { module sun { module star { module frame {
42
43//===============================================
44/** can be used to identify office modules.
45
46    @since OpenOffice 2.0
47 */
48published interface XModuleManager : com::sun::star::uno::XInterface
49{
50    //-------------------------------------------
51    /**
52       @short  identifies the given module.
53
54       @descr  This identifier can then be used at the service <type>ModuleManager</type>
55               to get more information about this module.
56
57               For identification the interface <type scope="com::sun::star::lang">XServiceInfo</type>
58               is requested on the given module. Because all module service registrations must be unique
59               this value can be queried and checked against the configuration.
60
61               Since OpenOffice 2.3.0 also the optional interface <type>XModule</type> will be used.
62               If its exists it will be preferred.
63
64       @param  Module
65               Possible objects for this parameter can be the following one:
66               <ul>
67                   <li>
68                       <b><type scope="com::sun::star::frame">XFrame</type></b><br>
69                       A frame contains (against a component window) a controller.
70                       Such controller represent the module (in case no model exists).
71                   </li>
72                   <li>
73                       <b><type scope="com::sun::star::frame">XController</type></b><br>
74                       A controller can be bound to a model. Then the model represent the module.
75                       If no model exists - the controller is used for identification.
76                   </li>
77                   <li>
78                       <b><type scope="com::sun::star::frame">XModel</type></b><br>
79                       A model represent a module everytimes and can be used for
80                       identification directly.
81                   </li>
82               </ul>
83
84       @throws <type scope="com::sun::star::lang">IllegalArgumentException</type>
85               if the parameter Module is:
86               <ul>
87                   <li>an empty one</li>
88                   <li>or does not provide one of the needed interface
89                       XFrame, XControllerm, XModel</li>
90                   <li>or does not provide the needed interface XServiceInfo.</li>
91               </ul>
92
93       @throws <type>UnknownModuleException</type>
94               if the given module could not be identified.
95               Note: If the module represent a XFrame instance with does not contain
96               a document, this exception is thrown too!
97
98       @return An identifier for the given module.
99               Note: This value is valie everytimes. Error will be transported
100               by thrown exceptions!
101     */
102    string identify( [in] ::com::sun::star::uno::XInterface Module )
103        raises(::com::sun::star::lang::IllegalArgumentException,
104                                       UnknownModuleException  );
105
106
107};
108
109}; }; }; };
110
111#endif
112