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 ************************************************************************/
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>
52 namespace fileaccess
{
54 // Forward declaration
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
;
72 FileProvider( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& xMSF
);
76 virtual com::sun::star::uno::Any SAL_CALL
78 const com::sun::star::uno::Type
& aType
)
79 throw( com::sun::star::uno::RuntimeException
);
92 virtual rtl::OUString SAL_CALL
93 getImplementationName(
95 throw( com::sun::star::uno::RuntimeException
);
97 virtual sal_Bool SAL_CALL
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(
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
114 const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& xMultiServiceFactory
);
121 virtual void SAL_CALL
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
);
128 virtual com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> SAL_CALL
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
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
);
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
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
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
);
220 void SAL_CALL
init();
223 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> m_xMultiServiceFactory
;
225 void SAL_CALL
initProperties( void );
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
;
236 } // end namespace fileaccess
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */