@@ -0,0 +1,82 @@
2+ * Copyright (C) 2014 Canonical, Ltd.
4+ * This program is free software: you can redistribute it and/or modify it under
5+ * the terms of the GNU Lesser General Public License version 3, as published by
6+ * the Free Software Foundation.
8+ * This program is distributed in the hope that it will be useful, but WITHOUT
9+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+ * Lesser General Public License for more details.
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17+#ifndef DBUSUNITYSESSIONSERVICE_H
18+#define DBUSUNITYSESSIONSERVICE_H
23+ * DBusUnitySessionService provides com.canonical.Unity.Session dbus
26+ * com.canonical.Unity.Session interface provides public methods
27+ * and signals to handle Logout/Reboot/Shutdown.
29+class DBusUnitySessionService : public QObject
32+ Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Session")
35+ DBusUnitySessionService();
36+ ~DBusUnitySessionService();
40+ * logoutRequested signal
42+ * This signal is emitted when some applications request the system to
44+ * @param have_inhibitors if there are any special running applications
45+ * which inhibit the logout.
47+ void logoutRequested(bool have_inhibitors);
52+ * This signal is emitted when all the apps are closed. And the system
61+ * This method directly logout the system without user's confirmation.
62+ * Ordinary applications should avoid calling this method. Please call
63+ * RequestLogout() to ask the user to decide logout or not.
64+ * This method will stop all the running applications and then signal
65+ * logoutReady when all the apps stopped.
67+ Q_SCRIPTABLE void Logout();
70+ * Issue a logout request.
72+ * This method emit the logoutRequested signal to the shell with a boolean
73+ * which indicates if there's any inhibitors. The shell should receive
74+ * this signal and display a dialog to ask the user to confirm the logout
75+ * action. If confirmed, shell can call Logout() method to kill the apps
78+ Q_SCRIPTABLE void RequestLogout();
82+#endif // DBUSUNITYSESSIONSERVICE_H