File indexing completed on 2024-04-28 05:35:35
0001 /* 0002 SPDX-FileCopyrightText: 1997 Matthias Kalle Dalheimer <kalle@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "kworkspace_export.h" 0010 0011 namespace KWorkSpace 0012 { 0013 /** 0014 * The possible values for the @p confirm parameter of requestShutDown(). 0015 */ 0016 enum ShutdownConfirm { 0017 /** 0018 * Obey the user's confirmation setting. 0019 */ 0020 ShutdownConfirmDefault = -1, 0021 /** 0022 * Don't confirm, shutdown without asking. 0023 */ 0024 ShutdownConfirmNo = 0, 0025 /** 0026 * Always confirm, ask even if the user turned it off. 0027 */ 0028 ShutdownConfirmYes = 1, 0029 }; 0030 0031 /** 0032 * The possible values for the @p sdtype parameter of requestShutDown(). 0033 */ 0034 enum ShutdownType { 0035 /** 0036 * Select previous action or the default if it's the first time. 0037 */ 0038 ShutdownTypeDefault = -1, 0039 /** 0040 * Only log out 0041 */ 0042 ShutdownTypeNone = 0, 0043 /** 0044 * Log out and reboot the machine. 0045 */ 0046 ShutdownTypeReboot = 1, 0047 /** 0048 * Log out and halt the machine. 0049 */ 0050 ShutdownTypeHalt = 2, 0051 /** 0052 * Temporary brain damage. Don't use. Same as ShutdownTypeNone 0053 */ 0054 // KDE5: kill this 0055 ShutdownTypeLogout = 3, 0056 }; 0057 0058 /** 0059 * The possible values for the @p sdmode parameter of requestShutDown(). 0060 */ 0061 // KDE5: this seems fairly useless 0062 enum ShutdownMode { 0063 /** 0064 * Select previous mode or the default if it's the first time. 0065 */ 0066 ShutdownModeDefault = -1, 0067 /** 0068 * Schedule a shutdown (halt or reboot) for the time all active sessions 0069 * have exited. 0070 */ 0071 ShutdownModeSchedule = 0, 0072 /** 0073 * Shut down, if no sessions are active. Otherwise do nothing. 0074 */ 0075 ShutdownModeTryNow = 1, 0076 /** 0077 * Force shutdown. Kill any possibly active sessions. 0078 */ 0079 ShutdownModeForceNow = 2, 0080 /** 0081 * Pop up a dialog asking the user what to do if sessions are still active. 0082 */ 0083 ShutdownModeInteractive = 3, 0084 }; 0085 0086 /** 0087 * Used to check whether a shutdown is currently in progress 0088 */ 0089 KWORKSPACE_EXPORT bool isShuttingDown(); 0090 0091 /** 0092 * Propagates the network address of the session manager in the 0093 * SESSION_MANAGER environment variable so that child processes can 0094 * pick it up. 0095 * 0096 * If SESSION_MANAGER isn't defined yet, the address is searched in 0097 * $HOME/.KSMserver. 0098 * 0099 * This function is called by clients that are started outside the 0100 * session ( i.e. before ksmserver is started), but want to launch 0101 * other processes that should participate in the session. Examples 0102 * are kdesktop or kicker. 0103 */ 0104 KWORKSPACE_EXPORT void propagateSessionManager(); 0105 }