xref: /AOO41X/main/offapi/com/sun/star/ucb/XContentProviderManager.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_ucb_XContentProviderManager_idl__
28*cdf0e10cSrcweir#define __com_sun_star_ucb_XContentProviderManager_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_ucb_XContentProvider_idl__
35*cdf0e10cSrcweir#include <com/sun/star/ucb/XContentProvider.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_ucb_DuplicateProviderException_idl__
39*cdf0e10cSrcweir#include <com/sun/star/ucb/DuplicateProviderException.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_ucb_ContentProviderInfo_idl__
43*cdf0e10cSrcweir#include <com/sun/star/ucb/ContentProviderInfo.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir
47*cdf0e10cSrcweir//=============================================================================
48*cdf0e10cSrcweir
49*cdf0e10cSrcweirmodule com { module sun { module star { module ucb {
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir//=============================================================================
52*cdf0e10cSrcweir/** makes it possible to query/register/deregister content providers.
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir    @version  1.0
55*cdf0e10cSrcweir    @author   Kai Sommerfeld
56*cdf0e10cSrcweir    @see      XContentProvider
57*cdf0e10cSrcweir*/
58*cdf0e10cSrcweirpublished interface XContentProviderManager: com::sun::star::uno::XInterface
59*cdf0e10cSrcweir{
60*cdf0e10cSrcweir    //-------------------------------------------------------------------------
61*cdf0e10cSrcweir    /** registers a content provider for a specific URL template.
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir        @see XContentIdentifier
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir        @param Provider
66*cdf0e10cSrcweir        the content provider to register.
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir        <p>This may be <NULL/>, in which case a later
69*cdf0e10cSrcweir        <member>XContentProvider::queryContent</member> with an
70*cdf0e10cSrcweir        <type>XContentIdentifier</type> that matches the <var>Scheme</var>
71*cdf0e10cSrcweir        will simply return <NULL/>. These "dummy" content providers are useful
72*cdf0e10cSrcweir        in combination with other content providers that are registered on a
73*cdf0e10cSrcweir        wildcard URL template: For example, imagine that you want to route all
74*cdf0e10cSrcweir        http URLs to a HTTP content provider, but want to block all URLs for
75*cdf0e10cSrcweir        the server <code>www.dont.go</code>. One solution would be to register
76*cdf0e10cSrcweir        the HTTP content provider on the <var>Scheme</var> <code>http</code>,
77*cdf0e10cSrcweir        and to register a "dummy" (i.e., <NULL/>) content provider on the
78*cdf0e10cSrcweir        <var>Scheme</var> <code>"http://www.dont.go"([/?#].*)?</code>.
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir        @param Scheme
81*cdf0e10cSrcweir        the URL scheme for the provided contents. More generally, this may not
82*cdf0e10cSrcweir        only be a URL scheme, but a URL template.
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir        <p>A URL template is a regular expression (represented as a string) that
85*cdf0e10cSrcweir        specifies a subset of the set of all possible URLs (this subset
86*cdf0e10cSrcweir        consists of exactly those URLs that match the regular expression).  The
87*cdf0e10cSrcweir        language to denote the regular expressions is initially quite limited,
88*cdf0e10cSrcweir        but it may be extended in the future:
89*cdf0e10cSrcweir
90*cdf0e10cSrcweir        <p><ul>
91*cdf0e10cSrcweir        <li><code>regexp = scheme / simple / translation</code></li>
92*cdf0e10cSrcweir        <li><code>scheme = ALPHA *(ALPHA / DIGIT / "+" / "-" / ".")</code></li>
93*cdf0e10cSrcweir        <li><code>simple = simple-prefix / simple-authority / simple-domain</code></li>
94*cdf0e10cSrcweir        <li><code>translation = trans-prefix / trans-authority / trans-domain</code></li>
95*cdf0e10cSrcweir        <li><code>simple-prefix = [string] ".*"</code></li>
96*cdf0e10cSrcweir        <li><code>trans-prefix = [string] "(.*)->" [string] "\1"</code></li>
97*cdf0e10cSrcweir        <li><code>simple-authority = [string] "([/?#].*)?"</code></li>
98*cdf0e10cSrcweir        <li><code>trans-authority = [string] "(([/?#].*)?)->" string "\1"</code></li>
99*cdf0e10cSrcweir        <li><code>simple-domain = [string] "[^/?#]*" string "([/?#].*)?"</code></li>
100*cdf0e10cSrcweir        <li><code>trans-domain = [string] "([^/?#]*" string "([/?#].*)?)->" string "\1"</code></li>
101*cdf0e10cSrcweir        <li><code>string = DQUOTE 1*(schar / sescape) DQUOTE  ; DQUOTE is "</code></li>
102*cdf0e10cSrcweir        <li><code>schar = &lt any UTF-16 character except " or \></code></li>
103*cdf0e10cSrcweir        <li><code>sescape = "\" (DQUOTE / "\")</code></li>
104*cdf0e10cSrcweir        </ul>
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir        <p>A <code>&lt;scheme&gt:</code> matches any URL of exactly the given
107*cdf0e10cSrcweir        scheme (ignoring case), keeping the extension from URL schemes to URL
108*cdf0e10cSrcweir        templates backwards compatible.  The <code>&lt;simple&gt:</code>
109*cdf0e10cSrcweir        regexps match any URL starting with a given string literal, followed
110*cdf0e10cSrcweir        by arbitrary characters (<code>&lt;simple-prefix&gt:</code>), or
111*cdf0e10cSrcweir        by arbitrary characters that start with one of '/', '?', or '#', if any
112*cdf0e10cSrcweir        (<code>&lt;simple-authority&gt:</code>), or by arbitrary characters not
113*cdf0e10cSrcweir        including any of '/', '?', or '#', followed by a given string literal,
114*cdf0e10cSrcweir        followed by arbitrary characters that start with one of '/', '?', or
115*cdf0e10cSrcweir        '#', if any. The comparision of string literals is done ignoring the
116*cdf0e10cSrcweir        case of ASCII letters.  The <code>&lt;translation&gt:</code> regexps
117*cdf0e10cSrcweir        match the same URLs as their <code>&lt;simple&gt:</code> counterparts,
118*cdf0e10cSrcweir        but they also describe how a (local) URL is mapped to another (remote)
119*cdf0e10cSrcweir        URL.  This mapping is only relevant for methods of the
120*cdf0e10cSrcweir        <type>RemoteAccessContentProvider</type>'s
121*cdf0e10cSrcweir        <type>XParameterizedContentProvider</type> interface; in all other
122*cdf0e10cSrcweir        cases, <code>&lt;translation&gt:</code> regexps have the same semantics
123*cdf0e10cSrcweir        as their <code>&lt;simple&gt:</code> counterparts.
124*cdf0e10cSrcweir
125*cdf0e10cSrcweir        @param ReplaceExisting
126*cdf0e10cSrcweir        <TRUE/>: replace the provider possibly registered for the given URL
127*cdf0e10cSrcweir        template. The replaced provider will not be deregistered automatically!
128*cdf0e10cSrcweir        If the superseding provider gets deregistered, the superseded one will
129*cdf0e10cSrcweir        become active again.
130*cdf0e10cSrcweir        <p><FALSE/>: do not register, if another provider is already registered
131*cdf0e10cSrcweir        for the given URL template.
132*cdf0e10cSrcweir
133*cdf0e10cSrcweir        @returns
134*cdf0e10cSrcweir        the replaced content provider, if there was one.
135*cdf0e10cSrcweir    */
136*cdf0e10cSrcweir    com::sun::star::ucb::XContentProvider registerContentProvider(
137*cdf0e10cSrcweir                [in] com::sun::star::ucb::XContentProvider Provider,
138*cdf0e10cSrcweir                [in] string Scheme,
139*cdf0e10cSrcweir                [in] boolean ReplaceExisting )
140*cdf0e10cSrcweir        raises( com::sun::star::ucb::DuplicateProviderException );
141*cdf0e10cSrcweir
142*cdf0e10cSrcweir    //-------------------------------------------------------------------------
143*cdf0e10cSrcweir    /** deregisters a content provider.
144*cdf0e10cSrcweir
145*cdf0e10cSrcweir        @param Provider
146*cdf0e10cSrcweir        a content provider to deregister.
147*cdf0e10cSrcweir
148*cdf0e10cSrcweir        @param Scheme
149*cdf0e10cSrcweir        the URL scheme for the provided contents. More generally, this
150*cdf0e10cSrcweir        may not only be a URL scheme, but a URL template (see
151*cdf0e10cSrcweir        <member>registerContentProvider</member> for a discussion of URL
152*cdf0e10cSrcweir        templates).
153*cdf0e10cSrcweir    */
154*cdf0e10cSrcweir    [oneway] void deregisterContentProvider(
155*cdf0e10cSrcweir                [in] com::sun::star::ucb::XContentProvider Provider,
156*cdf0e10cSrcweir                [in] string Scheme );
157*cdf0e10cSrcweir
158*cdf0e10cSrcweir    //-------------------------------------------------------------------------
159*cdf0e10cSrcweir    /** returns a list of information on all registered content providers.
160*cdf0e10cSrcweir
161*cdf0e10cSrcweir        @returns
162*cdf0e10cSrcweir        a list information on content providers.
163*cdf0e10cSrcweir    */
164*cdf0e10cSrcweir    sequence<com::sun::star::ucb::ContentProviderInfo> queryContentProviders();
165*cdf0e10cSrcweir
166*cdf0e10cSrcweir    //-------------------------------------------------------------------------
167*cdf0e10cSrcweir    /** returns the currently active content provider for a content
168*cdf0e10cSrcweir        identifier.
169*cdf0e10cSrcweir
170*cdf0e10cSrcweir        @param Identifier
171*cdf0e10cSrcweir        a content identifier (i.e., a URL).
172*cdf0e10cSrcweir
173*cdf0e10cSrcweir        @returns
174*cdf0e10cSrcweir        a content provider.
175*cdf0e10cSrcweir    */
176*cdf0e10cSrcweir    com::sun::star::ucb::XContentProvider queryContentProvider(
177*cdf0e10cSrcweir                [in] string Identifier );
178*cdf0e10cSrcweir};
179*cdf0e10cSrcweir
180*cdf0e10cSrcweir//=============================================================================
181*cdf0e10cSrcweir
182*cdf0e10cSrcweir}; }; }; };
183*cdf0e10cSrcweir
184*cdf0e10cSrcweir#endif
185