Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / kworkspace / kworkspace.h
blob5596a62b24ae620d830027467533ed7acef0aa1a
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 log out.
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
68 /**
69 * The possible values for the @p sdmode parameter of requestShutDown().
71 enum ShutdownMode {
72 /**
73 * Select previous mode or the default if it's the first time.
75 ShutdownModeDefault = -1,
76 /**
77 * Schedule a shutdown (halt or reboot) for the time all active sessions
78 * have exited.
80 ShutdownModeSchedule = 0,
81 /**
82 * Shut down, if no sessions are active. Otherwise do nothing.
84 ShutdownModeTryNow = 1,
85 /**
86 * Force shutdown. Kill any possibly active sessions.
88 ShutdownModeForceNow = 2,
89 /**
90 * Pop up a dialog asking the user what to do if sessions are still active.
92 ShutdownModeInteractive = 3
95 /**
96 * Asks the session manager to shut the session down.
98 * Using @p confirm == ShutdownConfirmYes or @p sdtype != ShutdownTypeDefault or
99 * @p sdmode != ShutdownModeDefault causes the use of ksmserver's DCOP
100 * interface. The remaining two combinations use the standard XSMP and
101 * will work with any session manager compliant with it.
103 * @param confirm Whether to ask the user if he really wants to log out.
104 * ShutdownConfirm
105 * @param sdtype The action to take after logging out. ShutdownType
106 * @param sdmode If/When the action should be taken. ShutdownMode
107 * @return true on success, false if the session manager could not be
108 * contacted.
110 KDE_EXPORT bool requestShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault,
111 ShutdownType sdtype = ShutdownTypeDefault,
112 ShutdownMode sdmode = ShutdownModeDefault );
115 * Propagates the network address of the session manager in the
116 * SESSION_MANAGER environment variable so that child processes can
117 * pick it up.
119 * If SESSION_MANAGER isn't defined yet, the address is searched in
120 * $HOME/.KSMserver.
122 * This function is called by clients that are started outside the
123 * session ( i.e. before ksmserver is started), but want to launch
124 * other processes that should participate in the session. Examples
125 * are kdesktop or kicker.
127 KDE_EXPORT void propagateSessionManager();
131 #endif