16df1ea1fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 36df1ea1fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 46df1ea1fSAndrew Rist * or more contributor license agreements. See the NOTICE file 56df1ea1fSAndrew Rist * distributed with this work for additional information 66df1ea1fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 76df1ea1fSAndrew Rist * to you under the Apache License, Version 2.0 (the 86df1ea1fSAndrew Rist * "License"); you may not use this file except in compliance 96df1ea1fSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 116df1ea1fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 136df1ea1fSAndrew Rist * Unless required by applicable law or agreed to in writing, 146df1ea1fSAndrew Rist * software distributed under the License is distributed on an 156df1ea1fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 166df1ea1fSAndrew Rist * KIND, either express or implied. See the License for the 176df1ea1fSAndrew Rist * specific language governing permissions and limitations 186df1ea1fSAndrew Rist * under the License. 19cdf0e10cSrcweir * 206df1ea1fSAndrew Rist *************************************************************/ 216df1ea1fSAndrew Rist 22cdf0e10cSrcweir #ifndef _PROV_HXX_ 23cdf0e10cSrcweir #define _PROV_HXX_ 24cdf0e10cSrcweir 25cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "osl/mutex.hxx" 28cdf0e10cSrcweir #include <ucbhelper/macros.hxx> 29cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp> 30cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 32cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp> 33cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 34cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 35cdf0e10cSrcweir #include <com/sun/star/ucb/XContentProvider.hpp> 36cdf0e10cSrcweir #include <com/sun/star/ucb/XContentIdentifierFactory.hpp> 37cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 38cdf0e10cSrcweir #include <com/sun/star/ucb/XFileIdentifierConverter.hpp> 39cdf0e10cSrcweir #include <com/sun/star/container/XHierarchicalNameAccess.hpp> 40cdf0e10cSrcweir 41cdf0e10cSrcweir // FileProvider 42cdf0e10cSrcweir 43cdf0e10cSrcweir namespace fileaccess { 44cdf0e10cSrcweir 45cdf0e10cSrcweir // Forward declaration 46cdf0e10cSrcweir 47cdf0e10cSrcweir class BaseContent; 48cdf0e10cSrcweir class shell; 49cdf0e10cSrcweir 50cdf0e10cSrcweir class FileProvider: 51cdf0e10cSrcweir public cppu::OWeakObject, 52cdf0e10cSrcweir public com::sun::star::lang::XServiceInfo, 53cdf0e10cSrcweir public com::sun::star::lang::XInitialization, 54cdf0e10cSrcweir public com::sun::star::lang::XTypeProvider, 55cdf0e10cSrcweir public com::sun::star::ucb::XContentProvider, 56cdf0e10cSrcweir public com::sun::star::ucb::XContentIdentifierFactory, 57cdf0e10cSrcweir public com::sun::star::beans::XPropertySet, 58cdf0e10cSrcweir public com::sun::star::ucb::XFileIdentifierConverter 59cdf0e10cSrcweir { 60cdf0e10cSrcweir friend class BaseContent; 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir 63cdf0e10cSrcweir FileProvider( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); 64cdf0e10cSrcweir ~FileProvider(); 65cdf0e10cSrcweir 66cdf0e10cSrcweir // XInterface 67cdf0e10cSrcweir virtual com::sun::star::uno::Any SAL_CALL 68cdf0e10cSrcweir queryInterface( 69cdf0e10cSrcweir const com::sun::star::uno::Type& aType ) 70cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException); 71cdf0e10cSrcweir 72cdf0e10cSrcweir virtual void SAL_CALL 73cdf0e10cSrcweir acquire( 74cdf0e10cSrcweir void ) 75cdf0e10cSrcweir throw(); 76cdf0e10cSrcweir 77cdf0e10cSrcweir virtual void SAL_CALL 78cdf0e10cSrcweir release( 79cdf0e10cSrcweir void ) 80cdf0e10cSrcweir throw(); 81cdf0e10cSrcweir 82cdf0e10cSrcweir // XServiceInfo 83cdf0e10cSrcweir virtual rtl::OUString SAL_CALL 84cdf0e10cSrcweir getImplementationName( 85cdf0e10cSrcweir void ) 86cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 87cdf0e10cSrcweir 88cdf0e10cSrcweir virtual sal_Bool SAL_CALL 89cdf0e10cSrcweir supportsService( 90cdf0e10cSrcweir const rtl::OUString& ServiceName ) 91cdf0e10cSrcweir throw(com::sun::star::uno::RuntimeException ); 92cdf0e10cSrcweir 93cdf0e10cSrcweir virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 94cdf0e10cSrcweir getSupportedServiceNames( 95cdf0e10cSrcweir void ) 96cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 97cdf0e10cSrcweir 98cdf0e10cSrcweir 99cdf0e10cSrcweir static com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > SAL_CALL 100cdf0e10cSrcweir createServiceFactory( 101cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr ); 102cdf0e10cSrcweir 103cdf0e10cSrcweir static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 104cdf0e10cSrcweir CreateInstance( 105cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMultiServiceFactory ); 106cdf0e10cSrcweir 107cdf0e10cSrcweir // XTypeProvider 108cdf0e10cSrcweir 109cdf0e10cSrcweir XTYPEPROVIDER_DECL() 110cdf0e10cSrcweir 111cdf0e10cSrcweir // XInitialization 112cdf0e10cSrcweir virtual void SAL_CALL 113cdf0e10cSrcweir initialize( 114cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) 115cdf0e10cSrcweir throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 116cdf0e10cSrcweir 117cdf0e10cSrcweir 118cdf0e10cSrcweir // XContentProvider 119cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > SAL_CALL 120cdf0e10cSrcweir queryContent( 121cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier ) 122cdf0e10cSrcweir throw( com::sun::star::ucb::IllegalIdentifierException, 123cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 124cdf0e10cSrcweir 125cdf0e10cSrcweir // XContentIdentifierFactory 126cdf0e10cSrcweir 127cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > SAL_CALL 128cdf0e10cSrcweir createContentIdentifier( 129cdf0e10cSrcweir const rtl::OUString& ContentId ) 130cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 131cdf0e10cSrcweir 132cdf0e10cSrcweir 133cdf0e10cSrcweir virtual sal_Int32 SAL_CALL 134cdf0e10cSrcweir compareContentIds( 135cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id1, 136cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id2 ) 137cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 138cdf0e10cSrcweir 139*d0f02d50Smseidel // XPropertySet 140cdf0e10cSrcweir 141cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL 142cdf0e10cSrcweir getPropertySetInfo( ) 143cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 144cdf0e10cSrcweir 145cdf0e10cSrcweir virtual void SAL_CALL 146cdf0e10cSrcweir setPropertyValue( 147cdf0e10cSrcweir const rtl::OUString& aPropertyName, 148cdf0e10cSrcweir const com::sun::star::uno::Any& aValue ) 149cdf0e10cSrcweir throw( com::sun::star::beans::UnknownPropertyException, 150cdf0e10cSrcweir com::sun::star::beans::PropertyVetoException, 151cdf0e10cSrcweir com::sun::star::lang::IllegalArgumentException, 152cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, 153cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 154cdf0e10cSrcweir 155cdf0e10cSrcweir virtual com::sun::star::uno::Any SAL_CALL 156cdf0e10cSrcweir getPropertyValue( 157cdf0e10cSrcweir const rtl::OUString& PropertyName ) 158cdf0e10cSrcweir throw( com::sun::star::beans::UnknownPropertyException, 159cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, 160cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 161cdf0e10cSrcweir 162cdf0e10cSrcweir virtual void SAL_CALL 163cdf0e10cSrcweir addPropertyChangeListener( 164cdf0e10cSrcweir const rtl::OUString& aPropertyName, 165cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >& xListener ) 166cdf0e10cSrcweir throw( com::sun::star::beans::UnknownPropertyException, 167cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, 168cdf0e10cSrcweir com::sun::star::uno::RuntimeException); 169cdf0e10cSrcweir 170cdf0e10cSrcweir virtual void SAL_CALL 171cdf0e10cSrcweir removePropertyChangeListener( 172cdf0e10cSrcweir const rtl::OUString& aPropertyName, 173cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >& aListener ) 174cdf0e10cSrcweir throw( com::sun::star::beans::UnknownPropertyException, 175cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, 176cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 177cdf0e10cSrcweir 178cdf0e10cSrcweir virtual void SAL_CALL 179cdf0e10cSrcweir addVetoableChangeListener( 180cdf0e10cSrcweir const rtl::OUString& PropertyName, 181cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::beans::XVetoableChangeListener >& aListener ) 182cdf0e10cSrcweir throw( com::sun::star::beans::UnknownPropertyException, 183cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, 184cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 185cdf0e10cSrcweir 186cdf0e10cSrcweir virtual void SAL_CALL 187cdf0e10cSrcweir removeVetoableChangeListener( 188cdf0e10cSrcweir const rtl::OUString& PropertyName, 189cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::beans::XVetoableChangeListener >& aListener ) 190cdf0e10cSrcweir throw( com::sun::star::beans::UnknownPropertyException, 191cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, 192cdf0e10cSrcweir com::sun::star::uno::RuntimeException); 193cdf0e10cSrcweir 194cdf0e10cSrcweir 195cdf0e10cSrcweir // XFileIdentifierConverter 196cdf0e10cSrcweir 197cdf0e10cSrcweir virtual sal_Int32 SAL_CALL 198cdf0e10cSrcweir getFileProviderLocality( const rtl::OUString& BaseURL ) 199cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 200cdf0e10cSrcweir 201cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getFileURLFromSystemPath( const rtl::OUString& BaseURL, 202cdf0e10cSrcweir const rtl::OUString& SystemPath ) 203cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 204cdf0e10cSrcweir 205cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getSystemPathFromFileURL( const rtl::OUString& URL ) 206cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 207cdf0e10cSrcweir 208cdf0e10cSrcweir 209cdf0e10cSrcweir private: 210cdf0e10cSrcweir // methods 211cdf0e10cSrcweir void SAL_CALL init(); 212cdf0e10cSrcweir 213cdf0e10cSrcweir // Members 214cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory; 215cdf0e10cSrcweir 216cdf0e10cSrcweir void SAL_CALL initProperties( void ); 217cdf0e10cSrcweir osl::Mutex m_aMutex; 218cdf0e10cSrcweir rtl::OUString m_HostName; 219cdf0e10cSrcweir rtl::OUString m_HomeDirectory; 220cdf0e10cSrcweir sal_Int32 m_FileSystemNotation; 221cdf0e10cSrcweir 222cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > m_xPropertySetInfo; 223cdf0e10cSrcweir 224cdf0e10cSrcweir shell* m_pMyShell; 225cdf0e10cSrcweir }; 226cdf0e10cSrcweir 227cdf0e10cSrcweir } // end namespace fileaccess 228cdf0e10cSrcweir 229cdf0e10cSrcweir #endif 230*d0f02d50Smseidel 231*d0f02d50Smseidel /* vim: set noet sw=4 ts=4: */ 232