2007-04-04 14:57:27 +00:00
|
|
|
/* 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; version 2
|
|
|
|
|
of the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef CONNECTIONCONTROLLER_H
|
|
|
|
|
#define CONNECTIONCONTROLLER_H
|
|
|
|
|
|
2007-04-11 17:32:22 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2007-04-04 14:57:27 +00:00
|
|
|
#include <rfb/rfb.h>
|
|
|
|
|
|
|
|
|
|
class KrfbServer;
|
|
|
|
|
|
2007-04-05 17:16:17 +00:00
|
|
|
/**
|
|
|
|
|
@author Alessandro Praduroux <pradu@pradu.it>
|
|
|
|
|
*/
|
|
|
|
|
class ConnectionController : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2007-04-04 14:57:27 +00:00
|
|
|
public:
|
2007-04-06 21:45:19 +00:00
|
|
|
ConnectionController(struct _rfbClientRec *_cl, KrfbServer *parent);
|
2007-04-04 14:57:27 +00:00
|
|
|
|
2007-04-05 17:16:17 +00:00
|
|
|
~ConnectionController();
|
2007-04-04 14:57:27 +00:00
|
|
|
|
|
|
|
|
bool handleCheckPassword(rfbClientPtr cl, const char *response, int len);
|
|
|
|
|
void handleNegotiationFinished(struct _rfbClientRec *cl);
|
|
|
|
|
|
2007-04-05 20:21:15 +00:00
|
|
|
void handleKeyEvent(bool down , rfbKeySym keySym );
|
2007-04-04 14:57:27 +00:00
|
|
|
void handlePointerEvent( int bm, int x, int y);
|
|
|
|
|
void handleClientGone();
|
|
|
|
|
void clipboardToServer(const QString &);
|
2007-04-06 21:45:19 +00:00
|
|
|
|
|
|
|
|
enum rfbNewClientAction handleNewClient();
|
2007-04-04 14:57:27 +00:00
|
|
|
|
2007-04-10 20:40:44 +00:00
|
|
|
void setControlEnabled(bool enable);
|
|
|
|
|
|
2007-04-04 14:57:27 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
|
void sessionEstablished(QString);
|
|
|
|
|
void notification(QString, QString);
|
2007-04-15 15:53:18 +00:00
|
|
|
void clientDisconnected(ConnectionController *);
|
2007-04-04 14:57:27 +00:00
|
|
|
|
2007-04-06 21:45:19 +00:00
|
|
|
protected Q_SLOTS:
|
|
|
|
|
void dialogAccepted();
|
|
|
|
|
void dialogRejected();
|
2007-04-04 22:15:08 +00:00
|
|
|
|
2007-04-04 14:57:27 +00:00
|
|
|
private:
|
2007-04-06 21:45:19 +00:00
|
|
|
QString remoteIp;
|
|
|
|
|
struct _rfbClientRec *cl;
|
2007-04-10 20:40:44 +00:00
|
|
|
bool controlEnabled;
|
2007-04-06 21:45:19 +00:00
|
|
|
/*
|
2007-04-04 14:57:27 +00:00
|
|
|
int fd;
|
|
|
|
|
KrfbServer *server;
|
2007-04-04 22:15:08 +00:00
|
|
|
rfbScreenInfoPtr screen;
|
2007-04-05 17:16:17 +00:00
|
|
|
rfbClientPtr client;
|
2007-04-06 21:45:19 +00:00
|
|
|
QTcpSocket *tcpConn;
|
|
|
|
|
*/
|
2007-04-04 14:57:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|