PCManFM-Qt
utilities.h
1 /*
2 
3  Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 
21 #ifndef FM_UTILITIES_H
22 #define FM_UTILITIES_H
23 
24 #include "libfmqtglobals.h"
25 #include <QClipboard>
26 #include <QUrl>
27 #include <QList>
28 #include <libfm/fm.h>
29 #include <sys/types.h>
30 
31 class QDialog;
32 
33 namespace Fm {
34 
35 LIBFM_QT_API FmPathList* pathListFromQUrls(QList<QUrl> urls);
36 
37 LIBFM_QT_API void pasteFilesFromClipboard(FmPath* destPath, QWidget* parent = 0);
38 
39 LIBFM_QT_API void copyFilesToClipboard(FmPathList* files);
40 
41 LIBFM_QT_API void cutFilesToClipboard(FmPathList* files);
42 
43 LIBFM_QT_API void renameFile(FmFileInfo* file, QWidget* parent = 0);
44 
45 enum CreateFileType {
46  CreateNewFolder,
47  CreateNewTextFile,
48  CreateWithTemplate
49 };
50 
51 LIBFM_QT_API void createFileOrFolder(CreateFileType type, FmPath* parentDir, FmTemplate* templ = NULL, QWidget* parent = 0);
52 
53 LIBFM_QT_API uid_t uidFromName(QString name);
54 
55 LIBFM_QT_API QString uidToName(uid_t uid);
56 
57 LIBFM_QT_API gid_t gidFromName(QString name);
58 
59 LIBFM_QT_API QString gidToName(gid_t gid);
60 
61 LIBFM_QT_API int execModelessDialog(QDialog* dlg);
62 
63 // NOTE: this does not work reliably due to some problems in gio/gvfs
64 // Use uriExists() whenever possible.
65 LIBFM_QT_API bool isUriSchemeSupported(const char* uriScheme);
66 
67 LIBFM_QT_API bool uriExists(const char* uri);
68 
69 }
70 
71 #endif // FM_UTILITIES_H
Definition: appchoosercombobox.cpp:26