Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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
12namespace hdi
13{
14 namespace core
15 {
16 class Callback;
17
18 #if defined(HDI_CORE_AIP_MODE)
19 class MenuGroup;
20 #endif
21
26 {
27 public:
40
48 MenuItem(const MenuItem& m_);
49
61 MenuItem(const BuiltinMenuGroup group_, const std::string& text_, const Callback& callback_);
62
73 static MenuItem Divider(const BuiltinMenuGroup group_);
74
75 #if defined(HDI_CORE_AIP_MODE)
85 MenuItem(const MenuGroup& group_, const std::string& text_, const Callback& callback_);
86
95 static MenuItem Divider(const MenuGroup& group_);
96 #endif
97 // HDI_CORE_AIP_MODE
98
104 virtual ~MenuItem();
105
116 virtual void destroy();
117
127 virtual MenuItem& operator=(const MenuItem& rhs_);
128
137 virtual bool operator==(const MenuItem& rhs_) const;
138
147 virtual bool operator!=(const MenuItem& rhs_) const;
148
149 #if defined(HDI_CORE_AIP_MODE)
161 virtual AIMenuItemHandle aiMenuItemHandle() const;
162 #elif defined(HDI_CORE_PSP_MODE)
174 virtual PlatformMenuItemPtr platformMenuItem() const;
175 #endif
176
184 virtual bool isEmpty() const;
185
193 virtual bool isDivider() const;
194
195 #if defined(HDI_CORE_AIP_MODE)
203 virtual std::unique_ptr<MenuGroup> parent() const;
204 #endif
205 // HDI_CORE_AIP_MODE
206
214 virtual bool enabled() const;
215
223 virtual void setEnabled(const bool enabled_);
224
232 virtual bool checked() const;
233
241 virtual void setChecked(const bool checked_);
242
250 virtual std::string text() const;
251
259 virtual void setText(const std::string& text_);
260
268 virtual Callback* const callback() const;
269
277 virtual void setCallback(const Callback& cb_);
278
279
280 private:
281 #if defined(HDI_CORE_AIP_MODE)
282 friend MenuItem __accessCtor(AIMenuItemHandle);
283
289 MenuItem(AIMenuItemHandle);
290 #endif
291 // HDI_CORE_AIP_MODE
292
296 void* __data;
297 };
298
299 typedef std::unique_ptr<MenuItem> MenuItemUP;
300 typedef std::shared_ptr<MenuItem> MenuItemSP;
301 typedef std::weak_ptr<MenuItem> MenuItemWP;
302
303 #if defined(HDI_CORE_AIP_MODE)
304 extern MenuItem __accessCtor(AIMenuItemHandle);
305 #endif
306 }
307}
308
309#endif
310// __HDI_CORE_MENU_ITEM__
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Wraps around an Illustrator menu group.
Definition: hdicoreMenuGroup.h:26
Wraps around an application menu item to allow for selection callbacks, en/disabling,...
Definition: hdicoreMenuItem.h:26
virtual bool isEmpty() const
Gets whether the target MenuItem object is empty (constructed with the default ctor)
virtual MenuItem & operator=(const MenuItem &rhs_)
Assigns one MenuItem object to another.
virtual bool operator==(const MenuItem &rhs_) const
Tests whether a given MenuItem object is the same as another.
virtual bool checked() const
Gets whether the menu item is checked.
virtual bool operator!=(const MenuItem &rhs_) const
Tests whether a given MenuItem object is not the same as another.
virtual Callback *const callback() const
Gets the registered callback for the menu item.
virtual bool isDivider() const
Gets whether the target MenuItem is a divider.
virtual void destroy()
Destroys the UI menu item, converting the target object to an empty MenuItem object (see the default ...
virtual AIMenuItemHandle aiMenuItemHandle() const
Gets the menu item handle around which the target object is wrapped.
virtual void setEnabled(const bool enabled_)
Sets the menu item as enabled or disabled.
virtual ~MenuItem()
Destructs a MenuItem object.
virtual void setCallback(const Callback &cb_)
Sets the callback for the menu item.
virtual std::string text() const
Gets the text of the menu item itself.
virtual void setText(const std::string &text_)
Sets the text of the menu item itself.
virtual void setChecked(const bool checked_)
Sets the menu item as checked or unchecked.
MenuItem()
Constructs an empty MenuItem object.
MenuItem(const BuiltinMenuGroup group_, const std::string &text_, const Callback &callback_)
Constructs a new MenuItem object.
virtual std::unique_ptr< MenuGroup > parent() const
Gets the parent of the target menu item.
MenuItem(const MenuGroup &group_, const std::string &text_, const Callback &callback_)
Constructs a new MenuItem object.
static MenuItem Divider(const BuiltinMenuGroup group_)
Constructs a new MenuItem object as a divider.
static MenuItem Divider(const MenuGroup &group_)
Constructs a new MenuItem object as a divider.
MenuItem(const MenuItem &m_)
Constructs a new MenuItem object from an existing MenuItem object (copy constructor)
virtual bool enabled() const
Gets whether the menu item is enabled.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
BuiltinMenuGroup
Describes a built-in application menu group.
Definition: hdicoreTypes.h:950