Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreEyeDropperTool.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_EYE_DROPPER_TOOL__
8 #define __HDI_CORE_EYE_DROPPER_TOOL__
9 
10 #include "hdicoreMacros.h"
11 
12 #include "hdicoreCursor.h"
13 #include "hdicorePathStyle.h"
14 #include "hdicoreTool.h"
15 
16 namespace hdi
17 {
18  namespace core
19  {
20  class PathStyle;
21 
41  {
42  public:
50  static EyeDropperTool* const create();
51 
61  static EyeDropperTool* const instance();
62 
68  static void destroy();
69 
81  virtual AIToolHandle aiToolHandle() const;
82 
90  virtual bool selected() const;
91 
98  virtual void select();
99 
105  virtual void deselect();
106 
114  virtual std::string title() const;
115 
123  virtual std::string tip() const;
124 
134  virtual ArtboardPoint cursorLoc() const;
135 
143  virtual Callback* const trackCallback() const;
144 
152  virtual void setTrackCallback(const Callback& cb_);
153 
161  virtual Callback* const dragCallback() const;
162 
170  virtual void setDragCallback(const Callback& cb_);
171 
179  virtual Callback* const mouseUpCallback() const;
180 
188  virtual void setMouseUpCallback(const Callback& cb_);
189 
200  virtual bool shiftKeyDown() const;
201 
215  virtual bool commandKeyDown() const;
216 
228  virtual bool optionKeyDown() const;
229 
240  virtual bool controlKeyDown() const;
241 
257  virtual PathStyle currentStyle() const;
258 
259 
260  private:
264  static EyeDropperTool* __instance;
265 
269  bool __firing;
270 
274  Tool __tool;
275 
279  Cursor __cursor;
280 
284  std::string __prevTool;
285 
289  bool __oldArtSnap;
290 
294  bool __oldArtBoundsSnap;
295 
299  bool __oldArtboardSnap;
300 
304  bool __oldGridSnap;
305 
309  Callback* __trackCB;
310 
314  Callback* __dragCB;
315 
319  Callback* __mouseUpCB;
320 
326  EyeDropperTool();
327 
334 
340  ~EyeDropperTool();
341 
347  EyeDropperTool& operator=(const EyeDropperTool&);
348 
354  void __deselected();
355 
361  void __track();
362 
368  void __drag();
369 
375  void __mouseUp();
376 
382  ArtColor __cursorColor() const;
383  };
384  }
385 }
386 
387 #endif
388 // __HDI_CORE_EYE_DROPPER_TOOL__
Hidden eye dropper tool, to be used programmatically only, that allows for selection of a color from ...
Definition: hdicoreEyeDropperTool.h:40
virtual Callback *const mouseUpCallback() const
Gets the registered callback for the mouse up event.
virtual std::string tip() const
Gets the eye dropper tool's tip string.
virtual void setDragCallback(const Callback &cb_)
Sets the callback for the drag event.
Describes all styling attributes of a path.
Definition: hdicorePathStyle.h:427
virtual PathStyle currentStyle() const
Gets the current path style for the eye dropper tool.
virtual bool commandKeyDown() const
Determines whether the command key is down.
virtual bool shiftKeyDown() const
Determines whether the shift key is down.
Represents a cursor that can be shown on the screen, as well as metadata about the current cursor...
Definition: hdicoreCursor.h:25
static EyeDropperTool *const create()
Creates the singleton instance of the EyeDropperTool class.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual bool selected() const
Gets whether the eye dropper tool is the currently selected tool.
virtual AIToolHandle aiToolHandle() const
Gets the tool handle for the eye dropper tool.
virtual void setMouseUpCallback(const Callback &cb_)
Sets the callback for the mouse up event.
virtual Callback *const dragCallback() const
Gets the registered callback for the drag event.
virtual Callback *const trackCallback() const
Gets the registered callback for the tool tracking event (mouse move)
Header file for path style-related classes.
Header file for a variety of Illustrator plugin convenience macros.
virtual bool controlKeyDown() const
Determines whether the control key is down.
virtual ArtboardPoint cursorLoc() const
Gets the current location of the cursor.
Definition: hdicoreaiArray.h:12
Base class for all tools; stores hit data, cursor loc, dialogs, etc.; receives tool-related messages...
Definition: hdicoreTool.h:32
virtual void select()
Sets the eye dropper tool as the current tool, storing the previously selected tool for later resumin...
virtual void deselect()
Deselects the eye dropper tool, causing the previously selected tool to become current again...
virtual std::string title() const
Gets the eye dropper tool's title.
static void destroy()
Destroys the singleton instance of the EyeDropperTool class.
Header file for Illustrator tool manipulation.
virtual bool optionKeyDown() const
Determines whether the option key is down.
Header file for manipulating cursors inside of Illustrator.
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28
virtual void setTrackCallback(const Callback &cb_)
Sets the callback for the tool tracking event (mouse move)
static EyeDropperTool *const instance()
Acquires the singleton instance of the EyeDropperTool class.
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:32