xref: /AOO41X/main/offapi/com/sun/star/drawing/framework/XResourceFactory.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_drawing_framework_XResourceFactory_idl__
25cdf0e10cSrcweir#define __com_sun_star_drawing_framework_XResourceFactory_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
28cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
31cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir#ifndef __com_sun_star_lang_WrappedTargetException_idl__
34cdf0e10cSrcweir#include <com/sun/star/lang/WrappedTargetException.idl>
35cdf0e10cSrcweir#endif
36cdf0e10cSrcweir
37cdf0e10cSrcweirmodule com { module sun { module star { module drawing { module framework {
38cdf0e10cSrcweir
39cdf0e10cSrcweirpublished interface XResource;
40cdf0e10cSrcweirpublished interface XResourceId;
41cdf0e10cSrcweir
42cdf0e10cSrcweir/** Factory and possibly cache for creating and releasing resources.
43cdf0e10cSrcweir    <p>A resource factory is created and used by the
44cdf0e10cSrcweir    <type>XConfigurationController</type> object.</p>
45cdf0e10cSrcweir    <p>A factory may want to implement a cache to reuse previously released
46cdf0e10cSrcweir    resources.</p>
47cdf0e10cSrcweir*/
48cdf0e10cSrcweirpublished interface XResourceFactory
49cdf0e10cSrcweir{
50cdf0e10cSrcweir    /** Create a resource for the given <type>XResourceId</type> object.
51cdf0e10cSrcweir        @param xResourceId
52cdf0e10cSrcweir            The resourc URL of this id specifies the type of resource to
53cdf0e10cSrcweir            create.  The anchor can be used to obtain the associated object
54cdf0e10cSrcweir            from the configuration controller.  For example, when a view is
55cdf0e10cSrcweir            created, then the new object can be initialized with the pane
56cdf0e10cSrcweir            that is its anchor.
57cdf0e10cSrcweir            <p>Valid values are those for which the factory has previously been
58cdf0e10cSrcweir            registered at the <type>XConfigurationController</type></p>.
59cdf0e10cSrcweir        @return
60cdf0e10cSrcweir            Returns a resource object that has been just created or was
61cdf0e10cSrcweir            taken from a cache.  When the requested resource can not be
62cdf0e10cSrcweir            created then an empty reference is returned.  A later call may
63cdf0e10cSrcweir            be successfull.  This, for example, can be the case with SFX
64cdf0e10cSrcweir            based side panes.  They are not available right after the
65cdf0e10cSrcweir            creation of a new application frame.
66cdf0e10cSrcweir        @throws InvalidArgumentException
67cdf0e10cSrcweir            when the given URL is not supported by the factory.
68cdf0e10cSrcweir    */
69cdf0e10cSrcweir    XResource createResource (
70cdf0e10cSrcweir            [in] XResourceId xResourceId)
71cdf0e10cSrcweir        raises  (   ::com::sun::star::lang::IllegalArgumentException,
72cdf0e10cSrcweir                    ::com::sun::star::lang::WrappedTargetException
73cdf0e10cSrcweir                );
74cdf0e10cSrcweir
75cdf0e10cSrcweir    /** Call this method to tell a factory that the given resource is no
76cdf0e10cSrcweir        longer in use.  The factory can decide whether to destroy the
77cdf0e10cSrcweir        resource or to keep it in a cache in order to reuse it later.
78cdf0e10cSrcweir        @param xResource
79cdf0e10cSrcweir            The given resource has to be one created by the same factory.
80cdf0e10cSrcweir        @throws InvalidArgumentException
81cdf0e10cSrcweir            when the given pane was not created by the same factory.
82cdf0e10cSrcweir    */
83cdf0e10cSrcweir    void releaseResource ([in] XResource xResource);
84cdf0e10cSrcweir};
85cdf0e10cSrcweir
86cdf0e10cSrcweir}; }; }; }; }; // ::com::sun::star::drawing::framework
87cdf0e10cSrcweir
88cdf0e10cSrcweir#endif
89