Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreMenuItem.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_MENU_ITEM__
8 #define __HDI_CORE_MENU_ITEM__
9 
10 #include "hdicoreTypes.h"
11 
12 namespace hdi
13 {
14  namespace core
15  {
16  class Callback;
17  class MenuGroup;
18 
23  class MenuItem
24  {
25  public:
37  MenuItem();
38 
46  MenuItem(const MenuItem& m_);
47 
57  MenuItem(const BuiltinMenuGroup group_, const std::string& text_, const Callback& callback_);
58 
68  MenuItem(const MenuGroup& group_, const std::string& text_, const Callback& callback_);
69 
78  static MenuItem Divider(const BuiltinMenuGroup group_);
79 
88  static MenuItem Divider(const MenuGroup& group_);
89 
95  virtual ~MenuItem();
96 
107  virtual void destroy();
108 
118  virtual MenuItem& operator=(const MenuItem& rhs_);
119 
128  virtual bool operator==(const MenuItem& rhs_) const;
129 
138  virtual bool operator!=(const MenuItem& rhs_) const;
139 
151  virtual AIMenuItemHandle aiMenuItemHandle() const;
152 
160  virtual bool isEmpty() const;
161 
169  virtual bool isDivider() const;
170 
178  virtual std::auto_ptr<MenuGroup> parent() const;
179 
187  virtual bool enabled() const;
188 
196  virtual void setEnabled(const bool enabled_);
197 
205  virtual bool checked() const;
206 
214  virtual void setChecked(const bool checked_);
215 
223  virtual std::string text() const;
224 
232  virtual void setText(const std::string& text_);
233 
241  virtual Callback* const callback() const;
242 
250  virtual void setCallback(const Callback& cb_);
251 
252 
253  private:
254  friend MenuItem __accessCtor(AIMenuItemHandle);
255 
259  void* __data;
260 
266  MenuItem(AIMenuItemHandle);
267  };
268 
269  typedef std::auto_ptr<MenuItem> MenuItemAP;
270 
271  extern MenuItem __accessCtor(AIMenuItemHandle);
272  }
273 }
274 
275 #endif
276 // __HDI_CORE_MENU_ITEM__
virtual void setChecked(const bool checked_)
Sets the menu item as checked or unchecked.
virtual void destroy()
Destroys the UI menu item, converting the target object to an empty MenuItem object (see the default ...
static MenuItem Divider(const BuiltinMenuGroup group_)
Constructs a new MenuItem object as a divider.
virtual bool isEmpty() const
Gets whether the target MenuItem object is empty (constructed with the default ctor) ...
virtual bool operator==(const MenuItem &rhs_) const
Tests whether a given MenuItem object is the same as another.
virtual bool operator!=(const MenuItem &rhs_) const
Tests whether a given MenuItem object is not the same as another.
virtual void setCallback(const Callback &cb_)
Sets the callback for the menu item.
virtual ~MenuItem()
Destructs a MenuItem object.
virtual bool isDivider() const
Gets whether the target MenuItem is a divider.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
Wraps around an Illustrator menu item to allow for selection callbacks, en/disabling, setting text, grouping, etc.
Definition: hdicoreMenuItem.h:23
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
MenuItem()
Constructs an empty MenuItem object.
virtual void setText(const std::string &text_)
Sets the text of the menu item itself.
virtual MenuItem & operator=(const MenuItem &rhs_)
Assigns one MenuItem object to another.
virtual std::string text() const
Gets the text of the menu item itself.
virtual bool enabled() const
Gets whether the menu item is enabled.
Definition: hdicoreaiArray.h:12
virtual Callback *const callback() const
Gets the registered callback for the menu item.
virtual std::auto_ptr< MenuGroup > parent() const
Gets the parent of the target menu item.
virtual AIMenuItemHandle aiMenuItemHandle() const
Gets the menu item handle around which the target object is wrapped.
Wraps around an Illustrator menu group.
Definition: hdicoreMenuGroup.h:23
virtual void setEnabled(const bool enabled_)
Sets the menu item as enabled or disabled.
virtual bool checked() const
Gets whether the menu item is checked.