summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements/Whiteboard')
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardColor.cpp91
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardColor.h30
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h30
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardElement.h40
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h32
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h126
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h76
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h30
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardLineElement.h88
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardOperation.h86
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h82
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardRectElement.h126
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardTextElement.h86
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h52
14 files changed, 499 insertions, 476 deletions
diff --git a/Swiften/Elements/Whiteboard/WhiteboardColor.cpp b/Swiften/Elements/Whiteboard/WhiteboardColor.cpp
index f4ff01a..037fde4 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardColor.cpp
+++ b/Swiften/Elements/Whiteboard/WhiteboardColor.cpp
@@ -4,52 +4,59 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
-#include <Swiften/Base/String.h>
+
#include <cstdio>
#include <iomanip>
#include <sstream>
-#include <iostream>
+
+#include <Swiften/Base/String.h>
namespace Swift {
- WhiteboardColor::WhiteboardColor() : red_(0), green_(0), blue_(0), alpha_(255) {
- }
-
- WhiteboardColor::WhiteboardColor(int red, int green, int blue, int alpha) : red_(red), green_(green), blue_(blue), alpha_(alpha) {
- }
-
- WhiteboardColor::WhiteboardColor(const std::string& hex) : alpha_(255) {
- int value = String::convertHexStringToInt(hex.substr(1));
- red_ = (value >> 16)&0xFF;
- green_ = (value >> 8)&0xFF;
- blue_ = value&0xFF;
- }
-
- std::string WhiteboardColor::toHex() const {
- std::string value = String::convertIntToHexString((red_ << 16) + (green_ << 8) + blue_);
- while (value.size() < 6) {
- value.insert(0, "0");
- }
- return "#"+value;
- }
-
- int WhiteboardColor::getRed() const {
- return red_;
- }
-
- int WhiteboardColor::getGreen() const {
- return green_;
- }
-
- int WhiteboardColor::getBlue() const {
- return blue_;
- }
-
- int WhiteboardColor::getAlpha() const {
- return alpha_;
- }
-
- void WhiteboardColor::setAlpha(int alpha) {
- alpha_ = alpha;
- }
+ WhiteboardColor::WhiteboardColor() : red_(0), green_(0), blue_(0), alpha_(255) {
+ }
+
+ WhiteboardColor::WhiteboardColor(int red, int green, int blue, int alpha) : red_(red), green_(green), blue_(blue), alpha_(alpha) {
+ }
+
+ WhiteboardColor::WhiteboardColor(const std::string& hex) : alpha_(255) {
+ int value = String::convertHexStringToInt(hex.substr(1));
+ red_ = (value >> 16)&0xFF;
+ green_ = (value >> 8)&0xFF;
+ blue_ = value&0xFF;
+ }
+
+ std::string WhiteboardColor::toHex() const {
+ std::string value = String::convertIntToHexString((red_ << 16) + (green_ << 8) + blue_);
+ while (value.size() < 6) {
+ value.insert(0, "0");
+ }
+ return "#"+value;
+ }
+
+ int WhiteboardColor::getRed() const {
+ return red_;
+ }
+
+ int WhiteboardColor::getGreen() const {
+ return green_;
+ }
+
+ int WhiteboardColor::getBlue() const {
+ return blue_;
+ }
+
+ int WhiteboardColor::getAlpha() const {
+ return alpha_;
+ }
+
+ void WhiteboardColor::setAlpha(int alpha) {
+ alpha_ = alpha;
+ }
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardColor.h b/Swiften/Elements/Whiteboard/WhiteboardColor.h
index 3b3d93c..6402efd 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardColor.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardColor.h
@@ -11,20 +11,20 @@
#include <Swiften/Base/API.h>
namespace Swift {
- class SWIFTEN_API WhiteboardColor {
- public:
- WhiteboardColor();
- WhiteboardColor(int red, int green, int blue, int alpha = 255);
- WhiteboardColor(const std::string& hex);
- std::string toHex() const;
- int getRed() const;
- int getGreen() const;
- int getBlue() const;
- int getAlpha() const;
- void setAlpha(int alpha);
+ class SWIFTEN_API WhiteboardColor {
+ public:
+ WhiteboardColor();
+ WhiteboardColor(int red, int green, int blue, int alpha = 255);
+ WhiteboardColor(const std::string& hex);
+ std::string toHex() const;
+ int getRed() const;
+ int getGreen() const;
+ int getBlue() const;
+ int getAlpha() const;
+ void setAlpha(int alpha);
- private:
- int red_, green_, blue_;
- int alpha_;
- };
+ private:
+ int red_, green_, blue_;
+ int alpha_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h
index 297e75a..ae0fe17 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,23 +13,23 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class SWIFTEN_API WhiteboardDeleteOperation : public WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardDeleteOperation> ref;
- public:
- std::string getElementID() const {
- return elementID_;
- }
+ class SWIFTEN_API WhiteboardDeleteOperation : public WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardDeleteOperation> ref;
+ public:
+ std::string getElementID() const {
+ return elementID_;
+ }
- void setElementID(const std::string& elementID) {
- elementID_ = elementID;
- }
+ void setElementID(const std::string& elementID) {
+ elementID_ = elementID;
+ }
- private:
- std::string elementID_;
- };
+ private:
+ std::string elementID_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardElement.h b/Swiften/Elements/Whiteboard/WhiteboardElement.h
index df774d9..6f6ff4f 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardElement.h
@@ -4,29 +4,37 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+
#include <Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h>
namespace Swift {
- class WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardElement> ref;
+ class WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardElement> ref;
- public:
- virtual ~WhiteboardElement() {}
- virtual void accept(WhiteboardElementVisitor& visitor) = 0;
+ public:
+ virtual ~WhiteboardElement() {}
+ virtual void accept(WhiteboardElementVisitor& visitor) = 0;
- const std::string& getID() const {
- return id_;
- }
+ const std::string& getID() const {
+ return id_;
+ }
- void setID(const std::string& id) {
- id_ = id;
- }
+ void setID(const std::string& id) {
+ id_ = id;
+ }
- private:
- std::string id_;
- };
+ private:
+ std::string id_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h b/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h
index 413d6cf..090af56 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h
@@ -7,21 +7,21 @@
#pragma once
namespace Swift {
- class WhiteboardLineElement;
- class WhiteboardFreehandPathElement;
- class WhiteboardRectElement;
- class WhiteboardPolygonElement;
- class WhiteboardTextElement;
- class WhiteboardEllipseElement;
+ class WhiteboardLineElement;
+ class WhiteboardFreehandPathElement;
+ class WhiteboardRectElement;
+ class WhiteboardPolygonElement;
+ class WhiteboardTextElement;
+ class WhiteboardEllipseElement;
- class WhiteboardElementVisitor {
- public:
- virtual ~WhiteboardElementVisitor() {}
- virtual void visit(WhiteboardLineElement& /*element*/) = 0;
- virtual void visit(WhiteboardFreehandPathElement& /*element*/) = 0;
- virtual void visit(WhiteboardRectElement& /*element*/) = 0;
- virtual void visit(WhiteboardPolygonElement& /*element*/) = 0;
- virtual void visit(WhiteboardTextElement& /*element*/) = 0;
- virtual void visit(WhiteboardEllipseElement& /*element*/) = 0;
- };
+ class WhiteboardElementVisitor {
+ public:
+ virtual ~WhiteboardElementVisitor() {}
+ virtual void visit(WhiteboardLineElement& /*element*/) = 0;
+ virtual void visit(WhiteboardFreehandPathElement& /*element*/) = 0;
+ virtual void visit(WhiteboardRectElement& /*element*/) = 0;
+ virtual void visit(WhiteboardPolygonElement& /*element*/) = 0;
+ virtual void visit(WhiteboardTextElement& /*element*/) = 0;
+ virtual void visit(WhiteboardEllipseElement& /*element*/) = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h b/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h
index 88d0907..8086aed 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,69 +13,69 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class SWIFTEN_API WhiteboardEllipseElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardEllipseElement> ref;
- public:
- WhiteboardEllipseElement(int cx, int cy, int rx, int ry) {
- cx_ = cx;
- cy_ = cy;
- rx_ = rx;
- ry_ = ry;
- }
-
- int getCX() const {
- return cx_;
- }
-
- int getCY() const {
- return cy_;
- }
-
- int getRX() const {
- return rx_;
- }
-
- int getRY() const {
- return ry_;
- }
-
- const WhiteboardColor& getPenColor() const {
- return penColor_;
- }
-
- void setPenColor(const WhiteboardColor& color) {
- penColor_ = color;
- }
-
- const WhiteboardColor& getBrushColor() const {
- return brushColor_;
- }
-
- void setBrushColor(const WhiteboardColor& color) {
- brushColor_ = color;
- }
-
- int getPenWidth() const {
- return penWidth_;
- }
-
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
-
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
-
- private:
- int cx_, cy_, rx_, ry_;
- WhiteboardColor penColor_;
- WhiteboardColor brushColor_;
- int penWidth_;
- };
+ class SWIFTEN_API WhiteboardEllipseElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardEllipseElement> ref;
+ public:
+ WhiteboardEllipseElement(int cx, int cy, int rx, int ry) {
+ cx_ = cx;
+ cy_ = cy;
+ rx_ = rx;
+ ry_ = ry;
+ }
+
+ int getCX() const {
+ return cx_;
+ }
+
+ int getCY() const {
+ return cy_;
+ }
+
+ int getRX() const {
+ return rx_;
+ }
+
+ int getRY() const {
+ return ry_;
+ }
+
+ const WhiteboardColor& getPenColor() const {
+ return penColor_;
+ }
+
+ void setPenColor(const WhiteboardColor& color) {
+ penColor_ = color;
+ }
+
+ const WhiteboardColor& getBrushColor() const {
+ return brushColor_;
+ }
+
+ void setBrushColor(const WhiteboardColor& color) {
+ brushColor_ = color;
+ }
+
+ int getPenWidth() const {
+ return penWidth_;
+ }
+
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
+
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
+
+ private:
+ int cx_, cy_, rx_, ry_;
+ WhiteboardColor penColor_;
+ WhiteboardColor brushColor_;
+ int penWidth_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h b/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h
index 6e200fd..bc6c846 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h
@@ -5,60 +5,60 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <utility>
+#include <vector>
+
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
-
-#include <vector>
-#include <utility>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class SWIFTEN_API WhiteboardFreehandPathElement : public WhiteboardElement {
- typedef std::pair<int, int> Point;
- public:
- typedef boost::shared_ptr<WhiteboardFreehandPathElement> ref;
- public:
- WhiteboardFreehandPathElement() {
- }
+ class SWIFTEN_API WhiteboardFreehandPathElement : public WhiteboardElement {
+ typedef std::pair<int, int> Point;
+ public:
+ typedef std::shared_ptr<WhiteboardFreehandPathElement> ref;
+ public:
+ WhiteboardFreehandPathElement() {
+ }
- void setPoints(const std::vector<Point>& points) {
- points_ = points;
- }
+ void setPoints(const std::vector<Point>& points) {
+ points_ = points;
+ }
- const std::vector<Point>& getPoints() const {
- return points_;
- }
+ const std::vector<Point>& getPoints() const {
+ return points_;
+ }
- const WhiteboardColor& getColor() const {
- return color_;
- }
+ const WhiteboardColor& getColor() const {
+ return color_;
+ }
- void setColor(const WhiteboardColor& color) {
- color_ = color;
- }
+ void setColor(const WhiteboardColor& color) {
+ color_ = color;
+ }
- int getPenWidth() const {
- return penWidth_;
- }
+ int getPenWidth() const {
+ return penWidth_;
+ }
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
- private:
- std::vector<Point> points_;
- WhiteboardColor color_;
- int penWidth_;
- };
+ private:
+ std::vector<Point> points_;
+ WhiteboardColor color_;
+ int penWidth_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h
index d52adc2..256c17e 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,23 +13,23 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class SWIFTEN_API WhiteboardInsertOperation : public WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardInsertOperation> ref;
- public:
- WhiteboardElement::ref getElement() const {
- return element_;
- }
+ class SWIFTEN_API WhiteboardInsertOperation : public WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardInsertOperation> ref;
+ public:
+ WhiteboardElement::ref getElement() const {
+ return element_;
+ }
- void setElement(WhiteboardElement::ref element) {
- element_ = element;
- }
+ void setElement(WhiteboardElement::ref element) {
+ element_ = element;
+ }
- private:
- WhiteboardElement::ref element_;
- };
+ private:
+ WhiteboardElement::ref element_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
index 267fb33..9c64977 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2014-2015 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -14,60 +14,60 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class SWIFTEN_API WhiteboardLineElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardLineElement> ref;
- public:
- WhiteboardLineElement(int x1, int y1, int x2, int y2) : penWidth_(1) {
- x1_ = x1;
- y1_ = y1;
- x2_ = x2;
- y2_ = y2;
- }
+ class SWIFTEN_API WhiteboardLineElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardLineElement> ref;
+ public:
+ WhiteboardLineElement(int x1, int y1, int x2, int y2) : penWidth_(1) {
+ x1_ = x1;
+ y1_ = y1;
+ x2_ = x2;
+ y2_ = y2;
+ }
- int x1() const {
- return x1_;
- }
+ int x1() const {
+ return x1_;
+ }
- int y1() const {
- return y1_;
- }
+ int y1() const {
+ return y1_;
+ }
- int x2() const {
- return x2_;
- }
+ int x2() const {
+ return x2_;
+ }
- int y2() const {
- return y2_;
- }
+ int y2() const {
+ return y2_;
+ }
- const WhiteboardColor& getColor() const {
- return color_;
- }
+ const WhiteboardColor& getColor() const {
+ return color_;
+ }
- void setColor(const WhiteboardColor& color) {
- color_ = color;
- }
+ void setColor(const WhiteboardColor& color) {
+ color_ = color;
+ }
- int getPenWidth() const {
- return penWidth_;
- }
+ int getPenWidth() const {
+ return penWidth_;
+ }
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
- private:
- int x1_, y1_, x2_, y2_;
- WhiteboardColor color_;
- int penWidth_;
- };
+ private:
+ int x1_, y1_, x2_, y2_;
+ WhiteboardColor color_;
+ int penWidth_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardOperation.h b/Swiften/Elements/Whiteboard/WhiteboardOperation.h
index 497d551..2e90c69 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardOperation.h
@@ -4,48 +4,56 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <Swiften/Base/API.h>
-#include <boost/smart_ptr/shared_ptr.hpp>
#include <string>
+#include <boost/smart_ptr/shared_ptr.hpp>
+
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardOperation> ref;
- public:
- WhiteboardOperation() {}
- SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(WhiteboardOperation)
- virtual ~WhiteboardOperation(){}
-
- std::string getID() const {
- return id_;
- }
-
- void setID(const std::string& id) {
- id_ = id;
- }
-
- std::string getParentID() const {
- return parentID_;
- }
-
- void setParentID(const std::string& parentID) {
- parentID_ = parentID;
- }
-
- int getPos() const {
- return pos_;
- }
-
- void setPos(int pos) {
- pos_ = pos;
- }
-
- private:
- std::string id_;
- std::string parentID_;
- int pos_;
- };
+ class WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardOperation> ref;
+ public:
+ WhiteboardOperation() {}
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(WhiteboardOperation)
+ virtual ~WhiteboardOperation(){}
+
+ std::string getID() const {
+ return id_;
+ }
+
+ void setID(const std::string& id) {
+ id_ = id;
+ }
+
+ std::string getParentID() const {
+ return parentID_;
+ }
+
+ void setParentID(const std::string& parentID) {
+ parentID_ = parentID;
+ }
+
+ int getPos() const {
+ return pos_;
+ }
+
+ void setPos(int pos) {
+ pos_ = pos;
+ }
+
+ private:
+ std::string id_;
+ std::string parentID_;
+ int pos_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h b/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h
index 38bc3e1..6ad5dc7 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -19,54 +19,54 @@
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class SWIFTEN_API WhiteboardPolygonElement : public WhiteboardElement {
- typedef std::pair<int, int> Point;
- public:
- typedef boost::shared_ptr<WhiteboardPolygonElement> ref;
- public:
- WhiteboardPolygonElement() {
- }
+ class SWIFTEN_API WhiteboardPolygonElement : public WhiteboardElement {
+ typedef std::pair<int, int> Point;
+ public:
+ typedef std::shared_ptr<WhiteboardPolygonElement> ref;
+ public:
+ WhiteboardPolygonElement() {
+ }
- const std::vector<Point>& getPoints() const {
- return points_;
- }
+ const std::vector<Point>& getPoints() const {
+ return points_;
+ }
- void setPoints(const std::vector<Point>& points) {
- points_ = points;
- }
+ void setPoints(const std::vector<Point>& points) {
+ points_ = points;
+ }
- const WhiteboardColor& getPenColor() const {
- return penColor_;
- }
+ const WhiteboardColor& getPenColor() const {
+ return penColor_;
+ }
- void setPenColor(const WhiteboardColor& color) {
- penColor_ = color;
- }
+ void setPenColor(const WhiteboardColor& color) {
+ penColor_ = color;
+ }
- const WhiteboardColor& getBrushColor() const {
- return brushColor_;
- }
+ const WhiteboardColor& getBrushColor() const {
+ return brushColor_;
+ }
- void setBrushColor(const WhiteboardColor& color) {
- brushColor_ = color;
- }
+ void setBrushColor(const WhiteboardColor& color) {
+ brushColor_ = color;
+ }
- int getPenWidth() const {
- return penWidth_;
- }
+ int getPenWidth() const {
+ return penWidth_;
+ }
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
- private:
- std::vector<Point> points_;
- WhiteboardColor penColor_;
- WhiteboardColor brushColor_;
- int penWidth_;
- };
+ private:
+ std::vector<Point> points_;
+ WhiteboardColor penColor_;
+ WhiteboardColor brushColor_;
+ int penWidth_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
index f22ab5c..4dcdc8a 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2014-2015 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,69 +13,69 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class SWIFTEN_API WhiteboardRectElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardRectElement> ref;
- public:
- WhiteboardRectElement(int x, int y, int width, int height) : penWidth_(1) {
- x_ = x;
- y_ = y;
- width_ = width;
- height_ = height;
- }
-
- int getX() const {
- return x_;
- }
-
- int getY() const {
- return y_;
- }
-
- int getWidth() const {
- return width_;
- }
-
- int getHeight() const {
- return height_;
- }
-
- const WhiteboardColor& getPenColor() const {
- return penColor_;
- }
-
- void setPenColor(const WhiteboardColor& color) {
- penColor_ = color;
- }
-
- const WhiteboardColor& getBrushColor() const {
- return brushColor_;
- }
-
- void setBrushColor(const WhiteboardColor& color) {
- brushColor_ = color;
- }
-
- int getPenWidth() const {
- return penWidth_;
- }
-
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
-
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
-
- private:
- int x_, y_, width_, height_;
- WhiteboardColor penColor_;
- WhiteboardColor brushColor_;
- int penWidth_;
- };
+ class SWIFTEN_API WhiteboardRectElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardRectElement> ref;
+ public:
+ WhiteboardRectElement(int x, int y, int width, int height) : penWidth_(1) {
+ x_ = x;
+ y_ = y;
+ width_ = width;
+ height_ = height;
+ }
+
+ int getX() const {
+ return x_;
+ }
+
+ int getY() const {
+ return y_;
+ }
+
+ int getWidth() const {
+ return width_;
+ }
+
+ int getHeight() const {
+ return height_;
+ }
+
+ const WhiteboardColor& getPenColor() const {
+ return penColor_;
+ }
+
+ void setPenColor(const WhiteboardColor& color) {
+ penColor_ = color;
+ }
+
+ const WhiteboardColor& getBrushColor() const {
+ return brushColor_;
+ }
+
+ void setBrushColor(const WhiteboardColor& color) {
+ brushColor_ = color;
+ }
+
+ int getPenWidth() const {
+ return penWidth_;
+ }
+
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
+
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
+
+ private:
+ int x_, y_, width_, height_;
+ WhiteboardColor penColor_;
+ WhiteboardColor brushColor_;
+ int penWidth_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardTextElement.h b/Swiften/Elements/Whiteboard/WhiteboardTextElement.h
index bd9b579..2e1c145 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardTextElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardTextElement.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,59 +13,59 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class SWIFTEN_API WhiteboardTextElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardTextElement> ref;
- public:
- WhiteboardTextElement(int x, int y) {
- x_ = x;
- y_ = y;
- }
+ class SWIFTEN_API WhiteboardTextElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardTextElement> ref;
+ public:
+ WhiteboardTextElement(int x, int y) {
+ x_ = x;
+ y_ = y;
+ }
- void setText(const std::string text) {
- text_ = text;
- }
+ void setText(const std::string text) {
+ text_ = text;
+ }
- const std::string& getText() const {
- return text_;
- }
+ const std::string& getText() const {
+ return text_;
+ }
- int getX() const {
- return x_;
- }
+ int getX() const {
+ return x_;
+ }
- int getY() const {
- return y_;
- }
+ int getY() const {
+ return y_;
+ }
- const WhiteboardColor& getColor() const {
- return color_;
- }
+ const WhiteboardColor& getColor() const {
+ return color_;
+ }
- void setColor(const WhiteboardColor& color) {
- color_ = color;
- }
+ void setColor(const WhiteboardColor& color) {
+ color_ = color;
+ }
- int getSize() const {
- return size_;
- }
+ int getSize() const {
+ return size_;
+ }
- void setSize(const int size) {
- size_ = size;
- }
+ void setSize(const int size) {
+ size_ = size;
+ }
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
- private:
- int x_, y_;
- int size_;
- std::string text_;
- WhiteboardColor color_;
- };
+ private:
+ int x_, y_;
+ int size_ = 0;
+ std::string text_;
+ WhiteboardColor color_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h
index af07e8f..36cbc6d 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,32 +13,32 @@
#pragma once
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class SWIFTEN_API WhiteboardUpdateOperation : public WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardUpdateOperation> ref;
- public:
- WhiteboardElement::ref getElement() const {
- return element_;
- }
-
- void setElement(WhiteboardElement::ref element) {
- element_ = element;
- }
-
- int getNewPos() const {
- return newPos_;
- }
-
- void setNewPos(int newPos) {
- newPos_ = newPos;
- }
-
- private:
- WhiteboardElement::ref element_;
- int newPos_;
- };
+ class SWIFTEN_API WhiteboardUpdateOperation : public WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardUpdateOperation> ref;
+ public:
+ WhiteboardElement::ref getElement() const {
+ return element_;
+ }
+
+ void setElement(WhiteboardElement::ref element) {
+ element_ = element;
+ }
+
+ int getNewPos() const {
+ return newPos_;
+ }
+
+ void setNewPos(int newPos) {
+ newPos_ = newPos;
+ }
+
+ private:
+ WhiteboardElement::ref element_;
+ int newPos_ = 0;
+ };
}