Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreMenuGroup.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_MENU_GROUP__
8#define __HDI_CORE_MENU_GROUP__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include <vector>
13
14#include "hdicoreTypes.h"
15
16namespace hdi
17{
18 namespace core
19 {
20 class MenuItem;
21
26 {
27 public:
28 struct Child;
29
30 typedef std::vector< std::shared_ptr<Child> > ChildVector;
31
36 struct Child
37 {
41 std::unique_ptr<MenuGroup> group;
42
46 std::unique_ptr<MenuItem> item;
47
54
62 Child(const Child& kid_);
63
70
80 Child& operator=(const Child& rhs_);
81 };
82
83 typedef std::unique_ptr<Child> ChildUP;
84 typedef std::shared_ptr<Child> ChildSP;
85 typedef std::weak_ptr<Child> ChildWP;
86
99
108
126 const BuiltinMenuGroup group_,
127 const std::string& text_,
128 const bool sort_ = false,
129 const bool mergeTop_ = false,
130 const bool divBelow_ = false,
131 const bool divAbove_ = false
132 );
133
151 const MenuGroup& group_,
152 const std::string& text_,
153 const bool sort_ = false,
154 const bool mergeTop_ = false,
155 const bool divBelow_ = false,
156 const bool divAbove_ = false
157 );
158
164 virtual ~MenuGroup();
165
176 virtual void destroy();
177
187 virtual MenuGroup& operator=(const MenuGroup& rhs_);
188
197 virtual bool operator==(const MenuGroup& rhs_) const;
198
207 virtual bool operator!=(const MenuGroup& rhs_) const;
208
220 virtual AIMenuGroup aiMenuGroup() const;
221
233 virtual AIMenuItemHandle aiMenuItemHandle() const;
234
242 virtual bool isEmpty() const;
243
258 virtual bool isPartial() const;
259
269 virtual std::unique_ptr<MenuGroup> parent() const;
270
283 virtual ChildVector children() const;
284
294 virtual bool enabled() const;
295
305 virtual void setEnabled(const bool enabled_);
306
316 virtual std::string text() const;
317
327 virtual void setText(const std::string& text_);
328
336 virtual bool sorted() const;
337
346 virtual void setSorted(const bool sort_);
347
348
349 private:
350 friend MenuGroup __accessCtor(AIMenuGroup, AIMenuItemHandle);
351
355 void* __data;
356
362 MenuGroup(AIMenuGroup, AIMenuItemHandle);
363 };
364
365 typedef std::unique_ptr<MenuGroup> MenuGroupUP;
366 typedef std::shared_ptr<MenuGroup> MenuGroupSP;
367 typedef std::weak_ptr<MenuGroup> MenuGroupWP;
368
369 extern MenuGroup __accessCtor(AIMenuGroup, AIMenuItemHandle);
370 }
371}
372
373#endif
374// HDI_CORE_AIP_MODE
375
376#endif
377// __HDI_CORE_MENU_GROUP__
Wraps around an Illustrator menu group.
Definition: hdicoreMenuGroup.h:26
virtual std::string text() const
Gets the text of the menu group itself.
virtual AIMenuGroup aiMenuGroup() const
Gets the menu group around which the target object is wrapped.
virtual bool operator==(const MenuGroup &rhs_) const
Tests whether a given MenuGroup object is the same as another.
virtual AIMenuItemHandle aiMenuItemHandle() const
Gets the menu item handle around which the target object is wrapped.
virtual std::unique_ptr< MenuGroup > parent() const
Gets the parent of the target menu group.
MenuGroup()
Constructs an empty MenuGroup object.
virtual void destroy()
Destroys the UI menu group, converting the target object to an empty MenuGroup object (see the defaul...
virtual ~MenuGroup()
Destructs a MenuGroup object.
virtual bool enabled() const
Gets whether the menu group is enabled.
virtual void setSorted(const bool sort_)
Sets whether the children of the target menu group art sorted alphabetically or in order of creation.
virtual void setText(const std::string &text_)
Sets the text of the menu group itself.
virtual bool isPartial() const
Gets whether the menu group is a built-in Illustrator group.
MenuGroup(const BuiltinMenuGroup group_, const std::string &text_, const bool sort_=false, const bool mergeTop_=false, const bool divBelow_=false, const bool divAbove_=false)
Constructs a new MenuGroup object.
MenuGroup(const MenuGroup &m_)
Constructs a new MenuGroup object from an existing MenuGroup object (copy constructor)
virtual ChildVector children() const
Gets the children of the target menu group.
virtual bool isEmpty() const
Gets whether the target MenuGroup object is empty (constructed with the default ctor)
virtual MenuGroup & operator=(const MenuGroup &rhs_)
Assigns one MenuGroup object to another.
virtual void setEnabled(const bool enabled_)
Sets the menu group as enabled or disabled.
MenuGroup(const MenuGroup &group_, const std::string &text_, const bool sort_=false, const bool mergeTop_=false, const bool divBelow_=false, const bool divAbove_=false)
Constructs a new MenuGroup object.
virtual bool operator!=(const MenuGroup &rhs_) const
Tests whether a given MenuGroup object is not the same as another.
virtual bool sorted() const
Gets whether the children of the target menu group are sorted.
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
Menu groups can have both groups and items as children, so this acts as a simple wrapper to store one...
Definition: hdicoreMenuGroup.h:37
Child(const Child &kid_)
Copy constructor for a Child object.
~Child()
Child object destructor.
Child()
Constructs a new Child object with neither a group nor item.
std::unique_ptr< MenuItem > item
Stores the child menu item.
Definition: hdicoreMenuGroup.h:46
Child & operator=(const Child &rhs_)
Overloaded assignment operator for Child objects.
std::unique_ptr< MenuGroup > group
Stores the child menu group.
Definition: hdicoreMenuGroup.h:41