summaryrefslogtreecommitdiff
path: root/krfbserver.h
blob: 4ab68b2c819d85f85457b2896d160d9f7d9bf02f (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
/* This file is part of the KDE project
   Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
*/

#ifndef KRFBSERVER_H
#define KRFBSERVER_H

#include <QObject>
#include <rfb/rfb.h>

class ConnectionController;
/**
This class implements the listening server for the RFB protocol.

	@author Alessandro Praduroux <pradu@pradu.it>
*/
class KrfbServer : public QObject
{
Q_OBJECT
friend class KrfbServerPrivate;
public:

    static KrfbServer *self();

    ~KrfbServer();

    enum rfbNewClientAction handleNewClient(struct _rfbClientRec *cl);
    bool checkX11Capabilities();

signals:
    void sessionEstablished(QString);
    void sessionFinished();
    void desktopControlSettingChanged(bool);

public Q_SLOTS:

    void startListening();
    void processRfbEvents();
    void shutdown();
    void enableDesktopControl(bool);
    void updateSettings();
    void updatePassword();
    void clientDisconnected(ConnectionController *);

private:
    KrfbServer();
    static KrfbServer *_self;

    class KrfbServerP;
    KrfbServerP * const d;

};

#endif