Changeset View
Changeset View
Standalone View
Standalone View
src/filechooser.h
Show All 17 Lines | |||||
18 | * Jan Grulich <jgrulich@redhat.com> | 18 | * Jan Grulich <jgrulich@redhat.com> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H | 21 | #ifndef XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H | ||
22 | #define XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H | 22 | #define XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H | ||
23 | 23 | | |||
24 | #include <QDBusObjectPath> | 24 | #include <QDBusObjectPath> | ||
25 | #include <QMetaType> | 25 | #include <QMetaType> | ||
26 | #include <QObject> | 26 | #include <QDBusAbstractAdaptor> | ||
27 | 27 | | |||
28 | class FileChooser : public QObject | 28 | class FileChooserPortal : public QDBusAbstractAdaptor | ||
29 | { | 29 | { | ||
30 | Q_OBJECT | 30 | Q_OBJECT | ||
31 | Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.FileChooser") | 31 | Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.FileChooser") | ||
32 | public: | 32 | public: | ||
33 | // Keep in sync with qflatpakfiledialog from flatpak-platform-plugin | 33 | // Keep in sync with qflatpakfiledialog from flatpak-platform-plugin | ||
34 | typedef struct { | 34 | typedef struct { | ||
35 | uint type; | 35 | uint type; | ||
36 | QString filterString; | 36 | QString filterString; | ||
37 | } Filter; | 37 | } Filter; | ||
38 | typedef QList<Filter> Filters; | 38 | typedef QList<Filter> Filters; | ||
39 | 39 | | |||
40 | typedef struct { | 40 | typedef struct { | ||
41 | QString userVisibleName; | 41 | QString userVisibleName; | ||
42 | Filters filters; | 42 | Filters filters; | ||
43 | } FilterList; | 43 | } FilterList; | ||
44 | typedef QList<FilterList> FilterListList; | 44 | typedef QList<FilterList> FilterListList; | ||
45 | 45 | | |||
46 | FileChooser(QObject *parent = 0); | 46 | FileChooserPortal(QObject *parent); | ||
47 | ~FileChooser(); | 47 | ~FileChooserPortal(); | ||
48 | 48 | | |||
49 | public Q_SLOTS: | 49 | public Q_SLOTS: | ||
50 | uint openFile(const QDBusObjectPath &handle, | 50 | uint OpenFile(const QDBusObjectPath &handle, | ||
51 | const QString &app_id, | 51 | const QString &app_id, | ||
52 | const QString &parent_window, | 52 | const QString &parent_window, | ||
53 | const QString &title, | 53 | const QString &title, | ||
54 | const QVariantMap &options, | 54 | const QVariantMap &options, | ||
55 | QVariantMap &results); | 55 | QVariantMap &results); | ||
56 | 56 | | |||
57 | uint saveFile(const QDBusObjectPath &handle, | 57 | uint SaveFile(const QDBusObjectPath &handle, | ||
58 | const QString &app_id, | 58 | const QString &app_id, | ||
59 | const QString &parent_window, | 59 | const QString &parent_window, | ||
60 | const QString &title, | 60 | const QString &title, | ||
61 | const QVariantMap &options, | 61 | const QVariantMap &options, | ||
62 | QVariantMap &results); | 62 | QVariantMap &results); | ||
63 | }; | 63 | }; | ||
64 | 64 | | |||
65 | #endif // XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H | 65 | #endif // XDG_DESKTOP_PORTAL_KDE_FILECHOOSER_H |