Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / file / prov.hxx
blob5f24ab8b392153340e4710324544374b8bd7b6cf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _PROV_HXX_
30 #define _PROV_HXX_
32 #include <cppuhelper/weak.hxx>
34 #include "osl/mutex.hxx"
35 #include <ucbhelper/macros.hxx>
36 #include <com/sun/star/uno/XInterface.hpp>
37 #include <com/sun/star/lang/XTypeProvider.hpp>
38 #include <com/sun/star/lang/XInitialization.hpp>
39 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
40 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/ucb/XContentProvider.hpp>
43 #include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
44 #include <com/sun/star/beans/XPropertySet.hpp>
45 #include <com/sun/star/ucb/XFileIdentifierConverter.hpp>
46 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
48 // FileProvider
52 namespace fileaccess {
54 // Forward declaration
56 class BaseContent;
57 class shell;
59 class FileProvider:
60 public cppu::OWeakObject,
61 public com::sun::star::lang::XServiceInfo,
62 public com::sun::star::lang::XInitialization,
63 public com::sun::star::lang::XTypeProvider,
64 public com::sun::star::ucb::XContentProvider,
65 public com::sun::star::ucb::XContentIdentifierFactory,
66 public com::sun::star::beans::XPropertySet,
67 public com::sun::star::ucb::XFileIdentifierConverter
69 friend class BaseContent;
70 public:
72 FileProvider( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF );
73 ~FileProvider();
75 // XInterface
76 virtual com::sun::star::uno::Any SAL_CALL
77 queryInterface(
78 const com::sun::star::uno::Type& aType )
79 throw( com::sun::star::uno::RuntimeException);
81 virtual void SAL_CALL
82 acquire(
83 void )
84 throw();
86 virtual void SAL_CALL
87 release(
88 void )
89 throw();
91 // XServiceInfo
92 virtual rtl::OUString SAL_CALL
93 getImplementationName(
94 void )
95 throw( com::sun::star::uno::RuntimeException );
97 virtual sal_Bool SAL_CALL
98 supportsService(
99 const rtl::OUString& ServiceName )
100 throw(com::sun::star::uno::RuntimeException );
102 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
103 getSupportedServiceNames(
104 void )
105 throw( com::sun::star::uno::RuntimeException );
108 static com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > SAL_CALL
109 createServiceFactory(
110 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr );
112 static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
113 CreateInstance(
114 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMultiServiceFactory );
116 // XTypeProvider
118 XTYPEPROVIDER_DECL()
120 // XInitialization
121 virtual void SAL_CALL
122 initialize(
123 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
124 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
127 // XContentProvider
128 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > SAL_CALL
129 queryContent(
130 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier )
131 throw( com::sun::star::ucb::IllegalIdentifierException,
132 com::sun::star::uno::RuntimeException );
134 // XContentIdentifierFactory
136 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > SAL_CALL
137 createContentIdentifier(
138 const rtl::OUString& ContentId )
139 throw( com::sun::star::uno::RuntimeException );
142 virtual sal_Int32 SAL_CALL
143 compareContentIds(
144 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id1,
145 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id2 )
146 throw( com::sun::star::uno::RuntimeException );
148 // XProperySet
150 virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL
151 getPropertySetInfo( )
152 throw( com::sun::star::uno::RuntimeException );
154 virtual void SAL_CALL
155 setPropertyValue(
156 const rtl::OUString& aPropertyName,
157 const com::sun::star::uno::Any& aValue )
158 throw( com::sun::star::beans::UnknownPropertyException,
159 com::sun::star::beans::PropertyVetoException,
160 com::sun::star::lang::IllegalArgumentException,
161 com::sun::star::lang::WrappedTargetException,
162 com::sun::star::uno::RuntimeException );
164 virtual com::sun::star::uno::Any SAL_CALL
165 getPropertyValue(
166 const rtl::OUString& PropertyName )
167 throw( com::sun::star::beans::UnknownPropertyException,
168 com::sun::star::lang::WrappedTargetException,
169 com::sun::star::uno::RuntimeException );
171 virtual void SAL_CALL
172 addPropertyChangeListener(
173 const rtl::OUString& aPropertyName,
174 const com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >& xListener )
175 throw( com::sun::star::beans::UnknownPropertyException,
176 com::sun::star::lang::WrappedTargetException,
177 com::sun::star::uno::RuntimeException);
179 virtual void SAL_CALL
180 removePropertyChangeListener(
181 const rtl::OUString& aPropertyName,
182 const com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >& aListener )
183 throw( com::sun::star::beans::UnknownPropertyException,
184 com::sun::star::lang::WrappedTargetException,
185 com::sun::star::uno::RuntimeException );
187 virtual void SAL_CALL
188 addVetoableChangeListener(
189 const rtl::OUString& PropertyName,
190 const com::sun::star::uno::Reference< com::sun::star::beans::XVetoableChangeListener >& aListener )
191 throw( com::sun::star::beans::UnknownPropertyException,
192 com::sun::star::lang::WrappedTargetException,
193 com::sun::star::uno::RuntimeException );
195 virtual void SAL_CALL
196 removeVetoableChangeListener(
197 const rtl::OUString& PropertyName,
198 const com::sun::star::uno::Reference< com::sun::star::beans::XVetoableChangeListener >& aListener )
199 throw( com::sun::star::beans::UnknownPropertyException,
200 com::sun::star::lang::WrappedTargetException,
201 com::sun::star::uno::RuntimeException);
204 // XFileIdentifierConverter
206 virtual sal_Int32 SAL_CALL
207 getFileProviderLocality( const rtl::OUString& BaseURL )
208 throw( com::sun::star::uno::RuntimeException );
210 virtual rtl::OUString SAL_CALL getFileURLFromSystemPath( const rtl::OUString& BaseURL,
211 const rtl::OUString& SystemPath )
212 throw( com::sun::star::uno::RuntimeException );
214 virtual rtl::OUString SAL_CALL getSystemPathFromFileURL( const rtl::OUString& URL )
215 throw( com::sun::star::uno::RuntimeException );
218 private:
219 // methods
220 void SAL_CALL init();
222 // Members
223 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory;
225 void SAL_CALL initProperties( void );
226 osl::Mutex m_aMutex;
227 rtl::OUString m_HostName;
228 rtl::OUString m_HomeDirectory;
229 sal_Int32 m_FileSystemNotation;
231 com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > m_xPropertySetInfo;
233 shell* m_pMyShell;
236 } // end namespace fileaccess
238 #endif
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */