summaryrefslogtreecommitdiffstats
path: root/src/gui/connectionFrame.h
diff options
context:
space:
mode:
authorSebastian2010-05-12 19:42:27 +0200
committerSebastian2010-05-12 19:42:27 +0200
commitce3329047d378a14006ce74ec273ac59e3375303 (patch)
tree782430f270b4c7aca1b35d5b7813518e3797c555 /src/gui/connectionFrame.h
downloadpvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.gz
pvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.xz
pvs-ce3329047d378a14006ce74ec273ac59e3375303.zip
initial import of latest svn version
Diffstat (limited to 'src/gui/connectionFrame.h')
-rw-r--r--src/gui/connectionFrame.h199
1 files changed, 199 insertions, 0 deletions
diff --git a/src/gui/connectionFrame.h b/src/gui/connectionFrame.h
new file mode 100644
index 0000000..a199102
--- /dev/null
+++ b/src/gui/connectionFrame.h
@@ -0,0 +1,199 @@
+#ifndef _CONNECTIONFRAME_H_
+#define _CONNECTIONFRAME_H_
+#include <QtGui>
+#include <fstream>
+#include <iostream>
+#include <QImage>
+#include <QPixmap>
+#include <QLabel>
+#include <src/core/pvsClient.h>
+#include <src/gui/frame.h>
+//#include <src/gui/mainWindow.h>
+#include <src/gui/dialog.h>
+extern "C"
+{
+#include <rfb/rfbclient.h>
+}
+
+#define PROFILE
+#include <src/util/timeUtil.h>
+
+/**
+ * Container for the drawable area that shows the corresponding servers desktop
+ *
+ */
+
+class PVSClient;
+class VNCConnection;
+class ConnectionWindow;
+class Frame;
+class Dialog;
+class MainWindow;
+
+class ConnectionFrame : public QGroupBox
+{
+
+ Q_OBJECT
+
+public:
+ ConnectionFrame(QWidget* parent=0); // on width and height being zero, defaults values are used
+ virtual ~ConnectionFrame();
+
+ QString getTitle();
+ void setTheTitle(QString title);
+ QString getTaskbarTitle();
+ void setTaskbarTitle(QString title);
+ void setInitSize(int w, int h);
+ void Resize(int w, int h);
+ void initFrame();
+
+ int getPrevWidth(){return prev_width;};
+ void setPrevWidth(int w){prev_width = w;}
+ int getPrevHeight(){return prev_height;};
+ void setPrevHeight(int h){prev_height = h;}
+
+ void setConnection(PVSClient* newConnection);
+ void resetConnectionWithQuality(int quality);
+ PVSClient* getConnection()
+ {
+ return _myConnection;
+ }
+ ;
+ //bool drawFrame(); // call to ask for a redraw of the frames content
+ void setIgnoreRatio(bool ignore); // sets wether it should force square on the content or not
+ void setFullscreen(bool fs); // toggles wether this frame is requested to shown fullscreen or not
+ bool getFullscreen()
+ {
+ return _fullscreen;
+ }
+ ; // returns wether the frame is fullscreen (or requested to be) or not
+ void setCloseup(bool cu); // toggles wether this frame is requested to shown fullscreen or not
+ bool getCloseup()
+ {
+ return _closeup;
+ }
+ ; // returns wether the frame is fullscreen (or requested to be) or not
+
+ void setInteractive(bool doit);
+ float getRatio()
+ {
+ return _ratio;
+ }
+ ; // returns the native ratio of the source buffer (h/w)
+ void setRatio(int newRatio)
+ {
+ _ratio = newRatio;
+ }
+ ;
+ bool getOversized()
+ {
+ return overSized;
+ }
+ ; // returns wether the frame is reasonably wider than other frames (e.g. dual screen displays)
+ void setOversized(bool over)
+ {
+ overSized = over;
+ }
+ ;
+ void setActive(bool activate);
+ bool getActive()
+ {
+ return active;
+ }
+ ;
+ void setDummy(bool dummy);
+ bool isDummy()
+ {
+ return _dummy;
+ }
+ ;
+ bool isOnProjekt()
+ {
+ return _isOnProjekt;
+ }
+ ;
+ void setFrameRate(int newRate);
+ bool isClientOnline;
+ void paintCloseUp(int w, int h);
+ void resizeComponent(int w, int h);
+ void setSource();
+ void setTarget();
+ void setUnproject();
+ void setDozent(bool isDozent);
+ const QPixmap* getFramePixmap();
+ Frame* getFrame();
+ int init_w, init_h;
+
+public Q_SLOTS:
+ virtual void delDummy();
+ virtual void on_projection();
+ virtual void on_unprojection();
+ virtual void on_lock();
+ virtual void on_unlock();
+ virtual void on_message();
+ virtual void on_lock_with_message();
+ virtual void on_lock_all_with_message();
+ virtual void on_lock_all();
+ virtual void on_unlock_all();
+ virtual void on_lock_invert();
+ virtual void on_remoteHelp();
+ virtual void on_click();
+
+protected:
+ //virtual void paintEvent(QPaintEvent *event);
+ void mouseReleaseEvent ( QMouseEvent * e );
+ virtual void enterEvent ( QEvent * event );
+ virtual void leaveEvent ( QEvent * event );
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ //void mouseReleaseEvent ( QMouseEvent * event );
+
+private:
+
+ Frame *_frame;
+ //clickableLabel *frame;
+ QSplitter *_split;
+ QGridLayout* _gL;
+ QLabel* _username;
+ QLabel* _status;
+ QLabel* _dozentContaimner;
+ QWidget* _conFrameTaskbar;
+ QGridLayout* _gLayout;
+ QHBoxLayout* _hLayoutInCfTaskbar;
+
+ PVSClient* _myConnection;
+ QPixmap _clientPix;
+ QPixmap _clientStatus;
+ QPixmap _clientDozent;
+ int nat_height, nat_width; // native height and width of the source buffer
+ int cu_height, cu_width;
+ int prev_height, prev_width;
+ // uint8_t prev_buttonMask; /* bits 0-7 are buttons 1-8, 0=up, 1=down */
+ int _ratio;
+ bool _dummy;
+ bool ignore_ratio, overSized, first;
+ bool _fullscreen, _closeup, _isOnProjekt;
+
+ bool viewOnly, active;
+ rfbClient* myClient;
+
+ QMenu *menu;
+ QAction *DelDummy;
+ QAction *lockClient ;
+ QAction *uLockClient ;
+ /*QAction *invertlockClient ;
+ QAction *LockAllClient ;
+ QAction *uLockAllClient ;*/
+ QAction *msgLockAllClient ;
+ QAction *msgClient ;
+ QAction *msgLockClient ;
+ QAction *project ;
+ QAction *uproject ;
+ //QAction *rHelp ;
+
+
+ QPoint _clickPoint;
+ QPoint _previousPoint;
+};
+
+#endif