Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_UCBHELPER_REGISTERUCB_HXX
21 : #define INCLUDED_UCBHELPER_REGISTERUCB_HXX
22 :
23 : #include <com/sun/star/uno/RuntimeException.hpp>
24 : #include <com/sun/star/uno/Reference.h>
25 : #include <com/sun/star/ucb/XContentProviderManager.hpp>
26 : #include <vector>
27 :
28 : #include <ucbhelper/ucbhelperdllapi.h>
29 :
30 : namespace com { namespace sun { namespace star {
31 : namespace lang { class XMultiServiceFactory; }
32 : namespace uno { class XComponentContext; }
33 : } } }
34 :
35 :
36 : namespace ucbhelper {
37 :
38 :
39 : /** Information about a content provider, passed to
40 : <method>configureUcb</method>.
41 : */
42 9900 : struct ContentProviderData
43 : {
44 : /** The UNO service name to use to instanciate the content provider.
45 :
46 : If it is the empty string, a null provider will be used (see the
47 : documentation of the Provider argument to
48 : com.sun.star.ucb.XContentProviderManager.registerContentProvider).
49 : */
50 : OUString ServiceName;
51 :
52 : /** The URL template to use to instanciate the content provider.
53 : */
54 : OUString URLTemplate;
55 :
56 : /** The arguments to use to instanciate the content provider.
57 : */
58 : OUString Arguments;
59 :
60 1980 : ContentProviderData() {};
61 : ContentProviderData( const OUString & rService,
62 : const OUString & rTemplate,
63 : const OUString & rArgs )
64 : : ServiceName( rService ), URLTemplate( rTemplate ), Arguments( rArgs ) {}
65 : };
66 :
67 : typedef std::vector< ContentProviderData > ContentProviderDataList;
68 :
69 : /** Register a content provider at a Universal Content Broker.
70 :
71 : @param rManager A content provider manager (normally, this would be a
72 : UCB). May be null, which is only useful if the content provider is an
73 : XParamterizedContentProviders.
74 :
75 : @param rServiceFactory A factory through which to obtain the required
76 : services.
77 :
78 : @param rName The service name of the content provider. If it is the empty
79 : string, a null provider will be used (see the documentation of the Provider
80 : argument to
81 : com.sun.star.ucb.XContentProviderManager.registerContentProvider).
82 :
83 : @param rArguments Any arguments to instantiate the content provider with.
84 :
85 : @param rTemplate The URL template to register the content provider on.
86 :
87 : @param pInfo If not null, this output parameter is filled with
88 : information about the (atemptively) registered provider.
89 : */
90 :
91 : UCBHELPER_DLLPUBLIC bool registerAtUcb(
92 : com::sun::star::uno::Reference<
93 : com::sun::star::ucb::XContentProviderManager > const &
94 : rManager,
95 : com::sun::star::uno::Reference<
96 : com::sun::star::uno::XComponentContext > const &
97 : rxContext,
98 : OUString const & rName,
99 : OUString const & rArguments,
100 : OUString const & rTemplate)
101 : throw (com::sun::star::uno::RuntimeException);
102 :
103 : }
104 : #endif // INCLUDED_UCBHELPER_REGISTERUCB_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|