/* * Copyright (c) 2012 Mateusz Piękos * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GView.h" namespace Swift { class QtWhiteboardWindow : public QWidget, public WhiteboardWindow { Q_OBJECT; public: QtWhiteboardWindow(WhiteboardSession::ref whiteboardSession); void addItem(const std::string& item); void show(); void setSession(WhiteboardSession::ref session); void activateWindow(); private slots: void changeLineWidth(int i); void showColorDialog(); void showBrushColorDialog(); void setRubberMode(); void setLineMode(); void setRectMode(); void setCircleMode(); void setHandLineMode(); void setFilledHandLineMode(); void setTextMode(); void setPolygonMode(); void setSelectMode(); void handleLastItemChanged(QGraphicsItem* item); private: void handleSessionTerminate(); void closeEvent(QCloseEvent* event); private: QGraphicsScene* scene; GView* graphicsView; QVBoxLayout* layout; QVBoxLayout* sidebarLayout; QHBoxLayout* hLayout; QGridLayout* toolboxLayout; QWidget* widget; QPushButton* moveUpButton; QPushButton* moveDownButton; QPushButton* colorDialogButton; QPushButton* brushColorDialogButton; QSpinBox* widthBox; QToolButton* rubberButton; QToolButton* lineButton; QToolButton* rectButton; QToolButton* circleButton; QToolButton* handLineButton; QToolButton* filledHandLineButton; QToolButton* textButton; QToolButton* polygonButton; QToolButton* selectButton; WhiteboardSession::ref whiteboardSession_; }; }