summaryrefslogtreecommitdiffstats
path: root/ksmserver/client.h
blob: e478cfc31be14caa1100c50900d3375ed215d04d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*****************************************************************
ksmserver - the KDE session management server

Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
******************************************************************/

#ifndef CLIENT_H
#define CLIENT_H

// needed to avoid clash with INT8 defined in X11/Xmd.h on solaris
#define QT_CLEAN_NAMESPACE 1
#include <tqobject.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include <tqsocketnotifier.h>
#include <tqptrlist.h>
#include <tqvaluelist.h>
#include <tqcstring.h>
#include <tqdict.h>
#include <tqptrqueue.h>
#include <tqptrdict.h>
#include <tdeapplication.h>
#include <tqtimer.h>
#include <tqdatetime.h>
#include <dcopobject.h>

#include "server2.h"

class KSMListener;
class KSMConnection;
class KSMClient
{
public:
    KSMClient( SmsConn );
    ~KSMClient();

    void registerClient( const char* previousId  = 0 );
    SmsConn connection() const { return smsConn; }

    void resetState();
    uint saveYourselfDone : 1;
    uint pendingInteraction : 1;
    uint waitForPhase2 : 1;
    uint wasPhase2 : 1;

    TQPtrList<SmProp> properties;
    SmProp* property( const char* name ) const;

    TQString program() const;
    TQStringList restartCommand() const;
    TQStringList discardCommand() const;
    int restartStyleHint() const;
    TQString userId() const;
    const char* clientId() { return id ? id : ""; }

    TQDateTime terminationRequestTimeStamp;

private:
    const char* id;
    SmsConn smsConn;
};

#endif