Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreDraggableDivider.h
1#ifndef __HDI_CORE_DRAGGABLE_DIVIDER__
2#define __HDI_CORE_DRAGGABLE_DIVIDER__
3
5
6namespace hdi
7{
8 namespace core
9 {
15 {
16 public:
21 {
22 UnknownDirection = 0,
23 Horizontal = 10,
24 Vertical = 20
25 };
26
39
49
58 DraggableDivider(const Point& loc_, const Direction dir_);
59
66
76
90 virtual DraggableDivider* clone() const;
91
102 virtual DraggableDivider* duplicate() const;
103
111 virtual Direction direction() const;
112
120 virtual std::string text() const;
121
127 virtual void setText(const std::string&);
128
136 virtual bool enabled();
137
145 virtual void setEnabled(const bool enable_);
146
154 virtual Callback* const movedCallback() const;
155
164 virtual void setMovedCallback(const Callback& cb_);
165
166
167 private:
168 // All of these are made private because they are unnecessary for this subclass
169 void redraw();
170 ModifierKey getClickDragModifiers() const;
171 bool getClickDragLocations(Point& start__, Point& end__) const;
172 bool isMouseOver() const;
173 Callback* const mouseOverCallback() const;
174 void setMouseOverCallback(const Callback& cb_);
175 Callback* const mouseMoveCallback() const;
176 void setMouseMoveCallback(const Callback& cb_);
177 Callback* const mouseOutCallback() const;
178 void setMouseOutCallback(const Callback& cb_);
179 Callback* const mouseDownCallback() const;
180 void setMouseDownCallback(const Callback& cb_);
181 Callback* const mouseDragCallback() const;
182 void setMouseDragCallback(const Callback& cb_);
183 Callback* const mouseUpCallback() const;
184 void setMouseUpCallback(const Callback& cb_);
185 Callback* const drawCallback() const;
186 void setDrawCallback(const Callback& cb_);
187 bool clearsOnRedraw() const;
188 void setClearsOnRedraw(const bool clear_);
189 void setDrawColor(const Color& color_);
190 void drawLine(const Point& from_, const Point& to_);
191 void drawRect(const Rect& rect_, const bool fill_ = false);
192 void drawPolygon(const PointVector& points_, const bool fill_ = false);
193 };
194
195 typedef std::unique_ptr<DraggableDivider> DraggableDividerUP;
196 typedef std::shared_ptr<DraggableDivider> DraggableDividerSP;
197 typedef std::weak_ptr<DraggableDivider> DraggableDividerWP;
198 }
199}
200
201#endif
202// __HDI_CORE_DRAGGABLE_DIVIDER__
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:32
Class for custom plugin widgets; receives notification of a variety of events, can be custom drawn,...
Definition: hdicoreCustomWidget.h:35
Class for draggable divider lines, which are of a standard length, and used for resizing e....
Definition: hdicoreDraggableDivider.h:15
virtual DraggableDivider * clone() const
Convenience method to clone a DraggableDivider object on the heap.
Direction
Describes the direction of the line in a DraggableDivider object.
Definition: hdicoreDraggableDivider.h:21
virtual DraggableDivider & operator=(const DraggableDivider &rhs_)
Allows one DraggableDivider object to be assigned from another.
virtual std::string text() const
Always gets "", as dividers cannot have text.
DraggableDivider(const Point &loc_, const Direction dir_)
DraggableDivider constructor, taking an argument for the location and direction.
DraggableDivider(const DraggableDivider &widget_)
Constructs a new DraggableDivider object from an existing DraggableDivider object (copy constructor)
virtual Callback *const movedCallback() const
Gets the callback for the widget being moved during a mouse drag event.
DraggableDivider()
Constructs an empty DraggableDivider object.
virtual void setText(const std::string &)
Prevents setting the text, as dividers cannot have text.
virtual void setMovedCallback(const Callback &cb_)
Sets the callback for the widget being moved during a mouse drag event.
virtual void setEnabled(const bool enable_)
Overrides Widget::setEnabled() because dividers are always enabled.
virtual Direction direction() const
Gets the direction that the line is going.
virtual bool enabled()
Returns true, because dividers are always enabled.
virtual ~DraggableDivider()
DraggableDivider destructor.
virtual DraggableDivider * duplicate() const
Convenience method to duplicate a DraggableDivider object, creating a new and identical UI element to...
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Header file for plugin user interface custom widgets.
ModifierKey
Describes various modifier keys.
Definition: hdicoreTypes.h:898