diff options
author | Rüdiger Timm <rt@openoffice.org> | 2003-04-23 15:55:13 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2003-04-23 15:55:13 +0000 |
commit | 63c2e27d72e0d5e10bf2456c835c529c78956351 (patch) | |
tree | c53b9556bd113d8fef0f67ed30ede86f195951db /fileaccess/source | |
parent | cba201366a2de485e468a38effcd470555d75e5e (diff) |
INTEGRATION: CWS uno2 (1.18.36); FILE MERGED
2003/04/04 12:47:20 ab 1.18.36.1: 107504# XSimpleFileAccess3 implemented
Diffstat (limited to 'fileaccess/source')
-rw-r--r-- | fileaccess/source/FileAccess.cxx | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx index 9d0a5d07f227..6557c6ad9cd3 100644 --- a/fileaccess/source/FileAccess.cxx +++ b/fileaccess/source/FileAccess.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FileAccess.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: kso $ $Date: 2001-12-07 16:04:55 $ + * last change: $Author: rt $ $Date: 2003-04-23 16:55:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,7 +90,7 @@ #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XContentAccess.hpp> #include <com/sun/star/ucb/XContentCreator.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess3.hpp> #define IMPLEMENTATION_NAME "com.sun.star.comp.ucb.SimpleFileAccess" #define SERVICE_NAME "com.sun.star.ucb.SimpleFileAccess" @@ -112,7 +112,7 @@ namespace io_FileAccess //=========================================================================== // Implementation XSimpleFileAccess -typedef cppu::WeakImplHelper1< XSimpleFileAccess2 > FileAccessHelper; +typedef cppu::WeakImplHelper1< XSimpleFileAccess3 > FileAccessHelper; class OCommandEnvironment; class OFileAccess : public FileAccessHelper @@ -144,7 +144,8 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openFileReadWrite( const ::rtl::OUString& FileURL ) throw(::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setInteractionHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL writeFile( const ::rtl::OUString& FileURL, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& data ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - + virtual sal_Bool SAL_CALL isHidden( const ::rtl::OUString& FileURL ) throw(::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHidden( const ::rtl::OUString& FileURL, sal_Bool bHidden ) throw(::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); }; @@ -683,6 +684,27 @@ void SAL_CALL OFileAccess::writeFile( const rtl::OUString& FileURL, } } +sal_Bool OFileAccess::isHidden( const ::rtl::OUString& FileURL ) + throw(CommandAbortedException, Exception, RuntimeException) +{ + INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + ucb::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); + Any aRetAny = aCnt.getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ) ); + sal_Bool bRet = sal_False; + aRetAny >>= bRet; + return bRet; +} + +void OFileAccess::setHidden( const ::rtl::OUString& FileURL, sal_Bool bHidden ) + throw(CommandAbortedException, Exception, RuntimeException) +{ + INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + ucb::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); + Any aAny; + aAny <<= bHidden; + aCnt.setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ), aAny ); +} + Reference< XInterface > SAL_CALL FileAccess_CreateInstance( const Reference< XMultiServiceFactory > &) { return Reference < XInterface >( ( cppu::OWeakObject * ) new OFileAccess ); |