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
20#include <QDBusObjectPath>
22#include "unitydbusobject.h"
24typedef QList<QDBusObjectPath> QDbusList;
25Q_DECLARE_METATYPE(QList<QDBusObjectPath>)
28 * DBusUnitySessionService provides com.canonical.Unity.Session dbus
31 * com.canonical.Unity.Session interface provides public methods
32 * and signals to handle Logout/Reboot/Shutdown.
34class DBusUnitySessionService : public UnityDBusObject
37 Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Session")
40 DBusUnitySessionService();
41 ~DBusUnitySessionService();
43 // For use in QML. Javascript doesn't accept functions beginning with capital letters
44 Q_INVOKABLE void logout() { Logout(); }
45 Q_INVOKABLE void reboot() { Reboot(); }
46 Q_INVOKABLE void shutdown() { Shutdown(); }
47 Q_INVOKABLE void endSession() { EndSession(); }
51 * logoutRequested signal
53 * This signal is emitted when some applications request the system to
55 * @param have_inhibitors if there are any special running applications
56 * which inhibit the logout.
58 Q_SCRIPTABLE void logoutRequested(bool have_inhibitors);
61 * rebootRequested signal
63 * This signal is emitted when some applications request the system to
65 * @param have_inhibitors if there are any special running applications
66 * which inhibit the reboot.
68 Q_SCRIPTABLE void rebootRequested(bool have_inhibitors);
71 * shutdownRequested signal
73 * This signal is emitted when some applications request the system to
75 * @param have_inhibitors if there are any special running applications
76 * which inhibit the shutdown.
78 Q_SCRIPTABLE void shutdownRequested(bool have_inhibitors);
84 * This signal is emitted when all the apps are closed. And the system
93 * This method directly logout the system without user's confirmation.
94 * Ordinary applications should avoid calling this method. Please call
95 * RequestLogout() to ask the user to decide logout or not.
97 Q_SCRIPTABLE void Logout();
102 * This method directly reboot the system without user's confirmation.
103 * Ordinary applications should avoid calling this method. Please call
104 * RequestReboot() to ask the user to decide reboot or not.
106 Q_SCRIPTABLE void Reboot();
109 * Shutdown the system.
111 * This method directly shutdown the system without user's confirmation.
112 * Ordinary applications should avoid calling this method. Please call
113 * RequestShutdown() to ask the user to decide shutdown or not.
115 Q_SCRIPTABLE void Shutdown();
118 * Issue a logout request.
120 * This method emit the logoutRequested signal to the shell with a boolean
121 * which indicates if there's any inhibitors. The shell should receive
122 * this signal and display a dialog to ask the user to confirm the logout
123 * action. If confirmed, shell can call Logout() method to logout.
125 Q_SCRIPTABLE void RequestLogout();
128 * Issue a reboot request.
130 * This method emit the rebootRequested signal to the shell with a boolean
131 * which indicates if there's any inhibitors. The shell should receive
132 * this signal and display a dialog to ask the user to confirm the reboot
133 * action. If confirmed, shell can call Reboot() method to reboot
135 Q_SCRIPTABLE void RequestReboot();
138 * Issue a shutdown request.
140 * This method emit the shutdownRequested signal to the shell with a
141 * boolean which indicates if there's any inhibitors.
142 * The shell should receive
143 * this signal and display a dialog to ask the user to confirm the reboot
144 * action. If confirmed, shell can call Shutdown() method to reboot
146 Q_SCRIPTABLE void RequestShutdown();
149 * Issue an EndSession request.
151 * This method calls the EndSession() Upstart DBus method on the
152 * current DBus session bus.
154 Q_SCRIPTABLE void EndSession();
157class DBusGnomeSessionManagerWrapper : public UnityDBusObject
160 Q_CLASSINFO("D-Bus Interface", "org.gnome.SessionManager.EndSessionDialog")
163 DBusGnomeSessionManagerWrapper();
164 ~DBusGnomeSessionManagerWrapper();
167 Q_SCRIPTABLE void Open(const unsigned int type, const unsigned int arg_1, const unsigned int max_wait, const QList<QDBusObjectPath> &inhibitors);
169#endif // DBUSUNITYSESSIONSERVICE_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list