xref: /AOO41X/main/offapi/com/sun/star/drawing/framework/XConfiguration.idl (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_drawing_framework_XConfiguration_idl__
29#define __com_sun_star_drawing_framework_XConfiguration_idl__
30
31#ifndef __com_sun_star_uno_XInterface_idl__
32#include <com/sun/star/uno/XInterface.idl>
33#endif
34#ifndef __com_sun_star_util_XCloneable_idl__
35#include <com/sun/star/util/XCloneable.idl>
36#endif
37#ifndef __com_sun_star_drawing_framework_AnchorBindingMode_idl__
38#include <com/sun/star/drawing/framework/AnchorBindingMode.idl>
39#endif
40
41module com { module sun { module star { module drawing { module framework {
42
43published interface XResourceId;
44
45/** A configuration describes the resources of an application like panes,
46    views, and tool bars and their relationships that are currently active
47    or are requested to be activated.  Resources are specified by ResourceId
48    structures rather than references so that not only the current
49    configuration but also a requested configuration can be represented.
50
51    <p>Direct manipulation of a configuration object is not advised with the
52    exception of the <type>ConfigurationController</type> and objects that
53    implement the <type>XConfigurationChangeRequest</type> interface.</p>
54
55    @see XConfigurationController
56*/
57published interface XConfiguration
58    : ::com::sun::star::util::XCloneable
59{
60    /** Returns the list of resources that are bound directly and/or
61        indirectly to the given anchor.  A URL filter can reduce the set of
62        returned resource ids.
63        @param xAnchorId
64            This anchor typically is either a pane or an empty
65            <type>XResourceId</type> object.  An
66            empty reference is treated like an <type>XResourceId</type> object.
67        @param sURLPrefix
68            When a non-empty string is given then resource ids are returned
69            only when their resource URL matches this prefix, i.e. when it
70            begins with this prefix or is equal to it.  Characters with
71            special meaning to URLs are not interpreted.  In the typical
72            usage the prefix specifies the type of a resource.  A typical
73            value is "private:resource/floater/", which is the prefix for
74            pane URLs.  In a recursive search, only resource ids at the top
75            level are matched against this prefix.
76            <p>Use an empty string to prevent filtering out resource ids.</p>
77        @param eSearchMode
78            This flag defines whether to return only resources that are
79            directly bound to the given anchor or a recursive search is to
80            be made.  Note that for the recursive search and an empty anchor
81            all resource ids are returned that belong to the configuration.
82        @return
83            The set of returned resource ids may be empty when there are no
84            resource ids that match all conditions.  The resources in the
85            sequence are ordered with respect to the
86            XResourceId::compareTo() method.
87    */
88    sequence<XResourceId> getResources (
89        [in] XResourceId xAnchorId,
90        [in] string sTargetURLPrefix,
91        [in] AnchorBindingMode eSearchMode);
92
93    /** <p>Returns wether the specified resource is part of the
94        configuration.</p>
95        This is independent of whether the resource does really exist and is
96        active, i.e. has a visible representation in the GUI.
97        @param xResourceId
98            The id of a resource.  May be empty (empty reference or empty
99            <type>XResourceId</type> object) in which case <FALSE/> is
100            returned.
101        @return
102            Returns <TRUE/> when the resource is part of the configuration
103            and <FALSE/> when it is not.
104    */
105    boolean hasResource ([in] XResourceId xResourceId);
106
107    /** Add a resource to the configuration.
108        <p>This method should be used only by objects that implement the
109        <type>XConfigurationRequest</type> interface or by the configuration
110        controller.</p>
111        @param xResourceId
112            The resource to add to the configuration.  When the specified
113            resource is already part of the configuration then this call is
114            silently ignored.
115        @throws IllegalArgumentException
116            When an empty resource id is given then an
117            IllegalArgumentException is thrown.
118    */
119    void addResource ([in] XResourceId xResourceId);
120
121    /** Remove a resource from the configuration.
122        <p>This method should be used only by objects that implement the
123        <type>XConfigurationRequest</type> interface or by the configuration
124        controller.</p>
125        @param xResourceId
126            The resource to remove from the configuration. When the
127            specified resource is not part of the configuration then this
128            call is silently ignored.
129        @throws IllegalArgumentException
130            When an empty resource id is given then an
131            IllegalArgumentException is thrown.
132    */
133    void removeResource ([in] XResourceId xResource);
134};
135
136}; }; }; }; }; // ::com::sun::star::drawing::framework
137
138#endif
139