not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / kworkspace / kworkspace.h
blob7adad646d53f4a4450429e8c0bb69c1c283dbec6
1 /* This file is part of the KDE libraries
2 Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org)
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KWORKSPACE_H
21 #define KWORKSPACE_H
23 #include <kdemacros.h>
25 namespace KWorkSpace
28 /**
29 * The possible values for the @p confirm parameter of requestShutDown().
31 enum ShutdownConfirm {
32 /**
33 * Obey the user's confirmation setting.
35 ShutdownConfirmDefault = -1,
36 /**
37 * Don't confirm, shutdown without asking.
39 ShutdownConfirmNo = 0,
40 /**
41 * Always confirm, ask even if the user turned it off.
43 ShutdownConfirmYes = 1
46 /**
47 * The possible values for the @p sdtype parameter of requestShutDown().
49 enum ShutdownType {
50 /**
51 * Select previous action or the default if it's the first time.
53 ShutdownTypeDefault = -1,
54 /**
55 * Only show log out dialog
57 ShutdownTypeNone = 0,
58 /**
59 * Log out and reboot the machine.
61 ShutdownTypeReboot = 1,
62 /**
63 * Log out and halt the machine.
65 ShutdownTypeHalt = 2,
66 /**
67 * Only log out
69 ShutdownTypeLogout = 3
72 /**
73 * The possible values for the @p sdmode parameter of requestShutDown().
75 enum ShutdownMode {
76 /**
77 * Select previous mode or the default if it's the first time.
79 ShutdownModeDefault = -1,
80 /**
81 * Schedule a shutdown (halt or reboot) for the time all active sessions
82 * have exited.
84 ShutdownModeSchedule = 0,
85 /**
86 * Shut down, if no sessions are active. Otherwise do nothing.
88 ShutdownModeTryNow = 1,
89 /**
90 * Force shutdown. Kill any possibly active sessions.
92 ShutdownModeForceNow = 2,
93 /**
94 * Pop up a dialog asking the user what to do if sessions are still active.
96 ShutdownModeInteractive = 3
99 /**
100 * Asks the session manager to shut the session down.
102 * Using @p confirm == ShutdownConfirmYes or @p sdtype != ShutdownTypeDefault or
103 * @p sdmode != ShutdownModeDefault causes the use of ksmserver's DCOP
104 * interface. The remaining two combinations use the standard XSMP and
105 * will work with any session manager compliant with it.
107 * @param confirm Whether to ask the user if he really wants to log out.
108 * ShutdownConfirm
109 * @param sdtype The action to take after logging out. ShutdownType
110 * @param sdmode If/When the action should be taken. ShutdownMode
111 * @return true on success, false if the session manager could not be
112 * contacted.
114 KDE_EXPORT bool requestShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault,
115 ShutdownType sdtype = ShutdownTypeDefault,
116 ShutdownMode sdmode = ShutdownModeDefault );
119 * Used to check whether a requestShutDown call with the same arguments
120 * has any chance of succeeding.
122 * For example, if KDE's own session manager cannot be contacted, we can't
123 * demand that the computer be shutdown, or force a confirmation dialog.
125 * Even if we can access the KDE session manager, the system or user
126 * configuration may prevent the user from requesting a shutdown or
127 * reboot.
129 KDE_EXPORT bool canShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault,
130 ShutdownType sdtype = ShutdownTypeDefault,
131 ShutdownMode sdmode = ShutdownModeDefault );
134 * Propagates the network address of the session manager in the
135 * SESSION_MANAGER environment variable so that child processes can
136 * pick it up.
138 * If SESSION_MANAGER isn't defined yet, the address is searched in
139 * $HOME/.KSMserver.
141 * This function is called by clients that are started outside the
142 * session ( i.e. before ksmserver is started), but want to launch
143 * other processes that should participate in the session. Examples
144 * are kdesktop or kicker.
146 KDE_EXPORT void propagateSessionManager();
150 #endif