1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/lang/XTypeProvider.hpp>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/ucb/XContentProviderFactory.hpp>
25 #include <com/sun/star/ucb/XContentProvider.hpp>
26 #include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
27 #include <com/sun/star/ucb/XContentProviderSupplier.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <comphelper/compbase.hxx>
30 #include <cppuhelper/weak.hxx>
34 using UcbContentProviderProxyFactory_Base
= comphelper::WeakComponentImplHelper
<
35 css::lang::XServiceInfo
,
36 css::ucb::XContentProviderFactory
>;
37 class UcbContentProviderProxyFactory
: public UcbContentProviderProxyFactory_Base
39 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
42 explicit UcbContentProviderProxyFactory(
43 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
44 virtual ~UcbContentProviderProxyFactory() override
;
47 virtual OUString SAL_CALL
getImplementationName() override
;
48 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
49 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
51 // XContentProviderFactory
52 virtual css::uno::Reference
< css::ucb::XContentProvider
> SAL_CALL
53 createContentProvider( const OUString
& Service
) override
;
58 using UcbContentProviderProxy_BASE
= comphelper::WeakImplHelper
<css::lang::XServiceInfo
,
59 css::ucb::XContentProviderSupplier
,
60 css::ucb::XContentProvider
,
61 css::ucb::XParameterizedContentProvider
>;
62 class UcbContentProviderProxy
: public UcbContentProviderProxy_BASE
66 OUString m_aArguments
;
70 css::uno::Reference
< css::uno::XComponentContext
>
72 css::uno::Reference
< css::ucb::XContentProvider
>
74 css::uno::Reference
< css::ucb::XContentProvider
>
78 UcbContentProviderProxy(
79 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
81 virtual ~UcbContentProviderProxy() override
;
84 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
87 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
90 virtual OUString SAL_CALL
getImplementationName() override
;
91 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
92 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
94 // XContentProviderSupplier
95 virtual css::uno::Reference
<
96 css::ucb::XContentProvider
> SAL_CALL
97 getContentProvider() override
;
100 virtual css::uno::Reference
<
101 css::ucb::XContent
> SAL_CALL
102 queryContent( const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
) override
;
103 virtual sal_Int32 SAL_CALL
104 compareContentIds( const css::uno::Reference
< css::ucb::XContentIdentifier
>& Id1
,
105 const css::uno::Reference
< css::ucb::XContentIdentifier
>& Id2
) override
;
107 // XParameterizedContentProvider
108 virtual css::uno::Reference
< css::ucb::XContentProvider
> SAL_CALL
109 registerInstance( const OUString
& Template
,
110 const OUString
& Arguments
,
111 sal_Bool ReplaceExisting
) override
;
112 virtual css::uno::Reference
< css::ucb::XContentProvider
> SAL_CALL
113 deregisterInstance( const OUString
& Template
,
114 const OUString
& Arguments
) override
;
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */