xref: /trunk/main/offapi/com/sun/star/ucb/UniversalContentBroker.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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#ifndef __com_sun_star_ucb_UniversalContentBroker_idl__
28#define __com_sun_star_ucb_UniversalContentBroker_idl__
29
30#ifndef __com_sun_star_lang_XComponent_idl__
31#include <com/sun/star/lang/XComponent.idl>
32#endif
33
34#ifndef __com_sun_star_ucb_XCommandProcessor_idl__
35#include <com/sun/star/ucb/XCommandProcessor.idl>
36#endif
37
38#ifndef __com_sun_star_ucb_XCommandProcessor2_idl__
39#include <com/sun/star/ucb/XCommandProcessor2.idl>
40#endif
41
42#ifndef __com_sun_star_ucb_XContentProviderManager_idl__
43#include <com/sun/star/ucb/XContentProviderManager.idl>
44#endif
45
46#ifndef __com_sun_star_ucb_XContentProvider_idl__
47#include <com/sun/star/ucb/XContentProvider.idl>
48#endif
49
50#ifndef __com_sun_star_ucb_XContentIdentifierFactory_idl__
51#include <com/sun/star/ucb/XContentIdentifierFactory.idl>
52#endif
53
54#ifndef __com_sun_star_lang_XInitialization_idl__
55#include <com/sun/star/lang/XInitialization.idl>
56#endif
57
58//=============================================================================
59
60module com { module sun { module star { module ucb {
61
62//=============================================================================
63/** is a one-instance service that provides access to a set of
64    <type>Content</type>s via <type>ContentProvider</type>s.
65
66    <p>If the instance is created with two arguments of type string,
67    these two strings are used to configure the newly instantiated broker;
68    see the description of the required
69    <type scope="com::sun::star::lang">XInitialization</type> interface for
70    details.
71
72    <p>If the instance is created without arguments, the newly instatiated
73    broker is not configured.
74*/
75published service UniversalContentBroker
76{
77    //-------------------------------------------------------------------------
78    /** must be implemented to make it possible to resolve cyclic object
79        references.
80
81        <p>Those references i.e. may occure if content provider implementations
82        hold references to the Broker. The Broker itself always holds its
83        providers. If the Broker shall be released,
84        <member scope="com::sun::star::lang">XComponent::dispose</member>
85        must be called at the Broker. The implementation of this method must
86        call
87        <member scope="com::sun::star::lang">XEventListener::disposing</member>
88        on the registered listeners (the providers holding the Broker must be
89        those listeners) and release the appropriate object references. At
90        the other hand, the implementation of XEventListener::disposing must
91        release its appropriate references.
92
93        <p>This interface is required.
94     */
95    interface com::sun::star::lang::XComponent;
96
97    //-------------------------------------------------------------------------
98    /** provides access to all kind of contents provided by the registered
99        content providers.
100
101        <p>This interface is required.
102     */
103    interface com::sun::star::ucb::XContentProvider;
104
105    //-------------------------------------------------------------------------
106    /** provides access to a set of content providers registered with the UCB.
107
108        <p>This interface is required.
109     */
110    interface com::sun::star::ucb::XContentProviderManager;
111
112    //-------------------------------------------------------------------------
113    /** creates <type>XContentIdentifier</type> implementation objects for
114        all kind of contents provided by the UCB.
115
116        <p>This interface is required.
117      */
118    interface com::sun::star::ucb::XContentIdentifierFactory;
119
120    //-------------------------------------------------------------------------
121    /** supports the configuration of a newly created broker.
122
123        <p>The
124        <member scope="com::sun::star::lang">XInitialization::initialize</member>
125        method should be called with two arguments of type string. These strings
126        are used as a pair of keys to retrieve a set of content provider
127        descriptions from the configuration management (stored at
128        <code>org.openoffice.ucb.Configuration.ContentProviders.<var>key<sub>1</sub></var>.SecondaryKeys.<var>key<sub>2</sub></var>.ProviderData</code>
129        within the configuration management's hierarchy). The retrieved
130        descriptions are in turn used to register the corresponding content
131        provider services at the broker.
132
133        <p>Typical values for the pair of strings would be
134        <code>"Local"</code>/<code>"Office"</code>, to configure a broker that
135        contains all the relevant content providers.
136
137        <p>This interface is required.
138     */
139    interface com::sun::star::lang::XInitialization;
140
141    //-------------------------------------------------------------------------
142    /** enables the caller to execute commands at the broker.
143
144        <p>This interface is required.
145
146        <p><pre>
147        =======================================================================
148        Commands:
149        =======================================================================
150
151        [return type]
152            [command name]
153                [parameter type and name]
154
155        -----------------------------------------------------------------------
156        Requiered commands:
157        -----------------------------------------------------------------------
158
159        // This command obtains an interface which allows to query
160        // information on commands supported by the Content Broker.
161
162        <type>XCommandInfo</type>
163            getCommandInfo
164                void
165
166        // This command transfers Contents from one location to another.
167        // Additionally, it can be used to create a link to a Content.
168        // The implementation must be able to handle Contents provided
169        // by any Content Provider. This is different from the command
170        // 'transfer' that can be supported by a Content. That command
171        // typically can only handle <type>Content</type>s provided by one
172        // <type>ContentProvider</type>.
173
174        void
175            globalTransfer
176                <type>GlobalTransferCommandArgument</type>
177        </pre>
178     */
179    interface com::sun::star::ucb::XCommandProcessor;
180
181    //-------------------------------------------------------------------------
182    /** is an enhanced version of <type>XCommandProcessor</type> that has an
183        additional method for releasing command identifiers obtained via
184        <member>XCommandProcessor::createCommandIdentifier</member> to avoid
185        resource leaks. For a detailed description of the problem refer to
186        <member>XCommandProcessor2::releaseCommandIdentifier</member>.
187
188        <p>Where many existing <type>UniversalContentBroker</type>
189        implementations do not (yet), every new implementation should support
190        this interface.
191     */
192    [optional] interface com::sun::star::ucb::XCommandProcessor2;
193
194};
195
196//=============================================================================
197
198}; }; }; };
199
200#endif
201