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
;
59 class UcbContentProviderProxy
:
60 public cppu::OWeakObject
,
61 public css::lang::XTypeProvider
,
62 public css::lang::XServiceInfo
,
63 public css::ucb::XContentProviderSupplier
,
64 public css::ucb::XContentProvider
,
65 public css::ucb::XParameterizedContentProvider
70 OUString m_aArguments
;
74 css::uno::Reference
< css::uno::XComponentContext
>
76 css::uno::Reference
< css::ucb::XContentProvider
>
78 css::uno::Reference
< css::ucb::XContentProvider
>
82 UcbContentProviderProxy(
83 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
85 virtual ~UcbContentProviderProxy() override
;
88 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
89 virtual void SAL_CALL
acquire()
91 virtual void SAL_CALL
release()
95 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
96 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
99 virtual OUString SAL_CALL
getImplementationName() override
;
100 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
101 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
103 // XContentProviderSupplier
104 virtual css::uno::Reference
<
105 css::ucb::XContentProvider
> SAL_CALL
106 getContentProvider() override
;
109 virtual css::uno::Reference
<
110 css::ucb::XContent
> SAL_CALL
111 queryContent( const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
) override
;
112 virtual sal_Int32 SAL_CALL
113 compareContentIds( const css::uno::Reference
< css::ucb::XContentIdentifier
>& Id1
,
114 const css::uno::Reference
< css::ucb::XContentIdentifier
>& Id2
) override
;
116 // XParameterizedContentProvider
117 virtual css::uno::Reference
< css::ucb::XContentProvider
> SAL_CALL
118 registerInstance( const OUString
& Template
,
119 const OUString
& Arguments
,
120 sal_Bool ReplaceExisting
) override
;
121 virtual css::uno::Reference
< css::ucb::XContentProvider
> SAL_CALL
122 deregisterInstance( const OUString
& Template
,
123 const OUString
& Arguments
) override
;
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */