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 // class UcbContentProviderProxyFactory.
37 
38 
39 class UcbContentProviderProxyFactory : public cppu::WeakImplHelper <
40  css::lang::XServiceInfo,
41  css::ucb::XContentProviderFactory >
42 {
43  css::uno::Reference< css::lang::XMultiServiceFactory >
45 
46 public:
48  const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSMgr );
49  virtual ~UcbContentProviderProxyFactory() override;
50 
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;
55 
56  static OUString getImplementationName_Static();
57  static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
58 
59  static css::uno::Reference< css::lang::XSingleServiceFactory >
60  createServiceFactory( const css::uno::Reference<
61  css::lang::XMultiServiceFactory >& rxServiceMgr );
62 
63  // XContentProviderFactory
64  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
65  createContentProvider( const OUString& Service ) override;
66 };
67 
68 
69 // class UcbContentProviderProxy.
70 
71 
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
79 {
80  ::osl::Mutex m_aMutex;
81  OUString m_aService;
82  OUString m_aTemplate;
83  OUString m_aArguments;
84  bool m_bReplace;
86 
87  css::uno::Reference< css::lang::XMultiServiceFactory >
89  css::uno::Reference< css::ucb::XContentProvider >
91  css::uno::Reference< css::ucb::XContentProvider >
93 
94 public:
96  const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSMgr,
97  const OUString& Service );
98  virtual ~UcbContentProviderProxy() override;
99 
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;
106 
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;
110 
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;
115 
116  // XContentProviderSupplier
117  virtual css::uno::Reference<
118  css::ucb::XContentProvider > SAL_CALL
119  getContentProvider() override;
120 
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;
128 
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;
137 };
138 
139 #endif // INCLUDED_UCB_SOURCE_CORE_PROVPROX_HXX
140 
141 /* 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:90
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL getContentProvider() override
Definition: provprox.cxx:293
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:88
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
css::uno::Reference< css::ucb::XContentProvider > m_xTargetProvider
Definition: provprox.hxx:92
virtual ~UcbContentProviderProxy() override
Definition: provprox.cxx:100
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: provprox.cxx:120
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL registerInstance(const OUString &Template, const OUString &Arguments, sal_Bool ReplaceExisting) override
Definition: provprox.cxx:234
static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxServiceMgr)
::osl::Mutex m_aMutex
Definition: provprox.hxx:80
virtual ~UcbContentProviderProxyFactory() override
Definition: provprox.cxx:46
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: provprox.cxx:151
unsigned char sal_Bool
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMgr
Definition: provprox.hxx:88
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL createContentProvider(const OUString &Service) override
Definition: provprox.cxx:77
virtual void SAL_CALL acquire() override
Definition: provprox.cxx:106
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL deregisterInstance(const OUString &Template, const OUString &Arguments) override
Definition: provprox.cxx:257
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:195
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:211
virtual OUString SAL_CALL getImplementationName() override
Definition: provprox.cxx:175
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: provprox.cxx:180
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMgr
Definition: provprox.hxx:44
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:185
virtual void SAL_CALL release() override
Definition: provprox.cxx:112