#ifndef _CONNECTIONWINDOW_H_ #define _CONNECTIONWINDOW_H_ #include #include #include #include #include #include #include #include #include #define FRAME_DELAY 1000 // to comply with the standard value in the gui typedef std::pair clientLocation; typedef QList clientLocationList; class ConnectionList; class PVSClient; class PVSConnectionManager; class MainWindow; class ConnectionFrame; class QDragEnterEvent; class QDropEvent; class ConnectionWindow : public QWidget { Q_OBJECT public: enum FILLORDER { ROW, COLUMN, SQUARE, }; enum VIEWSTYLE { FULLSCREEN, TABLE, }; ConnectionWindow(QWidget *parent=0); ~ConnectionWindow(); void addFrame(ConnectionFrame *conFrame); void addFrameBySettings(QString client, QPoint pos); void showFrameFromSettings(); void onChangeConnections(); // if connections are added or removed, this method makes sure the window changes accordingly void addConnection(PVSClient* newCon); // handle newly connected clients (forward to con-list) void removeConnection(PVSClient* newCon); // Remove client on disconnect void onView(); void updateConnection(PVSClient* newCon); // update stuff like username etc on a present connection void addVNC(); void onVNCAdd(PVSClient* newCon); void removeVNC(); void onRemoveConnection(); // tells the PVSConnectionManager to remove the connections that are marked in the sidebar void onConnectionRemoved(PVSClient* newConnection); // does some cleanup and tells the gui elements that this connection is removed void setSize(int width, int height, bool forceSquare); // tell the frames to use this size settings void getCloseupSize(int &width, int &height); bool getShowDummies(); void setShowDummies(bool show); QList dummyList; QList AllFrameOnWindow; QList getAllFrameOnWindow() { return AllFrameOnWindow; } void removeFromList(ConnectionFrame* cF); bool remoteHelp(QString sname); bool projectStations(QString sname); bool unprojectStations(QString sname); bool lockStations(); void lockStation(PVSClient* pvsCon); bool unlockStations(); void unlockStation(PVSClient* pvsCon); bool lockAllStations(); bool unlockAllStations(); bool unprojectAllStations(); bool lockInvertStations(); void lockInvertStation(PVSClient* pvsCon); bool messageStations(QString ident, QString message); bool commandStations(QString ident, QString message); void messageStation(QString ident, QString message, PVSClient* pvsCon); bool lockStationsWithMessage(QString message); void lockStationsWithMessage(QString message, PVSClient* pvsCon); bool lockAllStationsWithMessage(QString message); void setCloseupFrame(ConnectionFrame* cFrame); int itemAt(ConnectionFrame* cf); ConnectionFrame* getCloseupFrame(); QList getFrameList(){ return frameList; }; clientLocationList ClientLocationList; bool hasDozent; //if a Dozent machine is available this will be set to true else false //Frame position in the window int posX; int posY; public Q_SLOTS: void addDummy(); protected: QList frameList; // list of all connected frames void mousePressEvent(QMouseEvent *event); private: ConnectionFrame* newConFrame(PVSClient* newConnection); // returns a new frame for the given connection ConnectionFrame* currentSingleFrame; // pointer to the frame thats currently in FullScreen QPointer _closeupFrame; QPoint currentPosition (ConnectionFrame* cF); QMenu *menu; QAction *newDummy; bool ignoreRatio; // wether the native ratio should be ignored or not bool onFullscreen; // wether on fullscreen or not bool onCloseup; // wether on closeup or not int defaultWidth, defaultHeight; // obvious unsigned int frameRate; // also obvious*/ bool _showDummies; }; #endif