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_XConfiguration_idl__
25#define __com_sun_star_drawing_framework_XConfiguration_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30#ifndef __com_sun_star_util_XCloneable_idl__
31#include <com/sun/star/util/XCloneable.idl>
32#endif
33#ifndef __com_sun_star_drawing_framework_AnchorBindingMode_idl__
34#include <com/sun/star/drawing/framework/AnchorBindingMode.idl>
35#endif
36
37module com { module sun { module star { module drawing { module framework {
38
39published interface XResourceId;
40
41/** A configuration describes the resources of an application like panes,
42    views, and tool bars and their relationships that are currently active
43    or are requested to be activated.  Resources are specified by ResourceId
44    structures rather than references so that not only the current
45    configuration but also a requested configuration can be represented.
46
47    <p>Direct manipulation of a configuration object is not advised with the
48    exception of the <type>ConfigurationController</type> and objects that
49    implement the <type>XConfigurationChangeRequest</type> interface.</p>
50
51    @see XConfigurationController
52*/
53published interface XConfiguration
54    : ::com::sun::star::util::XCloneable
55{
56    /** Returns the list of resources that are bound directly and/or
57        indirectly to the given anchor.  A URL filter can reduce the set of
58        returned resource ids.
59        @param xAnchorId
60            This anchor typically is either a pane or an empty
61            <type>XResourceId</type> object.  An
62            empty reference is treated like an <type>XResourceId</type> object.
63        @param sURLPrefix
64            When a non-empty string is given then resource ids are returned
65            only when their resource URL matches this prefix, i.e. when it
66            begins with this prefix or is equal to it.  Characters with
67            special meaning to URLs are not interpreted.  In the typical
68            usage the prefix specifies the type of a resource.  A typical
69            value is "private:resource/floater/", which is the prefix for
70            pane URLs.  In a recursive search, only resource ids at the top
71            level are matched against this prefix.
72            <p>Use an empty string to prevent filtering out resource ids.</p>
73        @param eSearchMode
74            This flag defines whether to return only resources that are
75            directly bound to the given anchor or a recursive search is to
76            be made.  Note that for the recursive search and an empty anchor
77            all resource ids are returned that belong to the configuration.
78        @return
79            The set of returned resource ids may be empty when there are no
80            resource ids that match all conditions.  The resources in the
81            sequence are ordered with respect to the
82            XResourceId::compareTo() method.
83    */
84    sequence<XResourceId> getResources (
85        [in] XResourceId xAnchorId,
86        [in] string sTargetURLPrefix,
87        [in] AnchorBindingMode eSearchMode);
88
89    /** <p>Returns wether the specified resource is part of the
90        configuration.</p>
91        This is independent of whether the resource does really exist and is
92        active, i.e. has a visible representation in the GUI.
93        @param xResourceId
94            The id of a resource.  May be empty (empty reference or empty
95            <type>XResourceId</type> object) in which case <FALSE/> is
96            returned.
97        @return
98            Returns <TRUE/> when the resource is part of the configuration
99            and <FALSE/> when it is not.
100    */
101    boolean hasResource ([in] XResourceId xResourceId);
102
103    /** Add a resource to the configuration.
104        <p>This method should be used only by objects that implement the
105        <type>XConfigurationRequest</type> interface or by the configuration
106        controller.</p>
107        @param xResourceId
108            The resource to add to the configuration.  When the specified
109            resource is already part of the configuration then this call is
110            silently ignored.
111        @throws IllegalArgumentException
112            When an empty resource id is given then an
113            IllegalArgumentException is thrown.
114    */
115    void addResource ([in] XResourceId xResourceId);
116
117    /** Remove a resource from the configuration.
118        <p>This method should be used only by objects that implement the
119        <type>XConfigurationRequest</type> interface or by the configuration
120        controller.</p>
121        @param xResourceId
122            The resource to remove from the configuration. When the
123            specified resource is not part of the configuration then this
124            call is silently ignored.
125        @throws IllegalArgumentException
126            When an empty resource id is given then an
127            IllegalArgumentException is thrown.
128    */
129    void removeResource ([in] XResourceId xResource);
130};
131
132}; }; }; }; }; // ::com::sun::star::drawing::framework
133
134#endif
135