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