1/*****************************************************************
2ksmserver - the KDE session management server
3
4Copyright 2000 Matthias Ettrich <ettrich@kde.org>
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21CONNECTION 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
37class KSMClient
38{
39public:
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
62private:
63 const char* id;
64 SmsConn smsConn;
65};
66#endif
67