xref: /aoo42x/main/sw/inc/swunohelper.hxx (revision 56b35d86)
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 //UUUU
41 class SfxItemSet;
42 
43 namespace SWUnoHelper {
44 
45 // calls over the compherl the getEnumAsInt32 function and handle the
46 // exceptions.
47 sal_Int32 GetEnumAsInt32( const com::sun::star::uno::Any& rVal );
48 
49 
50 // methods for UCB actions:
51 	// delete the file under this URL
52 SW_DLLPUBLIC sal_Bool UCB_DeleteFile( const String& rURL );
53 
54 	// copy/move the file to a new location
55 sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL,
56 					sal_Bool bCopyIsMove = sal_False );
57 
58 	// is the URL on the current system case sentive?
59 SW_DLLPUBLIC sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL );
60 
61 	// is the URL readonly?
62 SW_DLLPUBLIC sal_Bool UCB_IsReadOnlyFileName( const String& rURL );
63 
64 	// get a list of files from the folder of the URL
65 	// options: pExtension = 0 -> all, else this specific extension
66 	// 			pDateTime != 0 -> returns also the modified date/time of
67 	//                       the files in a SvPtrarr -->
68 	//                       !! objects must be deleted from the caller!!
69 sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
70 								const String* pExtension = 0,
71 								SvPtrarr* pDateTimeList = 0 );
72 
73     // is the URL an existing file?
74 SW_DLLPUBLIC sal_Bool UCB_IsFile( const String& rURL );
75 
76     // is the URL a existing directory?
77 sal_Bool UCB_IsDirectory( const String& rURL );
78 
79 ///UUUU helper to check if fill style is set to color or bitmap
80 /// and thus formally used SvxBrushItem parts need to be mapped
81 /// for backwards compatibility
82 bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet);
83 
84 }
85 
86 #endif
87