1 | /***************************************************************** |
2 | ksmserver - the KDE session management server |
3 | |
4 | Copyright 2000 Matthias Ettrich <ettrich@kde.org> |
5 | |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | of this software and associated documentation files (the "Software"), to deal |
8 | in the Software without restriction, including without limitation the rights |
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 | copies of the Software, and to permit persons to whom the Software is |
11 | furnished to do so, subject to the following conditions: |
12 | |
13 | The above copyright notice and this permission notice shall be included in |
14 | all copies or substantial portions of the Software. |
15 | |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
20 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
22 | |
23 | ******************************************************************/ |
24 | |
25 | #ifndef CLIENT_H |
26 | #define CLIENT_H |
27 | |
28 | // needed to avoid clash with INT8 defined in X11/Xmd.h on solaris |
29 | #define QT_CLEAN_NAMESPACE 1 |
30 | |
31 | #include <kapplication.h> |
32 | #include <kworkspace/kworkspace.h> |
33 | |
34 | #include "server.h" |
35 | |
36 | |
37 | class KSMClient |
38 | { |
39 | public: |
40 | explicit KSMClient( SmsConn ); |
41 | ~KSMClient(); |
42 | |
43 | void registerClient( const char* previousId = 0 ); |
44 | SmsConn connection() const { return smsConn; } |
45 | |
46 | void resetState(); |
47 | uint saveYourselfDone : 1; |
48 | uint pendingInteraction : 1; |
49 | uint waitForPhase2 : 1; |
50 | uint wasPhase2 : 1; |
51 | |
52 | QList<SmProp*> properties; |
53 | SmProp* property( const char* name ) const; |
54 | |
55 | QString program() const; |
56 | QStringList restartCommand() const; |
57 | QStringList discardCommand() const; |
58 | int restartStyleHint() const; |
59 | QString userId() const; |
60 | const char* clientId() { return id ? id : "" ; } |
61 | |
62 | private: |
63 | const char* id; |
64 | SmsConn smsConn; |
65 | }; |
66 | #endif |
67 | |