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 #pragma once
21 
22 #include <osl/mutex.hxx>
23 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
24 #include <com/sun/star/lang/XTypeProvider.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
27 #include <com/sun/star/ucb/XContentProviderFactory.hpp>
28 #include <com/sun/star/ucb/XContentProvider.hpp>
29 #include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
30 #include <com/sun/star/ucb/XContentProviderSupplier.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <cppuhelper/compbase.hxx>
33 #include <cppuhelper/weak.hxx>
34 #include <cppuhelper/basemutex.hxx>
35 
36 
37 
38 using UcbContentProviderProxyFactory_Base = cppu::WeakComponentImplHelper <
39  css::lang::XServiceInfo,
40  css::ucb::XContentProviderFactory >;
42 {
43  css::uno::Reference< css::uno::XComponentContext > m_xContext;
44 
45 public:
47  const css::uno::Reference< css::uno::XComponentContext >& rxContext );
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  // XContentProviderFactory
56  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
57  createContentProvider( const OUString& Service ) override;
58 };
59 
60 
61 
62 
64  public cppu::OWeakObject,
65  public css::lang::XTypeProvider,
66  public css::lang::XServiceInfo,
67  public css::ucb::XContentProviderSupplier,
68  public css::ucb::XContentProvider,
69  public css::ucb::XParameterizedContentProvider
70 {
71  ::osl::Mutex m_aMutex;
72  OUString m_aService;
73  OUString m_aTemplate;
74  OUString m_aArguments;
75  bool m_bReplace;
77 
78  css::uno::Reference< css::uno::XComponentContext >
80  css::uno::Reference< css::ucb::XContentProvider >
82  css::uno::Reference< css::ucb::XContentProvider >
84 
85 public:
87  const css::uno::Reference< css::uno::XComponentContext >& rxContext,
88  const OUString& Service );
89  virtual ~UcbContentProviderProxy() override;
90 
91  // XInterface
92  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
93  virtual void SAL_CALL acquire()
94  throw() override;
95  virtual void SAL_CALL release()
96  throw() override;
97 
98  // XTypeProvider
99  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
100  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
101 
102  // XServiceInfo
103  virtual OUString SAL_CALL getImplementationName() override;
104  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
105  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
106 
107  // XContentProviderSupplier
108  virtual css::uno::Reference<
109  css::ucb::XContentProvider > SAL_CALL
110  getContentProvider() override;
111 
112  // XContentProvider
113  virtual css::uno::Reference<
114  css::ucb::XContent > SAL_CALL
115  queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override;
116  virtual sal_Int32 SAL_CALL
117  compareContentIds( const css::uno::Reference< css::ucb::XContentIdentifier >& Id1,
118  const css::uno::Reference< css::ucb::XContentIdentifier >& Id2 ) override;
119 
120  // XParameterizedContentProvider
121  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
122  registerInstance( const OUString& Template,
123  const OUString& Arguments,
124  sal_Bool ReplaceExisting ) override;
125  virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL
126  deregisterInstance( const OUString& Template,
127  const OUString& Arguments ) override;
128 };
129 
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
css::uno::Reference< css::ucb::XContentProvider > m_xProvider
Definition: provprox.hxx:81
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL getContentProvider() override
Definition: provprox.cxx:298
signed char sal_Int8
UcbContentProviderProxyFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Definition: provprox.cxx:38
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: provprox.cxx:60
virtual OUString SAL_CALL getImplementationName() override
Definition: provprox.cxx:52
css::uno::Reference< css::ucb::XContentProvider > m_xTargetProvider
Definition: provprox.hxx:83
virtual ~UcbContentProviderProxy() override
Definition: provprox.cxx:105
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: provprox.cxx:125
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL registerInstance(const OUString &Template, const OUString &Arguments, sal_Bool ReplaceExisting) override
Definition: provprox.cxx:239
::osl::Mutex m_aMutex
Definition: provprox.hxx:71
virtual ~UcbContentProviderProxyFactory() override
Definition: provprox.cxx:46
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: provprox.cxx:156
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: provprox.hxx:43
unsigned char sal_Bool
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL createContentProvider(const OUString &Service) override
Definition: provprox.cxx:82
virtual void SAL_CALL acquire() override
Definition: provprox.cxx:111
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL deregisterInstance(const OUString &Template, const OUString &Arguments) override
Definition: provprox.cxx:262
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
Definition: provprox.cxx:200
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:216
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: provprox.hxx:79
cppu::WeakComponentImplHelper< css::lang::XServiceInfo, css::ucb::XContentProviderFactory > UcbContentProviderProxyFactory_Base
Definition: provprox.hxx:40
virtual OUString SAL_CALL getImplementationName() override
Definition: provprox.cxx:180
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: provprox.cxx:185
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: provprox.cxx:56
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: provprox.cxx:190
virtual void SAL_CALL release() override
Definition: provprox.cxx:117
UcbContentProviderProxy(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &Service)
Definition: provprox.cxx:93