Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreCheckbox.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_CHECKBOX__
8 #define __HDI_CORE_CHECKBOX__
9 
10 #include "hdicoreWidget.h"
11 
12 namespace hdi
13 {
14  namespace core
15  {
16  class Callback;
17 
21  class Checkbox : public Widget
22  {
23  public:
27  enum StateType
28  {
29  StateMixed = -1,
30  StateOff = 0,
31  StateOn = 1
32  };
33 
44  Checkbox();
45 
53  Checkbox(const Checkbox& checkbox_);
54 
70  explicit Checkbox(
71  const Point& loc_,
72  const std::string& label_,
73  const WindowType containerType_,
74  const StateType state_ = StateOff
75  );
76 
87  explicit Checkbox(
88  const Point& loc_,
89  const std::string& label_,
90  const double width_,
91  const StateType state_ = StateOff
92  );
93 
99  virtual ~Checkbox();
100 
109  virtual Checkbox& operator=(const Checkbox& rhs_);
110 
124  virtual Checkbox* clone() const;
125 
136  virtual Checkbox* duplicate() const;
137 
145  virtual StateType state() const;
146 
154  virtual void setState(const StateType state_);
155 
165  virtual void setChecked(const bool checked_);
166 
172  virtual void click();
173 
181  virtual Callback* const clickCallback() const;
182 
190  virtual void setClickCallback(const Callback& callback_);
191 
202  static double idealWidth(const std::string& text_, const double height_, const WindowType containerType_);
203  };
204 
205  typedef std::auto_ptr<Checkbox> CheckboxAP;
206  }
207 }
208 
209 #endif
210 // __HDI_CORE_CHECKBOX__
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
virtual StateType state() const
Gets the checkbox state.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
virtual void setClickCallback(const Callback &callback_)
Sets the click callback for the checkbox.
virtual Checkbox & operator=(const Checkbox &rhs_)
Allows one Checkbox object to be assigned from another.
virtual Checkbox * clone() const
Convenience method to clone a Checkbox object on the heap.
virtual ~Checkbox()
Checkbox destructor.
StateType
Describes the state of a checkbox.
Definition: hdicoreCheckbox.h:27
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual Callback *const clickCallback() const
Gets the current click callback for the checkbox.
Definition: hdicoreaiArray.h:12
virtual Checkbox * duplicate() const
Convenience method to duplicate a Checkbox object, creating a new and identical UI element to the tar...
Checkbox()
Constructs an empty Checkbox object.
Header file for Illustrator user interface widgets.
static double idealWidth(const std::string &text_, const double height_, const WindowType containerType_)
Gets the ideal width for a checkbox, given its label and a known height.
virtual void click()
Simulates a click on the checkbox.
virtual void setChecked(const bool checked_)
Alternate setter for the checkbox state.
Checkbox widget, which has both a checkbox "button" and a text label to its right.
Definition: hdicoreCheckbox.h:21
virtual void setState(const StateType state_)
Sets the checkbox state.