LibreOffice Module ucb (master)  1
provprox.hxx
Go to the documentation of this file.
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_UCB_SOURCE_CORE_PROVPROX_HXX
21 #define INCLUDED_UCB_SOURCE_CORE_PROVPROX_HXX
22 
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>
34 
35 
36 
37 
38 class UcbContentProviderProxyFactory : public cppu::WeakImplHelper <
39  css::lang::XServiceInfo,
40  css::ucb::XContentProviderFactory >
41 {
42  css::uno::Reference< css::lang::XMultiServiceFactory >
44 
45 public:
47  const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSMgr );
48  virtual ~UcbContentProviderProxyFactory() override;
49 
50  // XServiceInfo
51  virtual OUString SAL_CALL getImplementationName() override;
52  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
53  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
54 
55  static OUString getImplementationName_Static();
56  static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
57 
58  static css::uno::Reference< css::lang::XSingleServiceFactory >
59  createServiceFactory( const css::uno::Reference<
60  css::lang::XMultiServiceFactory >& rxServiceMgr );
61 
62  // XContentProviderFactory
63  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
64  createContentProvider( const OUString& Service ) override;
65 };
66 
67 
68 
69 
71  public cppu::OWeakObject,
72  public css::lang::XTypeProvider,
73  public css::lang::XServiceInfo,
74  public css::ucb::XContentProviderSupplier,
75  public css::ucb::XContentProvider,
76  public css::ucb::XParameterizedContentProvider
77 {
78  ::osl::Mutex m_aMutex;
79  OUString m_aService;
80  OUString m_aTemplate;
81  OUString m_aArguments;
82  bool m_bReplace;
84 
85  css::uno::Reference< css::lang::XMultiServiceFactory >
87  css::uno::Reference< css::ucb::XContentProvider >
89  css::uno::Reference< css::ucb::XContentProvider >
91 
92 public:
94  const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSMgr,
95  const OUString& Service );
96  virtual ~UcbContentProviderProxy() override;
97 
98  // XInterface
99  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
100  virtual void SAL_CALL acquire()
101  throw() override;
102  virtual void SAL_CALL release()
103  throw() override;
104 
105  // XTypeProvider
106  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
107  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
108 
109  // XServiceInfo
110  virtual OUString SAL_CALL getImplementationName() override;
111  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
112  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
113 
114  // XContentProviderSupplier
115  virtual css::uno::Reference<
116  css::ucb::XContentProvider > SAL_CALL
117  getContentProvider() override;
118 
119  // XContentProvider
120  virtual css::uno::Reference<
121  css::ucb::XContent > SAL_CALL
122  queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override;
123  virtual sal_Int32 SAL_CALL
124  compareContentIds( const css::uno::Reference< css::ucb::XContentIdentifier >& Id1,
125  const css::uno::Reference< css::ucb::XContentIdentifier >& Id2 ) override;
126 
127  // XParameterizedContentProvider
128  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
129  registerInstance( const OUString& Template,
130  const OUString& Arguments,
131  sal_Bool ReplaceExisting ) override;
132  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
133  deregisterInstance( const OUString& Template,
134  const OUString& Arguments ) override;
135 };
136 
137 #endif // INCLUDED_UCB_SOURCE_CORE_PROVPROX_HXX
138 
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static OUString getImplementationName_Static()
css::uno::Reference< css::ucb::XContentProvider > m_xProvider
Definition: provprox.hxx:88
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL getContentProvider() override
Definition: provprox.cxx:301
virtual OUString SAL_CALL getImplementationName() override
signed char sal_Int8
UcbContentProviderProxy(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxSMgr, const OUString &Service)
Definition: provprox.cxx:96
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
css::uno::Reference< css::ucb::XContentProvider > m_xTargetProvider
Definition: provprox.hxx:90
static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxServiceMgr)
Definition: provprox.cxx:70
virtual ~UcbContentProviderProxy() override
Definition: provprox.cxx:108
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: provprox.cxx:128
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL registerInstance(const OUString &Template, const OUString &Arguments, sal_Bool ReplaceExisting) override
Definition: provprox.cxx:242
::osl::Mutex m_aMutex
Definition: provprox.hxx:78
virtual ~UcbContentProviderProxyFactory() override
Definition: provprox.cxx:46
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: provprox.cxx:159
unsigned char sal_Bool
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMgr
Definition: provprox.hxx:86
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL createContentProvider(const OUString &Service) override
Definition: provprox.cxx:85
virtual void SAL_CALL acquire() override
Definition: provprox.cxx:114
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL deregisterInstance(const OUString &Template, const OUString &Arguments) override
Definition: provprox.cxx:265
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
Definition: provprox.cxx:61
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
Definition: provprox.cxx:203
virtual sal_Int32 SAL_CALL compareContentIds(const css::uno::Reference< css::ucb::XContentIdentifier > &Id1, const css::uno::Reference< css::ucb::XContentIdentifier > &Id2) override
Definition: provprox.cxx:219
virtual OUString SAL_CALL getImplementationName() override
Definition: provprox.cxx:183
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: provprox.cxx:188
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMgr
Definition: provprox.hxx:43
UcbContentProviderProxyFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxSMgr)
Definition: provprox.cxx:38
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: provprox.cxx:193
virtual void SAL_CALL release() override
Definition: provprox.cxx:120