#ifndef FRAME_H_ #define FRAME_H_ #include #include "../util/vncClientThread.h" class VNCClientThread; class ConnectionWindow; class ConnectionFrame; class MainWindow; class InputEvent; class Frame: public QLabel { Q_OBJECT public: Frame(const QString & text, QWidget * parent = 0 ); virtual ~Frame(); void setVNCThreadConnection(VNCClientThread * VNCclientThread); void stopVNCThreadConnection(); VNCClientThread * getVNCClientThread() { return _clientVNCThread; } void setConFrame (ConnectionFrame* cf) { _cFrame = cf; } ConnectionFrame* getConFrame() { return _cFrame; } void setToolButtonListVisible(bool visible); void setLockStatus(bool lock); bool getLockStatus() { return _isLocked; } bool isDozent() { return _dozent; } int X,Y; QString ip; QToolButton* button_closeUp; QToolButton* button_foto; QToolButton* button_lock; QToolButton* button_unlock; QToolButton* button_dozent; QToolButton* button_control; QToolButton* button_control_all; QList toolButtonList; bool _remoteControlEnabled; bool _remoteControlToAll; public Q_SLOTS: void updateImage(int x, int y, int w, int h); void iamDown(); void slotClicked(); QImage image() { return _clientImg; }; void setImage(QImage img) { _clientImg = img; }; QImage getImageForFoto(); void closeUp(); void foto(); void setLock(); //void unlock(); void setDozent(); void setCloseUp(bool value); private Q_SLOTS: void remoteControlClicked(); void remoteControlAllClicked(); void sendMouseMotionEvent(); void showSpecialEventMenu(); signals: void clicked(); protected: void paintEvent(QPaintEvent *event); void mousePressEvent ( QMouseEvent * event ); void mouseReleaseEvent ( QMouseEvent * event ); void mouseMoveEvent ( QMouseEvent * event ); void enterEvent(QEvent* event); void leaveEvent(QEvent* event); void keyPressEvent(QKeyEvent* event); void keyReleaseEvent(QKeyEvent* event); bool event(QEvent* event); private: QToolButton* createToolButton(const QString &toolTip, const QIcon &icon, const char *member); void addButton(QToolButton *button); VNCClientThread *_clientVNCThread; ConnectionFrame *_cFrame; QImage _clientImg; bool _isLocked; bool _dozent; int _ux, _uy; bool _isCloseUp; // for remote control: QPoint _lastRecordedMousePosition; bool _mousePositionChanged; QTimer* _mouseMotionEventTimer; bool _mouseOver; QTimer* _specialEventTimer; QPoint rescalePosition(QPointF guiPosition); void updateMousePosition(QMouseEvent* event); void sendInputEvent(InputEvent const&); }; #endif /* FRAME_H_ */