Update ooo320-m1
[ooovba.git] / ucb / source / ucp / file / prov.hxx
blob05956fda040c6310ad4e1136f31e358e3e3d813b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: prov.hxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PROV_HXX_
32 #define _PROV_HXX_
34 #include <cppuhelper/weak.hxx>
36 #include "osl/mutex.hxx"
37 #include <ucbhelper/macros.hxx>
38 #include <com/sun/star/uno/XInterface.hpp>
39 #include <com/sun/star/lang/XTypeProvider.hpp>
40 #include <com/sun/star/lang/XInitialization.hpp>
41 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
42 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/ucb/XContentProvider.hpp>
45 #include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
46 #include <com/sun/star/beans/XPropertySet.hpp>
47 #include <com/sun/star/ucb/XFileIdentifierConverter.hpp>
48 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
50 // FileProvider
54 namespace fileaccess {
56 // Forward declaration
58 class BaseContent;
59 class shell;
61 class FileProvider:
62 public cppu::OWeakObject,
63 public com::sun::star::lang::XServiceInfo,
64 public com::sun::star::lang::XInitialization,
65 public com::sun::star::lang::XTypeProvider,
66 public com::sun::star::ucb::XContentProvider,
67 public com::sun::star::ucb::XContentIdentifierFactory,
68 public com::sun::star::beans::XPropertySet,
69 public com::sun::star::ucb::XFileIdentifierConverter
71 friend class BaseContent;
72 public:
74 FileProvider( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF );
75 ~FileProvider();
77 // XInterface
78 virtual com::sun::star::uno::Any SAL_CALL
79 queryInterface(
80 const com::sun::star::uno::Type& aType )
81 throw( com::sun::star::uno::RuntimeException);
83 virtual void SAL_CALL
84 acquire(
85 void )
86 throw();
88 virtual void SAL_CALL
89 release(
90 void )
91 throw();
93 // XServiceInfo
94 virtual rtl::OUString SAL_CALL
95 getImplementationName(
96 void )
97 throw( com::sun::star::uno::RuntimeException );
99 virtual sal_Bool SAL_CALL
100 supportsService(
101 const rtl::OUString& ServiceName )
102 throw(com::sun::star::uno::RuntimeException );
104 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
105 getSupportedServiceNames(
106 void )
107 throw( com::sun::star::uno::RuntimeException );
110 static com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > SAL_CALL
111 createServiceFactory(
112 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr );
114 static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
115 CreateInstance(
116 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMultiServiceFactory );
118 // XTypeProvider
120 XTYPEPROVIDER_DECL()
122 // XInitialization
123 virtual void SAL_CALL
124 initialize(
125 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
126 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
129 // XContentProvider
130 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > SAL_CALL
131 queryContent(
132 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier )
133 throw( com::sun::star::ucb::IllegalIdentifierException,
134 com::sun::star::uno::RuntimeException );
136 // XContentIdentifierFactory
138 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > SAL_CALL
139 createContentIdentifier(
140 const rtl::OUString& ContentId )
141 throw( com::sun::star::uno::RuntimeException );
144 virtual sal_Int32 SAL_CALL
145 compareContentIds(
146 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id1,
147 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id2 )
148 throw( com::sun::star::uno::RuntimeException );
150 // XProperySet
152 virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL
153 getPropertySetInfo( )
154 throw( com::sun::star::uno::RuntimeException );
156 virtual void SAL_CALL
157 setPropertyValue(
158 const rtl::OUString& aPropertyName,
159 const com::sun::star::uno::Any& aValue )
160 throw( com::sun::star::beans::UnknownPropertyException,
161 com::sun::star::beans::PropertyVetoException,
162 com::sun::star::lang::IllegalArgumentException,
163 com::sun::star::lang::WrappedTargetException,
164 com::sun::star::uno::RuntimeException );
166 virtual com::sun::star::uno::Any SAL_CALL
167 getPropertyValue(
168 const rtl::OUString& PropertyName )
169 throw( com::sun::star::beans::UnknownPropertyException,
170 com::sun::star::lang::WrappedTargetException,
171 com::sun::star::uno::RuntimeException );
173 virtual void SAL_CALL
174 addPropertyChangeListener(
175 const rtl::OUString& aPropertyName,
176 const com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >& xListener )
177 throw( com::sun::star::beans::UnknownPropertyException,
178 com::sun::star::lang::WrappedTargetException,
179 com::sun::star::uno::RuntimeException);
181 virtual void SAL_CALL
182 removePropertyChangeListener(
183 const rtl::OUString& aPropertyName,
184 const com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >& aListener )
185 throw( com::sun::star::beans::UnknownPropertyException,
186 com::sun::star::lang::WrappedTargetException,
187 com::sun::star::uno::RuntimeException );
189 virtual void SAL_CALL
190 addVetoableChangeListener(
191 const rtl::OUString& PropertyName,
192 const com::sun::star::uno::Reference< com::sun::star::beans::XVetoableChangeListener >& aListener )
193 throw( com::sun::star::beans::UnknownPropertyException,
194 com::sun::star::lang::WrappedTargetException,
195 com::sun::star::uno::RuntimeException );
197 virtual void SAL_CALL
198 removeVetoableChangeListener(
199 const rtl::OUString& PropertyName,
200 const com::sun::star::uno::Reference< com::sun::star::beans::XVetoableChangeListener >& aListener )
201 throw( com::sun::star::beans::UnknownPropertyException,
202 com::sun::star::lang::WrappedTargetException,
203 com::sun::star::uno::RuntimeException);
206 // XFileIdentifierConverter
208 virtual sal_Int32 SAL_CALL
209 getFileProviderLocality( const rtl::OUString& BaseURL )
210 throw( com::sun::star::uno::RuntimeException );
212 virtual rtl::OUString SAL_CALL getFileURLFromSystemPath( const rtl::OUString& BaseURL,
213 const rtl::OUString& SystemPath )
214 throw( com::sun::star::uno::RuntimeException );
216 virtual rtl::OUString SAL_CALL getSystemPathFromFileURL( const rtl::OUString& URL )
217 throw( com::sun::star::uno::RuntimeException );
220 private:
221 // methods
222 void SAL_CALL init();
224 // Members
225 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory;
227 void SAL_CALL initProperties( void );
228 osl::Mutex m_aMutex;
229 rtl::OUString m_HostName;
230 rtl::OUString m_HomeDirectory;
231 sal_Int32 m_FileSystemNotation;
233 com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > m_xPropertySetInfo;
235 shell* m_pMyShell;
238 } // end namespace fileaccess
240 #endif