Unity 8
dbusunitysessionservice.h
1 /*
2  * Copyright (C) 2014 Canonical, Ltd.
3  *
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.
7  *
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.
12  *
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/>.
15  */
16 
17 #ifndef DBUSUNITYSESSIONSERVICE_H
18 #define DBUSUNITYSESSIONSERVICE_H
19 
20 #include "unitydbusobject.h"
21 
29 class DBusUnitySessionService : public UnityDBusObject
30 {
31  Q_OBJECT
32  Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Session")
33 
34 public:
37 
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(); }
42 
43 Q_SIGNALS:
52  void logoutRequested(bool have_inhibitors);
53 
62  void rebootRequested(bool have_inhibitors);
63 
72  void shutdownRequested(bool have_inhibitors);
73 
74 
81  void logoutReady();
82 
83 public Q_SLOTS:
91  Q_SCRIPTABLE void Logout();
92 
100  Q_SCRIPTABLE void Reboot();
101 
109  Q_SCRIPTABLE void Shutdown();
110 
119  Q_SCRIPTABLE void RequestLogout();
120 
129  Q_SCRIPTABLE void RequestReboot();
130 
140  Q_SCRIPTABLE void RequestShutdown();
141 
142 };
143 
144 #endif // DBUSUNITYSESSIONSERVICE_H
void shutdownRequested(bool have_inhibitors)
Q_SCRIPTABLE void RequestShutdown()
void logoutRequested(bool have_inhibitors)
void rebootRequested(bool have_inhibitors)