Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreCustomWidget.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_CUSTOM_WIDGET__
8 #define __HDI_CORE_CUSTOM_WIDGET__
9 
10 #include <vector>
11 
12 #include "hdicoreColor.h"
13 #include "hdicoreWidget.h"
14 
15 #if defined(MAC_ENV)
16  @class NSGraphicsContext;
17 #elif defined(WIN_ENV)
18  class CDC;
19 #endif
20 
21 namespace hdi
22 {
23  namespace core
24  {
25  class Callback;
26 
27  #if defined(MAC_ENV)
28  typedef NSGraphicsContext* PlatformDrawingContextPtr;
29  #elif defined(WIN_ENV)
30  typedef CDC* PlatformDrawingContextPtr;
31  #endif
32 
37  class CustomWidget : public Widget
38  {
39  public:
40  typedef std::vector<Point> PointVector;
41 
53  CustomWidget();
54 
65  CustomWidget(const CustomWidget& widget_);
66 
74  CustomWidget(const Rect& frame_);
75 
81  virtual ~CustomWidget();
82 
91  virtual CustomWidget& operator=(const CustomWidget& rhs_);
92 
106  virtual CustomWidget* clone() const;
107 
118  virtual CustomWidget* duplicate() const;
119 
125  virtual void redraw();
126 
136  virtual ModifierKey getClickDragModifiers() const;
137 
149  virtual bool getClickDragLocations(Point& start__, Point& end__) const;
150 
159  virtual bool isMouseOver() const;
160 
168  virtual Callback* const mouseOverCallback() const;
169 
177  virtual void setMouseOverCallback(const Callback& cb_);
178 
186  virtual Callback* const mouseMoveCallback() const;
187 
195  virtual void setMouseMoveCallback(const Callback& cb_);
196 
204  virtual Callback* const mouseOutCallback() const;
205 
213  virtual void setMouseOutCallback(const Callback& cb_);
214 
222  virtual Callback* const mouseDownCallback() const;
223 
231  virtual void setMouseDownCallback(const Callback& cb_);
232 
240  virtual Callback* const mouseDragCallback() const;
241 
249  virtual void setMouseDragCallback(const Callback& cb_);
250 
258  virtual Callback* const mouseUpCallback() const;
259 
267  virtual void setMouseUpCallback(const Callback& cb_);
268 
276  PlatformDrawingContextPtr platformDC() const;
277 
285  virtual Callback* const drawCallback() const;
286 
294  virtual void setDrawCallback(const Callback& cb_);
295 
304  virtual bool clearsOnRedraw() const;
305 
317  virtual void setClearsOnRedraw(const bool clear_);
318 
329  virtual void setDrawColor(const Color& color_);
330 
342  virtual void drawLine(const Point& from_, const Point& to_);
343 
355  virtual void drawRect(const Rect& rect_, const bool fill_ = false);
356 
368  virtual void drawEllipse(const Rect& rect_, const bool fill_ = false);
369 
382  virtual void drawPolygon(const PointVector& points_, const bool fill_ = false);
383 
395  virtual void drawImage(const Point& tl_, const int16_t pngID_);
396  };
397 
398  typedef std::auto_ptr<CustomWidget> CustomWidgetAP;
399  }
400 }
401 
402 #endif
403 // __HDI_CORE_CUSTOM_WIDGET__
Header file for describing Illustrator UI colors.
Definition: hdicoreaiArray.h:12
Header file for Illustrator user interface widgets.