#include <plugins/Lomiri/Session/dbuslomirisessionservice.h>
Inherits LomiriDBusObject.
|
Q_SCRIPTABLE void | LogoutRequested (bool have_inhibitors) |
|
void | logoutRequested (bool have_inhibitors) |
|
Q_SCRIPTABLE void | RebootRequested (bool have_inhibitors) |
|
void | rebootRequested (bool have_inhibitors) |
|
Q_SCRIPTABLE void | ShutdownRequested (bool have_inhibitors) |
|
void | shutdownRequested (bool have_inhibitors) |
|
Q_SCRIPTABLE void | LogoutReady () |
|
void | logoutReady () |
|
Q_SCRIPTABLE void | LockRequested () |
|
void | lockRequested () |
|
Q_SCRIPTABLE void | Locked () |
|
Q_SCRIPTABLE void | Unlocked () |
|
void | unlocked () |
|
|
Q_INVOKABLE void | logout () |
|
Q_INVOKABLE void | reboot () |
|
Q_INVOKABLE void | shutdown () |
|
Q_INVOKABLE void | endSession () |
|
DBusLomiriSessionService provides com.lomiri.Shell.Session dbus interface.
com.lomiri.Shell.Session interface provides public methods and signals to handle eg. Logout/Reboot/Shutdown.
Definition at line 34 of file dbuslomirisessionservice.h.
◆ CanHibernate
bool DBusLomiriSessionService::CanHibernate |
( |
| ) |
const |
|
slot |
- Returns
- whether the system is capable of hibernating
Definition at line 355 of file dbuslomirisessionservice.cpp.
357 return d->checkLogin1Call(QStringLiteral(
"CanHibernate"));
◆ CanHybridSleep
bool DBusLomiriSessionService::CanHybridSleep |
( |
| ) |
const |
|
slot |
- Returns
- whether the system is capable of hybrid sleep
- Since
- lomiri
Definition at line 365 of file dbuslomirisessionservice.cpp.
367 return d->checkLogin1Call(QStringLiteral(
"CanHybridSleep"));
◆ CanLock
bool DBusLomiriSessionService::CanLock |
( |
| ) |
const |
|
slot |
- Returns
- whether the system is capable of locking the session
Definition at line 380 of file dbuslomirisessionservice.cpp.
383 if (user.startsWith(QStringLiteral(
"guest-")) ||
384 d->isUserInGroup(user, QStringLiteral(
"nopasswdlogin"))) {
◆ CanReboot
bool DBusLomiriSessionService::CanReboot |
( |
| ) |
const |
|
slot |
- Returns
- whether the system is capable of rebooting
- Since
- lomiri
Definition at line 370 of file dbuslomirisessionservice.cpp.
372 return d->checkLogin1Call(QStringLiteral(
"CanReboot"));
◆ CanShutdown
bool DBusLomiriSessionService::CanShutdown |
( |
| ) |
const |
|
slot |
- Returns
- whether the system is capable of shutting down
Definition at line 375 of file dbuslomirisessionservice.cpp.
377 return d->checkLogin1Call(QStringLiteral(
"CanPowerOff"));
◆ CanSuspend
bool DBusLomiriSessionService::CanSuspend |
( |
| ) |
const |
|
slot |
- Returns
- whether the system is capable of suspending
Definition at line 360 of file dbuslomirisessionservice.cpp.
362 return d->checkLogin1Call(QStringLiteral(
"CanSuspend"));
◆ EndSession
void DBusLomiriSessionService::EndSession |
( |
| ) |
|
|
slot |
Issue an EndSession request.
This method calls the EndSession() Upstart DBus method on the current DBus session bus.
Definition at line 346 of file dbuslomirisessionservice.cpp.
348 const QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral(
"com.lomiri.Upstart"),
349 QStringLiteral(
"/com/lomiri/Upstart"),
350 QStringLiteral(
"com.lomiri.Upstart0_6"),
351 QStringLiteral(
"EndSession"));
352 QDBusConnection::sessionBus().asyncCall(msg);
◆ Hibernate
void DBusLomiriSessionService::Hibernate |
( |
| ) |
|
|
slot |
Hibernate the system
This method puts the system into hibernation without user's confirmation.
Definition at line 523 of file dbuslomirisessionservice.cpp.
526 d->makeLogin1Call(QStringLiteral(
"Hibernate"), {
false});
◆ HostName
QString DBusLomiriSessionService::HostName |
( |
| ) |
const |
|
slot |
- Returns
- the local hostname
Definition at line 410 of file dbuslomirisessionservice.cpp.
413 if (gethostname(hostName,
sizeof(hostName)) == -1) {
414 qWarning() <<
"Could not determine local hostname";
417 hostName[
sizeof(hostName) - 1] =
'\0';
418 return QString::fromLocal8Bit(hostName);
◆ HybridSleep
void DBusLomiriSessionService::HybridSleep |
( |
| ) |
|
|
slot |
Hybrid sleep
This method puts the system into hybrid sleep without user's confirmation.
- Since
- lomiri
Definition at line 529 of file dbuslomirisessionservice.cpp.
532 d->makeLogin1Call(QStringLiteral(
"HybridSleep"), {
false});
◆ IsLocked
bool DBusLomiriSessionService::IsLocked |
( |
| ) |
const |
|
slot |
◆ Lock
void DBusLomiriSessionService::Lock |
( |
| ) |
|
|
slot |
◆ Locked
Q_SCRIPTABLE void DBusLomiriSessionService::Locked |
( |
| ) |
|
|
signal |
Emitted after the session has been locked.
◆ LockRequested
Q_SCRIPTABLE void DBusLomiriSessionService::LockRequested |
( |
| ) |
|
|
signal |
◆ Logout
void DBusLomiriSessionService::Logout |
( |
| ) |
|
|
slot |
Logout the system.
This method directly logs out the system without user's confirmation. Ordinary applications should avoid calling this method. Please call RequestLogout() to ask the user to decide logout or not.
Definition at line 339 of file dbuslomirisessionservice.cpp.
343 Q_EMIT logoutReady();
◆ LogoutReady
Q_SCRIPTABLE void DBusLomiriSessionService::LogoutReady |
( |
| ) |
|
|
signal |
LogoutReady signal
This signal is emitted when all the apps are closed. And the system is safe to logout.
◆ LogoutRequested
Q_SCRIPTABLE void DBusLomiriSessionService::LogoutRequested |
( |
bool |
have_inhibitors | ) |
|
|
signal |
LogoutRequested signal
This signal is emitted when some applications request the system to logout.
- Parameters
-
have_inhibitors | if there are any special running applications which inhibit the logout. |
◆ PromptLock
void DBusLomiriSessionService::PromptLock |
( |
| ) |
|
|
slot |
◆ RealName
QString DBusLomiriSessionService::RealName |
( |
| ) |
const |
|
slot |
- Returns
- the real name of the current user
Definition at line 396 of file dbuslomirisessionservice.cpp.
398 struct passwd *p = getpwuid(geteuid());
400 const QString gecos = QString::fromLocal8Bit(p->pw_gecos);
401 if (!gecos.isEmpty()) {
402 const QStringList splitGecos = gecos.split(QLatin1Char(
','));
403 return splitGecos.first();
◆ Reboot
void DBusLomiriSessionService::Reboot |
( |
| ) |
|
|
slot |
Reboot the system.
This method directly reboots the system without user's confirmation. Ordinary applications should avoid calling this method. Please call RequestReboot() to ask the user to decide reboot or not.
Definition at line 501 of file dbuslomirisessionservice.cpp.
503 d->makeLogin1Call(QStringLiteral(
"Reboot"), {
false});
◆ RebootRequested
Q_SCRIPTABLE void DBusLomiriSessionService::RebootRequested |
( |
bool |
have_inhibitors | ) |
|
|
signal |
RebootRequested signal
This signal is emitted when some applications request the system to reboot.
- Parameters
-
have_inhibitors | if there are any special running applications which inhibit the reboot. |
◆ RequestLogout
void DBusLomiriSessionService::RequestLogout |
( |
| ) |
|
|
slot |
Issue a logout request.
This method emits the LogoutRequested signal to the shell with a boolean which indicates if there's any inhibitors. The shell should receive this signal and display a dialog to ask the user to confirm the logout action. If confirmed, shell can call Logout() method to logout.
Definition at line 495 of file dbuslomirisessionservice.cpp.
498 Q_EMIT logoutRequested(
false);
◆ RequestReboot
void DBusLomiriSessionService::RequestReboot |
( |
| ) |
|
|
slot |
Issue a reboot request.
This method emits the RebootRequested signal to the shell with a boolean which indicates if there's any inhibitors. The shell should receive this signal and display a dialog to ask the user to confirm the reboot action. If confirmed, shell can call Reboot() method to reboot.
Definition at line 506 of file dbuslomirisessionservice.cpp.
509 Q_EMIT rebootRequested(
false);
◆ RequestShutdown
void DBusLomiriSessionService::RequestShutdown |
( |
| ) |
|
|
slot |
Issue a shutdown request.
This method emits the ShutdownRequested signal to the shell with a boolean which indicates if there's any inhibitors. The shell should receive this signal and display a dialog to ask the user to confirm the reboot action. If confirmed, shell can call Shutdown() method to shutdown.
Definition at line 535 of file dbuslomirisessionservice.cpp.
538 Q_EMIT shutdownRequested(
false);
◆ Shutdown
void DBusLomiriSessionService::Shutdown |
( |
| ) |
|
|
slot |
Shutdown the system.
This method directly shuts down the system without user's confirmation. Ordinary applications should avoid calling this method. Please call RequestShutdown() to ask the user to decide shutdown or not.
Definition at line 512 of file dbuslomirisessionservice.cpp.
514 d->makeLogin1Call(QStringLiteral(
"PowerOff"), {
false});
◆ ShutdownRequested
Q_SCRIPTABLE void DBusLomiriSessionService::ShutdownRequested |
( |
bool |
have_inhibitors | ) |
|
|
signal |
ShutdownRequested signal
This signal is emitted when some applications request the system to shutdown.
- Parameters
-
have_inhibitors | if there are any special running applications which inhibit the shutdown. |
◆ Suspend
void DBusLomiriSessionService::Suspend |
( |
| ) |
|
|
slot |
Suspend the system
This method puts the system into sleep without user's confirmation.
Definition at line 517 of file dbuslomirisessionservice.cpp.
520 d->makeLogin1Call(QStringLiteral(
"Suspend"), {
false});
◆ Unlocked
Q_SCRIPTABLE void DBusLomiriSessionService::Unlocked |
( |
| ) |
|
|
signal |
Emitted after the session has been unlocked.
◆ UserName
QString DBusLomiriSessionService::UserName |
( |
| ) |
const |
|
slot |
The documentation for this class was generated from the following files: