1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SWUNOHELPER_HXX 28 #define _SWUNOHELPER_HXX 29 30 #include <tools/solar.h> 31 #include <sal/types.h> 32 #include "swdllapi.h" 33 34 namespace com { namespace sun { namespace star { 35 namespace uno { 36 class Any; 37 } 38 }}} 39 40 class String; 41 class SvStrings; 42 class SvPtrarr; 43 44 namespace SWUnoHelper { 45 46 // calls over the compherl the getEnumAsInt32 function and handle the 47 // exceptions. 48 sal_Int32 GetEnumAsInt32( const com::sun::star::uno::Any& rVal ); 49 50 51 // methods for UCB actions: 52 // delete the file under this URL 53 SW_DLLPUBLIC sal_Bool UCB_DeleteFile( const String& rURL ); 54 55 // copy/move the file to a new location 56 sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL, 57 sal_Bool bCopyIsMove = sal_False ); 58 59 // is the URL on the current system case sentive? 60 SW_DLLPUBLIC sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL ); 61 62 // is the URL readonly? 63 SW_DLLPUBLIC sal_Bool UCB_IsReadOnlyFileName( const String& rURL ); 64 65 // get a list of files from the folder of the URL 66 // options: pExtension = 0 -> all, else this specific extension 67 // pDateTime != 0 -> returns also the modified date/time of 68 // the files in a SvPtrarr --> 69 // !! objects must be deleted from the caller!! 70 sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList, 71 const String* pExtension = 0, 72 SvPtrarr* pDateTimeList = 0 ); 73 74 // is the URL an existing file? 75 SW_DLLPUBLIC sal_Bool UCB_IsFile( const String& rURL ); 76 77 // is the URL a existing directory? 78 sal_Bool UCB_IsDirectory( const String& rURL ); 79 } 80 81 #endif 82