00001 /* 00002 * Copyright (c) 2012 Mateusz Piękos 00003 * Licensed under the simplified BSD license. 00004 * See Documentation/Licenses/BSD-simplified.txt for more information. 00005 */ 00006 00007 #pragma once 00008 00009 #include <Swiften/Elements/Whiteboard/WhiteboardElement.h> 00010 #include <Swiften/Elements/Whiteboard/WhiteboardColor.h> 00011 00012 namespace Swift { 00013 class WhiteboardRectElement : public WhiteboardElement { 00014 public: 00015 typedef boost::shared_ptr<WhiteboardRectElement> ref; 00016 public: 00017 WhiteboardRectElement(int x, int y, int width, int height) { 00018 x_ = x; 00019 y_ = y; 00020 width_ = width; 00021 height_ = height; 00022 } 00023 00024 int getX() const { 00025 return x_; 00026 } 00027 00028 int getY() const { 00029 return y_; 00030 } 00031 00032 int getWidth() const { 00033 return width_; 00034 } 00035 00036 int getHeight() const { 00037 return height_; 00038 } 00039 00040 const WhiteboardColor& getPenColor() const { 00041 return penColor_; 00042 } 00043 00044 void setPenColor(const WhiteboardColor& color) { 00045 penColor_ = color; 00046 } 00047 00048 const WhiteboardColor& getBrushColor() const { 00049 return brushColor_; 00050 } 00051 00052 void setBrushColor(const WhiteboardColor& color) { 00053 brushColor_ = color; 00054 } 00055 00056 int getPenWidth() const { 00057 return penWidth_; 00058 } 00059 00060 void setPenWidth(const int penWidth) { 00061 penWidth_ = penWidth; 00062 } 00063 00064 void accept(WhiteboardElementVisitor& visitor) { 00065 visitor.visit(*this); 00066 } 00067 00068 private: 00069 int x_, y_, width_, height_; 00070 WhiteboardColor penColor_; 00071 WhiteboardColor brushColor_; 00072 int penWidth_; 00073 }; 00074 }