diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-05-30 12:40:27 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-09-08 16:14:27 (GMT) |
commit | fe8a8aa031da734f3112184420b372021d9e10c7 (patch) | |
tree | 9f8e0b7d11d7612eb25a8682cf940fa647ca67f2 /Swift/QtUI/Whiteboard/QtWhiteboardWindow.h | |
parent | 0174723efbc1f612433d45c6916a2ad4596b96ba (diff) | |
download | swift-contrib-fe8a8aa031da734f3112184420b372021d9e10c7.zip swift-contrib-fe8a8aa031da734f3112184420b372021d9e10c7.tar.bz2 |
Support whiteboarding.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swift/QtUI/Whiteboard/QtWhiteboardWindow.h')
-rw-r--r-- | Swift/QtUI/Whiteboard/QtWhiteboardWindow.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h new file mode 100644 index 0000000..4665ef0 --- /dev/null +++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2012 Mateusz Piękos + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <Swift/Controllers/UIInterfaces/WhiteboardWindow.h> +#include <Swiften/Elements/Message.h> +#include <Swiften/Whiteboard/WhiteboardSession.h> +#include <Swiften/Elements/Whiteboard/WhiteboardElement.h> + +#include <QWidget> +#include <QGraphicsView> +#include <QGraphicsScene> +#include <QVBoxLayout> +#include <QHBoxLayout> +#include <QGridLayout> +#include <QPainter> +#include <QPushButton> +#include <QSpinBox> +#include <QColorDialog> +#include <QToolButton> +#include <QCloseEvent> + +#include "GView.h" +#include "ColorWidget.h" + +namespace Swift { + class QtWhiteboardWindow : public QWidget, public WhiteboardWindow + { + Q_OBJECT; + public: + QtWhiteboardWindow(WhiteboardSession::ref whiteboardSession); + void show(); + void setSession(WhiteboardSession::ref session); + void activateWindow(); + void setName(const std::string& name); + + private slots: + void changeLineWidth(int i); + void showColorDialog(); + void showBrushColorDialog(); + void setRubberMode(); + void setLineMode(); + void setRectMode(); + void setCircleMode(); + void setHandLineMode(); + void setTextMode(); + void setPolygonMode(); + void setSelectMode(); + void handleLastItemChanged(QGraphicsItem* item, int pos, GView::Type type); + void handleItemDeleted(QString id, int pos); + + private: + void handleSessionTerminate(); + void handleWhiteboardOperationReceive(const WhiteboardOperation::ref operation); + void closeEvent(QCloseEvent* event); + + private: + QGraphicsScene* scene; + GView* graphicsView; + QVBoxLayout* layout; + QVBoxLayout* sidebarLayout; + QHBoxLayout* hLayout; + QGridLayout* toolboxLayout; + QHBoxLayout* strokeLayout; + QHBoxLayout* fillLayout; + ColorWidget* strokeColor; + ColorWidget* fillColor; + QWidget* widget; + QPushButton* moveUpButton; + QPushButton* moveDownButton; + QSpinBox* widthBox; + QToolButton* rubberButton; + QToolButton* lineButton; + QToolButton* rectButton; + QToolButton* circleButton; + QToolButton* handLineButton; + QToolButton* textButton; + QToolButton* polygonButton; + QToolButton* selectButton; + + std::string lastOpID; + WhiteboardSession::ref whiteboardSession_; + }; +} |