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_drawing_framework_XResourceFactoryManager_idl__
25#define __com_sun_star_drawing_framework_XResourceFactoryManager_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31module com { module sun { module star { module drawing { module framework {
32
33published interface XResourceId;
34published interface XResourceFactory;
35
36/** The XResourceFactoryManager is part of the configuration controller and
37    manages the set of registered resource factories.
38
39    @see XConfigurationController
40    @see XResourceFactory
41*/
42published interface XResourceFactoryManager
43{
44    /** Register a new resource factory for the given URL.
45        <p>When one factory is responsible for more than one type of resource
46        then this method has to be called for each type.  If this method is
47        called multiple times for the same URL then a previously registered
48        factory is removed for the URL.</p>
49        @param sResourceURL
50            The URL of the resource that the factory can create.
51        @param xResourceFactory
52            The resource factory object.
53    */
54    void addResourceFactory (
55        [in] string sResourceURL,
56        [in] XResourceFactory xResourceFactory);
57
58    /** Remove a resource factory for one type of resource.  When the
59        factory has been registered for other URLs as well then it remains
60        registered for them.  Use the
61        <member>removeResourceFactoryForReference()</member> to remove a
62        factory completely.
63        @param sResourceURL
64            The URL for which to remove the resource factory.
65    */
66    void removeResourceFactoryForURL (
67        [in] string sResourceURL);
68
69    /** Remove a resource factory for all resource types it has been registered for.  Use
70        <member>removeResourceFactoryForURL</member> to remove a factory
71        just for one resource type and to leave it registered for others.
72        @param xResourceFactory
73            The resource factory object to remove.
74    */
75    void removeResourceFactoryForReference (
76        [in] XResourceFactory xResourceFactory);
77
78    /** Return the resource factory that was previously registered for the
79        given resource type.  This method is typically called by one of the
80        resource controllers.
81        @param sResourceURL
82            The URL of the resource type for which to return the resource
83            factory.
84        @return
85            When no resource factory was registered for the given resource
86            type then an empty reference is returned.
87    */
88    XResourceFactory getResourceFactory (
89        [in] string sResourceURL);
90};
91
92}; }; }; }; }; // ::com::sun::star::drawing::framework
93
94#endif
95