blob: cc7ab05afb9eb6f58c8375adf3cbf6df10506980 (
plain) (
blame)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
#ifndef _CONNECTIONFRAME_H_
#define _CONNECTIONFRAME_H_
#include <QtGui>
class Client;
class ConnectionFrame : public QGroupBox
{
Q_OBJECT
private:
QString _computerId;
QBoxLayout *_mainLayout;
QBoxLayout *_iconLayout;
QLabel *_lblUserName;
QLabel *_lblHostName;
QLabel *_icoCam, *_icoEye;
QList<QLabel*> _icons;
QPixmap _remoteScreen;
QPoint _clickPoint;
QPoint _previousPosition;
Client *_client;
int _timerId, _timerCounter;
bool _selected;
bool _isTutor;
void showDefaultThumb();
void updateColor();
QLabel* addIcon(const QIcon* icon);
public:
ConnectionFrame(QWidget* parent, int width, int height);
virtual ~ConnectionFrame();
const QPixmap& getFramePixmap() const { return _remoteScreen; }
void setSize(int width, int height);
void assignClient(Client *client);
void setSelection(bool selected);
const inline bool selected() const { return _selected; }
const QString& computerId() const { return _computerId; }
Client* client() const { return _client; }
inline const bool isTutor() const { return _isTutor; }
void setTutor(bool b);
protected:
void mouseDoubleClickEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* e);
void enterEvent(QEvent* event);
void leaveEvent(QEvent* event);
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void paintEvent(QPaintEvent *event);
void timerEvent(QTimerEvent* event);
signals:
void frameMoved(ConnectionFrame* frame);
void doubleClicked(ConnectionFrame* frame);
void clicked(ConnectionFrame* frame);
private slots:
void onClientDisconnected();
void onThumbUpdated(Client* client, const QPixmap& thumb);
void onVncServerStateChange(Client* client);
void onVncClientStateChange(Client* client);
};
#endif
|