summaryrefslogtreecommitdiffstats
path: root/src/server/connectionframe/connectionframe.h
diff options
context:
space:
mode:
authorsr2013-02-04 19:50:31 +0100
committersr2013-02-04 19:50:31 +0100
commit1a5709501f94014d41987b956338bb6424b9f90c (patch)
treed3b93fe8dc406bca56aff147ef5cc4cbf9ed6be0 /src/server/connectionframe/connectionframe.h
parentTest (diff)
downloadpvs2-1a5709501f94014d41987b956338bb6424b9f90c.tar.gz
pvs2-1a5709501f94014d41987b956338bb6424b9f90c.tar.xz
pvs2-1a5709501f94014d41987b956338bb6424b9f90c.zip
Initial commit
Diffstat (limited to 'src/server/connectionframe/connectionframe.h')
-rw-r--r--src/server/connectionframe/connectionframe.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/server/connectionframe/connectionframe.h b/src/server/connectionframe/connectionframe.h
new file mode 100644
index 0000000..2b78056
--- /dev/null
+++ b/src/server/connectionframe/connectionframe.h
@@ -0,0 +1,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; }
+ inline void setTutor(bool b) { _isTutor = 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(QObject* client);
+ void onThumbUpdated(Client* client, const QPixmap& thumb);
+ void onVncServerStateChange(Client* client);
+ void onVncClientStateChange(Client* client);
+};
+
+#endif