libkworkspace
KWorkSpace Namespace Reference
Enumerations | |
enum | ShutdownConfirm { ShutdownConfirmDefault = -1, ShutdownConfirmNo = 0, ShutdownConfirmYes = 1 } |
enum | ShutdownMode { ShutdownModeDefault = -1, ShutdownModeSchedule = 0, ShutdownModeTryNow = 1, ShutdownModeForceNow = 2, ShutdownModeInteractive = 3 } |
enum | ShutdownType { ShutdownTypeDefault = -1, ShutdownTypeNone = 0, ShutdownTypeReboot = 1, ShutdownTypeHalt = 2, ShutdownTypeLogout = 3 } |
Functions | |
bool | canShutDown (ShutdownConfirm confirm=ShutdownConfirmDefault, ShutdownType sdtype=ShutdownTypeDefault, ShutdownMode sdmode=ShutdownModeDefault) |
static void | cleanup_sm () |
static void | dummy_callback (SmcConn, SmPointer) |
void | propagateSessionManager () |
bool | requestShutDown (ShutdownConfirm confirm=ShutdownConfirmDefault, ShutdownType sdtype=ShutdownTypeDefault, ShutdownMode sdmode=ShutdownModeDefault) |
static void | save_yourself_callback (SmcConn conn_P, SmPointer, int, Bool, int, Bool) |
Variables | |
static KRequestShutdownHelper * | helper = NULL |
static QTime | smModificationTime |
Enumeration Type Documentation
The possible values for the confirm
parameter of requestShutDown().
- Enumerator:
-
ShutdownConfirmDefault Obey the user's confirmation setting. ShutdownConfirmNo Don't confirm, shutdown without asking. ShutdownConfirmYes Always confirm, ask even if the user turned it off.
Definition at line 31 of file kworkspace.h.
The possible values for the sdmode
parameter of requestShutDown().
- Enumerator:
Definition at line 75 of file kworkspace.h.
The possible values for the sdtype
parameter of requestShutDown().
- Enumerator:
Definition at line 49 of file kworkspace.h.
Function Documentation
KDE_EXPORT bool KWorkSpace::canShutDown | ( | ShutdownConfirm | confirm = ShutdownConfirmDefault , |
|
ShutdownType | sdtype = ShutdownTypeDefault , |
|||
ShutdownMode | sdmode = ShutdownModeDefault | |||
) |
Used to check whether a requestShutDown call with the same arguments has any chance of succeeding.
For example, if KDE's own session manager cannot be contacted, we can't demand that the computer be shutdown, or force a confirmation dialog.
Even if we can access the KDE session manager, the system or user configuration may prevent the user from requesting a shutdown or reboot.
Definition at line 181 of file kworkspace.cpp.
static void KWorkSpace::cleanup_sm | ( | ) | [static] |
Definition at line 154 of file kworkspace.cpp.
static void KWorkSpace::dummy_callback | ( | SmcConn | , | |
SmPointer | ||||
) | [static] |
Definition at line 64 of file kworkspace.cpp.
KDE_EXPORT void KWorkSpace::propagateSessionManager | ( | ) |
Propagates the network address of the session manager in the SESSION_MANAGER environment variable so that child processes can pick it up.
If SESSION_MANAGER isn't defined yet, the address is searched in $HOME/.KSMserver.
This function is called by clients that are started outside the session ( i.e. before ksmserver is started), but want to launch other processes that should participate in the session. Examples are kdesktop or kicker.
Definition at line 201 of file kworkspace.cpp.
KDE_EXPORT bool KWorkSpace::requestShutDown | ( | ShutdownConfirm | confirm = ShutdownConfirmDefault , |
|
ShutdownType | sdtype = ShutdownTypeDefault , |
|||
ShutdownMode | sdmode = ShutdownModeDefault | |||
) |
Asks the session manager to shut the session down.
Using confirm
== ShutdownConfirmYes or sdtype
!= ShutdownTypeDefault or sdmode
!= ShutdownModeDefault causes the use of ksmserver's DCOP interface. The remaining two combinations use the standard XSMP and will work with any session manager compliant with it.
- Parameters:
-
confirm Whether to ask the user if he really wants to log out. ShutdownConfirm sdtype The action to take after logging out. ShutdownType sdmode If/When the action should be taken. ShutdownMode
- Returns:
- true on success, false if the session manager could not be contacted.
Definition at line 159 of file kworkspace.cpp.
static void KWorkSpace::save_yourself_callback | ( | SmcConn | conn_P, | |
SmPointer | , | |||
int | , | |||
Bool | , | |||
int | , | |||
Bool | ||||
) | [static] |
Definition at line 59 of file kworkspace.cpp.
Variable Documentation
KRequestShutdownHelper* KWorkSpace::helper = NULL [static] |
Definition at line 152 of file kworkspace.cpp.
QTime KWorkSpace::smModificationTime [static] |
Definition at line 200 of file kworkspace.cpp.