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 .
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/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 <cppuhelper/weak.hxx>
32 #include <ucbhelper/macros.hxx>
34 //=========================================================================
36 #define PROVIDER_FACTORY_SERVICE_NAME \
37 "com.sun.star.ucb.ContentProviderProxyFactory"
38 #define PROVIDER_PROXY_SERVICE_NAME \
39 "com.sun.star.ucb.ContentProviderProxy"
41 //============================================================================
43 // class UcbContentProviderProxyFactory.
45 //============================================================================
47 class UcbContentProviderProxyFactory
:
48 public cppu::OWeakObject
,
49 public com::sun::star::lang::XTypeProvider
,
50 public com::sun::star::lang::XServiceInfo
,
51 public com::sun::star::ucb::XContentProviderFactory
53 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>
57 UcbContentProviderProxyFactory(
58 const com::sun::star::uno::Reference
<
59 com::sun::star::lang::XMultiServiceFactory
>& rxSMgr
);
60 virtual ~UcbContentProviderProxyFactory();
71 // XContentProviderFactory
72 virtual ::com::sun::star::uno::Reference
<
73 ::com::sun::star::ucb::XContentProvider
> SAL_CALL
74 createContentProvider( const OUString
& Service
)
75 throw( ::com::sun::star::uno::RuntimeException
);
78 //============================================================================
80 // class UcbContentProviderProxy.
82 //============================================================================
84 class UcbContentProviderProxy
:
85 public cppu::OWeakObject
,
86 public com::sun::star::lang::XTypeProvider
,
87 public com::sun::star::lang::XServiceInfo
,
88 public com::sun::star::ucb::XContentProviderSupplier
,
89 public com::sun::star::ucb::XContentProvider
,
90 public com::sun::star::ucb::XParameterizedContentProvider
92 ::osl::Mutex m_aMutex
;
95 OUString m_aArguments
;
99 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>
101 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentProvider
>
103 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentProvider
>
107 UcbContentProviderProxy(
108 const com::sun::star::uno::Reference
<
109 com::sun::star::lang::XMultiServiceFactory
>& rxSMgr
,
110 const OUString
& Service
);
111 virtual ~UcbContentProviderProxy();
120 XSERVICEINFO_NOFACTORY_DECL()
122 // XContentProviderSupplier
123 virtual ::com::sun::star::uno::Reference
<
124 ::com::sun::star::ucb::XContentProvider
> SAL_CALL
126 throw( ::com::sun::star::uno::RuntimeException
);
129 virtual ::com::sun::star::uno::Reference
<
130 ::com::sun::star::ucb::XContent
> SAL_CALL
131 queryContent( const ::com::sun::star::uno::Reference
<
132 ::com::sun::star::ucb::XContentIdentifier
>& Identifier
)
133 throw( ::com::sun::star::ucb::IllegalIdentifierException
,
134 ::com::sun::star::uno::RuntimeException
);
135 virtual sal_Int32 SAL_CALL
136 compareContentIds( const ::com::sun::star::uno::Reference
<
137 ::com::sun::star::ucb::XContentIdentifier
>& Id1
,
138 const ::com::sun::star::uno::Reference
<
139 ::com::sun::star::ucb::XContentIdentifier
>& Id2
)
140 throw( ::com::sun::star::uno::RuntimeException
);
142 // XParameterizedContentProvider
143 virtual ::com::sun::star::uno::Reference
<
144 ::com::sun::star::ucb::XContentProvider
> SAL_CALL
145 registerInstance( const OUString
& Template
,
146 const OUString
& Arguments
,
147 sal_Bool ReplaceExisting
)
148 throw( ::com::sun::star::lang::IllegalArgumentException
,
149 ::com::sun::star::uno::RuntimeException
);
150 virtual ::com::sun::star::uno::Reference
<
151 ::com::sun::star::ucb::XContentProvider
> SAL_CALL
152 deregisterInstance( const OUString
& Template
,
153 const OUString
& Arguments
)
154 throw( ::com::sun::star::lang::IllegalArgumentException
,
155 ::com::sun::star::uno::RuntimeException
);
158 #endif /* !_PROVPROX_HXX */
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */