Changeset View
Changeset View
Standalone View
Standalone View
src/session.h
- This file was copied from src/desktopportal.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright © 2016 Red Hat, Inc | 2 | * Copyright © 2018 Red Hat, Inc | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | 5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | 6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2 of the License, or (at your option) any later version. | 7 | * version 2 of the License, or (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | 9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | * | 16 | * | ||
17 | * Authors: | 17 | * Authors: | ||
18 | * Jan Grulich <jgrulich@redhat.com> | 18 | * Jan Grulich <jgrulich@redhat.com> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef XDG_DESKTOP_PORTAL_KDE_DESKTOP_PORTAL_H | 21 | #ifndef XDG_DESKTOP_PORTAL_KDE_SESSION_H | ||
22 | #define XDG_DESKTOP_PORTAL_KDE_DESKTOP_PORTAL_H | 22 | #define XDG_DESKTOP_PORTAL_KDE_SESSION_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QDBusVirtualObject> | 25 | #include <QDBusVirtualObject> | ||
26 | 26 | | |||
27 | #include "access.h" | 27 | class Session : public QDBusVirtualObject | ||
28 | #include "appchooser.h" | | |||
29 | #include "email.h" | | |||
30 | #include "filechooser.h" | | |||
31 | #include "inhibit.h" | | |||
32 | #include "notification.h" | | |||
33 | #include "print.h" | | |||
34 | | ||||
35 | class DesktopPortal : public QObject | | |||
36 | { | 28 | { | ||
37 | Q_OBJECT | 29 | Q_OBJECT | ||
38 | public: | 30 | public: | ||
39 | explicit DesktopPortal(QObject *parent = nullptr); | 31 | explicit Session(QObject *parent = nullptr, const QString &appId = QString(), const QString &path = QString()); | ||
40 | ~DesktopPortal(); | 32 | ~Session(); | ||
33 | | ||||
34 | bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) Q_DECL_OVERRIDE; | ||||
35 | QString introspect(const QString &path) const Q_DECL_OVERRIDE; | ||||
36 | | ||||
37 | bool close(); | ||||
38 | | ||||
39 | bool multipleSources() const; | ||||
40 | void setMultipleSources(bool multipleSources); | ||||
41 | | ||||
42 | Q_SIGNALS: | ||||
43 | void closed(); | ||||
41 | 44 | | |||
42 | private: | 45 | private: | ||
43 | AccessPortal *m_access; | 46 | bool m_multipleSources; | ||
44 | AppChooserPortal *m_appChooser; | 47 | const QString m_appId; | ||
45 | EmailPortal *m_email; | 48 | const QString m_path; | ||
46 | FileChooserPortal *m_fileChooser; | | |||
47 | InhibitPortal *m_inhibit; | | |||
48 | NotificationPortal *m_notification; | | |||
49 | PrintPortal *m_print; | | |||
50 | }; | 49 | }; | ||
51 | 50 | | |||
52 | #endif // XDG_DESKTOP_PORTAL_KDE_DESKTOP_PORTAL_H | 51 | #endif // XDG_DESKTOP_PORTAL_KDE_SESSION_H | ||
53 | 52 | |