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 "unitydbusobject.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.
29class DBusUnitySessionService : public UnityDBusObject
32 Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Session")
35 DBusUnitySessionService();
36 ~DBusUnitySessionService();
38 // For use in QML. Javascript doesn't accept functions beginning with capital letters
39 Q_INVOKABLE void logout() { Logout(); }
40 Q_INVOKABLE void reboot() { Reboot(); }
41 Q_INVOKABLE void shutdown() { Shutdown(); }
45 * logoutRequested signal
47 * This signal is emitted when some applications request the system to
49 * @param have_inhibitors if there are any special running applications
50 * which inhibit the logout.
52 void logoutRequested(bool have_inhibitors);
55 * rebootRequested signal
57 * This signal is emitted when some applications request the system to
59 * @param have_inhibitors if there are any special running applications
60 * which inhibit the reboot.
62 void rebootRequested(bool have_inhibitors);
65 * shutdownRequested signal
67 * This signal is emitted when some applications request the system to
69 * @param have_inhibitors if there are any special running applications
70 * which inhibit the shutdown.
72 void shutdownRequested(bool have_inhibitors);
78 * This signal is emitted when all the apps are closed. And the system
87 * This method directly logout the system without user's confirmation.
88 * Ordinary applications should avoid calling this method. Please call
89 * RequestLogout() to ask the user to decide logout or not.
91 Q_SCRIPTABLE void Logout();
96 * This method directly reboot the system without user's confirmation.
97 * Ordinary applications should avoid calling this method. Please call
98 * RequestReboot() to ask the user to decide reboot or not.
100 Q_SCRIPTABLE void Reboot();
103 * Shutdown the system.
105 * This method directly shutdown the system without user's confirmation.
106 * Ordinary applications should avoid calling this method. Please call
107 * RequestShutdown() to ask the user to decide shutdown or not.
109 Q_SCRIPTABLE void Shutdown();
112 * Issue a logout request.
114 * This method emit the logoutRequested signal to the shell with a boolean
115 * which indicates if there's any inhibitors. The shell should receive
116 * this signal and display a dialog to ask the user to confirm the logout
117 * action. If confirmed, shell can call Logout() method to logout.
119 Q_SCRIPTABLE void RequestLogout();
122 * Issue a reboot request.
124 * This method emit the rebootRequested signal to the shell with a boolean
125 * which indicates if there's any inhibitors. The shell should receive
126 * this signal and display a dialog to ask the user to confirm the reboot
127 * action. If confirmed, shell can call Reboot() method to reboot
129 Q_SCRIPTABLE void RequestReboot();
132 * Issue a shutdown request.
134 * This method emit the shutdownRequested signal to the shell with a
135 * boolean which indicates if there's any inhibitors.
136 * The shell should receive
137 * this signal and display a dialog to ask the user to confirm the reboot
138 * action. If confirmed, shell can call Shutdown() method to reboot
140 Q_SCRIPTABLE void RequestShutdown();
144#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