Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / ucb / source / core / provprox.hxx
blob574e13288cd08abd0dd2845bca1fd3d9a3860ede
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 INCLUDED_UCB_SOURCE_CORE_PROVPROX_HXX
21 #define INCLUDED_UCB_SOURCE_CORE_PROVPROX_HXX
23 #include <osl/mutex.hxx>
24 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <com/sun/star/lang/XTypeProvider.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
28 #include <com/sun/star/ucb/XContentProviderFactory.hpp>
29 #include <com/sun/star/ucb/XContentProvider.hpp>
30 #include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
31 #include <com/sun/star/ucb/XContentProviderSupplier.hpp>
32 #include <cppuhelper/weak.hxx>
33 #include <cppuhelper/implbase.hxx>
36 // class UcbContentProviderProxyFactory.
39 class UcbContentProviderProxyFactory : public cppu::WeakImplHelper <
40 css::lang::XServiceInfo,
41 css::ucb::XContentProviderFactory >
43 css::uno::Reference< css::lang::XMultiServiceFactory >
44 m_xSMgr;
46 public:
47 explicit UcbContentProviderProxyFactory(
48 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSMgr );
49 virtual ~UcbContentProviderProxyFactory() override;
51 // XServiceInfo
52 virtual OUString SAL_CALL getImplementationName() override;
53 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
54 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
56 static OUString getImplementationName_Static();
57 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
59 static css::uno::Reference< css::lang::XSingleServiceFactory >
60 createServiceFactory( const css::uno::Reference<
61 css::lang::XMultiServiceFactory >& rxServiceMgr );
63 // XContentProviderFactory
64 virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
65 createContentProvider( const OUString& Service ) override;
69 // class UcbContentProviderProxy.
72 class UcbContentProviderProxy :
73 public cppu::OWeakObject,
74 public css::lang::XTypeProvider,
75 public css::lang::XServiceInfo,
76 public css::ucb::XContentProviderSupplier,
77 public css::ucb::XContentProvider,
78 public css::ucb::XParameterizedContentProvider
80 ::osl::Mutex m_aMutex;
81 OUString m_aService;
82 OUString m_aTemplate;
83 OUString m_aArguments;
84 bool m_bReplace;
85 bool m_bRegister;
87 css::uno::Reference< css::lang::XMultiServiceFactory >
88 m_xSMgr;
89 css::uno::Reference< css::ucb::XContentProvider >
90 m_xProvider;
91 css::uno::Reference< css::ucb::XContentProvider >
92 m_xTargetProvider;
94 public:
95 UcbContentProviderProxy(
96 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSMgr,
97 const OUString& Service );
98 virtual ~UcbContentProviderProxy() override;
100 // XInterface
101 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
102 virtual void SAL_CALL acquire()
103 throw() override;
104 virtual void SAL_CALL release()
105 throw() override;
107 // XTypeProvider
108 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
109 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
111 // XServiceInfo
112 virtual OUString SAL_CALL getImplementationName() override;
113 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
114 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
116 // XContentProviderSupplier
117 virtual css::uno::Reference<
118 css::ucb::XContentProvider > SAL_CALL
119 getContentProvider() override;
121 // XContentProvider
122 virtual css::uno::Reference<
123 css::ucb::XContent > SAL_CALL
124 queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override;
125 virtual sal_Int32 SAL_CALL
126 compareContentIds( const css::uno::Reference< css::ucb::XContentIdentifier >& Id1,
127 const css::uno::Reference< css::ucb::XContentIdentifier >& Id2 ) override;
129 // XParameterizedContentProvider
130 virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
131 registerInstance( const OUString& Template,
132 const OUString& Arguments,
133 sal_Bool ReplaceExisting ) override;
134 virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
135 deregisterInstance( const OUString& Template,
136 const OUString& Arguments ) override;
139 #endif // INCLUDED_UCB_SOURCE_CORE_PROVPROX_HXX
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */