update credits
[LibreOffice.git] / include / ucbhelper / registerucb.hxx
blobab241a2f9cb4d9a02f16507133d011d3853d7598
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _UCBHELPER_REGISTERUCB_HXX_
21 #define _UCBHELPER_REGISTERUCB_HXX_
23 #include <com/sun/star/uno/RuntimeException.hpp>
24 #include <com/sun/star/uno/Reference.h>
25 #include <com/sun/star/ucb/XContentProvider.hpp>
26 #include <com/sun/star/ucb/XContentProviderManager.hpp>
27 #include <vector>
29 #include "ucbhelper/ucbhelperdllapi.h"
31 namespace com { namespace sun { namespace star {
32 namespace lang { class XMultiServiceFactory; }
33 } } }
36 namespace ucbhelper {
38 //============================================================================
39 /** Information about a registered content provider.
41 struct ContentProviderRegistrationInfo
43 /** The registered content provider (or null if registration failed).
45 com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >
46 m_xProvider;
48 /** The arguments the content provider was instantiated with.
50 OUString m_aArguments;
52 /** The URL template the content provider is registered on.
54 OUString m_aTemplate;
57 typedef std::vector< ContentProviderRegistrationInfo >
58 ContentProviderRegistrationInfoList;
60 //============================================================================
61 /** Information about a content provider, passed to
62 <method>configureUcb</method>.
64 struct ContentProviderData
66 /** The UNO service name to use to instanciate the content provider.
68 OUString ServiceName;
70 /** The URL template to use to instanciate the content provider.
72 OUString URLTemplate;
74 /** The arguments to use to instanciate the content provider.
76 OUString Arguments;
78 ContentProviderData() {};
79 ContentProviderData( const OUString & rService,
80 const OUString & rTemplate,
81 const OUString & rArgs )
82 : ServiceName( rService ), URLTemplate( rTemplate ), Arguments( rArgs ) {}
85 typedef std::vector< ContentProviderData > ContentProviderDataList;
86 //============================================================================
87 /** Register a content provider at a Universal Content Broker.
89 @param rManager A content provider manager (normally, this would be a
90 UCB). May be null, which is only useful if the content provider is an
91 <type>XParamterizedContentProvider</type>s.
93 @param rServiceFactory A factory through which to obtain the required
94 services.
96 @param rName The service name of the content provider.
98 @param rArguments Any arguments to instantiate the content provider with.
100 @param rTemplate The URL template to register the content provider on.
102 @param pInfo If not null, this output parameter is filled with
103 information about the (atemptively) registered provider.
106 UCBHELPER_DLLPUBLIC bool registerAtUcb(
107 com::sun::star::uno::Reference<
108 com::sun::star::ucb::XContentProviderManager > const &
109 rManager,
110 com::sun::star::uno::Reference<
111 com::sun::star::lang::XMultiServiceFactory > const &
112 rServiceFactory,
113 OUString const & rName,
114 OUString const & rArguments,
115 OUString const & rTemplate,
116 ContentProviderRegistrationInfo * pInfo)
117 throw (com::sun::star::uno::RuntimeException);
120 #endif // _UCBHELPER_REGISTERUCB_HXX_
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */