xref: /aoo42x/main/sw/inc/swunohelper.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SWUNOHELPER_HXX
24 #define _SWUNOHELPER_HXX
25 
26 #include <tools/solar.h>
27 #include <sal/types.h>
28 #include "swdllapi.h"
29 
30 namespace com { namespace sun { namespace star {
31 	namespace uno {
32 		class Any;
33 	}
34 }}}
35 
36 class String;
37 class SvStrings;
38 class SvPtrarr;
39 
40 namespace SWUnoHelper {
41 
42 // calls over the compherl the getEnumAsInt32 function and handle the
43 // exceptions.
44 sal_Int32 GetEnumAsInt32( const com::sun::star::uno::Any& rVal );
45 
46 
47 // methods for UCB actions:
48 	// delete the file under this URL
49 SW_DLLPUBLIC sal_Bool UCB_DeleteFile( const String& rURL );
50 
51 	// copy/move the file to a new location
52 sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL,
53 					sal_Bool bCopyIsMove = sal_False );
54 
55 	// is the URL on the current system case sentive?
56 SW_DLLPUBLIC sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL );
57 
58 	// is the URL readonly?
59 SW_DLLPUBLIC sal_Bool UCB_IsReadOnlyFileName( const String& rURL );
60 
61 	// get a list of files from the folder of the URL
62 	// options: pExtension = 0 -> all, else this specific extension
63 	// 			pDateTime != 0 -> returns also the modified date/time of
64 	//                       the files in a SvPtrarr -->
65 	//                       !! objects must be deleted from the caller!!
66 sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
67 								const String* pExtension = 0,
68 								SvPtrarr* pDateTimeList = 0 );
69 
70     // is the URL an existing file?
71 SW_DLLPUBLIC sal_Bool UCB_IsFile( const String& rURL );
72 
73     // is the URL a existing directory?
74 sal_Bool UCB_IsDirectory( const String& rURL );
75 }
76 
77 #endif
78