Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreTool.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_TOOL__
8 #define __HDI_CORE_TOOL__
9 
10 #include <vector>
11 
12 #include "hdicoreArtboardPoint.h"
13 #include "hdicoreTypes.h"
14 
15 namespace hdi
16 {
17  namespace plugin
18  {
19  class BaseTool;
20  }
21 
22  namespace core
23  {
24  class BuiltinTool;
25  class Callback;
26  class HitData;
27  class ModalDialog;
28 
32  class Tool
33  {
34  public:
35  typedef std::vector<ArtboardPoint> ArtboardPointVector;
36 
40  enum Options
41  {
42  NoOptions = 0,
43  TracksCursorOption = 1 << 0,
44  DoesntAutoScrollOption = 1 << 1,
45  BufferedDraggingOption = 1 << 2,
46  MaintainsEditContextOption = 1 << 3,
47  WantsToEditTextOption = 1 << 4,
48  WantsToChangeDiameterOption = 1 << 5,
49  WantsAlternateSelectionOption = 1 << 6,
50  HiddenOption = 1 << 7,
51  DoesntAllowSoftSelectionOption = 1 << 8, // Illustrator 17 and above only
52  DefaultOptions = (TracksCursorOption | WantsToChangeDiameterOption)
53  };
54 
65  Tool();
66 
74  Tool(const Tool& tool_);
75 
107  Tool(
108  const Tool& sameGroupAs_,
109  const Tool* const sameSetAs_,
110  const std::string& title_,
111  const std::string& tip_,
112  const int16_t lightIconID_,
113  const int16_t darkIconID_,
114  const Options options_ = DefaultOptions
115  );
116 
148  Tool(
149  const BuiltinTool& sameGroupAs_,
150  const BuiltinTool* const sameSetAs_,
151  const std::string& title_,
152  const std::string& tip_,
153  const int16_t lightIconID_,
154  const int16_t darkIconID_,
155  const Options options_ = DefaultOptions
156  );
157 
190  explicit Tool(
191  const int16_t sameGroupAs_,
192  const int16_t sameSetAs_,
193  const std::string& title_,
194  const std::string& tip_,
195  const int16_t lightIconID_,
196  const int16_t darkIconID_,
197  const Options options_ = DefaultOptions
198  );
199 
205  virtual ~Tool();
206 
217  virtual void destroy();
218 
227  virtual Tool& operator=(const Tool& rhs_);
228 
237  virtual bool operator==(const Tool& rhs_) const;
238 
247  virtual bool operator!=(const Tool& rhs_) const;
248 
260  virtual AIToolHandle aiToolHandle() const;
261 
272  virtual int16_t number() const;
273 
281  virtual bool isEmpty() const;
282 
290  virtual bool selected() const;
291 
297  virtual void setSelected();
298 
306  virtual Options options() const;
307 
315  virtual void setOptions(const Options options_);
316 
324  virtual std::string title() const;
325 
339  virtual void setTitle(const std::string& title_);
340 
348  virtual std::string tip() const;
349 
363  virtual void setTip(const std::string& tip_);
364 
372  virtual int16_t lightIconID() const;
373 
384  virtual void setLightIconID(const int16_t imgID_);
385 
393  virtual int16_t darkIconID() const;
394 
405  virtual void setDarkIconID(const int16_t imgID_);
406 
416  virtual ArtboardPoint cursorLoc() const;
417 
428  virtual void setCursorLoc(const ArtboardPoint& loc_);
429 
437  virtual ArtboardPointVector mouseDownLocs() const;
438 
446  virtual ArtboardPointVector mouseUpLocs() const;
447 
458  virtual std::auto_ptr<HitData> mouseDownHitData(
459  const uint32_t index_,
460  const HitRequest request_,
461  const double tolerance_ = 2.0
462  ) const;
463 
474  virtual std::auto_ptr<HitData> mouseUpHitData(
475  const uint32_t index_,
476  const HitRequest request_,
477  const double tolerance_ = 2.0
478  ) const;
479 
489  virtual std::auto_ptr<HitData> cursorHitData(
490  const HitRequest request_,
491  const double tolerance_ = 2.0
492  ) const;
493 
501  virtual Callback* const selectionCallback() const;
502 
510  virtual void setSelectionCallback(const Callback& cb_);
511 
519  virtual Callback* const reselectionCallback() const;
520 
528  virtual void setReselectionCallback(const Callback& cb_);
529 
537  virtual Callback* const deselectionCallback() const;
538 
546  virtual void setDeselectionCallback(const Callback& cb_);
547 
555  virtual Callback* const trackCallback() const;
556 
564  virtual void setTrackCallback(const Callback& cb_);
565 
573  virtual Callback* const mouseDownCallback() const;
574 
582  virtual void setMouseDownCallback(const Callback& cb_);
583 
591  virtual Callback* const dragCallback() const;
592 
600  virtual void setDragCallback(const Callback& cb_);
601 
609  virtual Callback* const mouseUpCallback() const;
610 
618  virtual void setMouseUpCallback(const Callback& cb_);
619 
627  virtual Callback* const decreaseDiameterCallback() const;
628 
636  virtual void setDecreaseDiameterCallback(const Callback& cb_);
637 
645  virtual Callback* const increaseDiameterCallback() const;
646 
654  virtual void setIncreaseDiameterCallback(const Callback& cb_);
655 
663  virtual Callback* const editCallback() const;
664 
672  virtual void setEditCallback(const Callback& cb_);
673 
682  virtual void resetCursorLocs();
683 
693  virtual bool wasDragged() const;
694 
705  virtual bool shiftKeyDown() const;
706 
720  virtual bool commandKeyDown() const;
721 
733  virtual bool optionKeyDown() const;
734 
745  virtual bool controlKeyDown() const;
746 
759  virtual ModalDialog* const inputDialog() const;
760 
773  virtual void setInputDialog(const ModalDialog& dialog_);
774 
786  virtual ModalDialog* const prefsDialog() const;
787 
799  virtual void setPrefsDialog(const ModalDialog& dialog_);
800 
809  virtual bool autoShowPrefsDialog() const;
810 
819  virtual void setAutoShowPrefsDialog(const bool show_);
820 
821 
822  private:
823  friend plugin::BaseTool* __accessImpl(const Tool&);
824  friend Tool __accessCtorTool(const void*);
825 
829  void* __data;
830 
836  void* __impl() const;
837 
843  Tool(const void*);
844  };
845 
846  typedef std::auto_ptr<Tool> ToolAP;
847 
848  extern plugin::BaseTool* __accessImpl(const Tool&);
849  extern Tool __accessCtorTool(const void*);
850  }
851 }
852 
853 hdi::core::Tool::Options operator|(
854  const hdi::core::Tool::Options lhs_,
855  const hdi::core::Tool::Options rhs_
856 );
857 
858 hdi::core::Tool::Options& operator|=(
860  const hdi::core::Tool::Options rhs_
861 );
862 
863 #endif
864 // __HDI_CORE_TOOL__
Class for accessing and querying built-in Illustrator tools.
Definition: hdicoreBuiltinTool.h:21
Used to create and display a modal dialog to the user, blocking input to other UI elements...
Definition: hdicoreModalDialog.h:30
HitRequest
Describes the types of hit tests that can be performed (AKA a hit request)
Definition: hdicoreTypes.h:326
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Header file for geometric point manipulation on the Illustrator artboard.
Definition: hdicoreaiArray.h:12
Base class for all tools; stores hit data, cursor loc, dialogs, etc.; receives tool-related messages...
Definition: hdicoreTool.h:32
Options
Controls various options for a tool.
Definition: hdicoreTool.h:40
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28