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