Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreMenuGroup.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_MENU_GROUP__
8 #define __HDI_CORE_MENU_GROUP__
9 
10 #include <vector>
11 
12 #include "hdicoreTypes.h"
13 
14 namespace hdi
15 {
16  namespace core
17  {
18  class MenuItem;
19 
23  class MenuGroup
24  {
25  public:
26  struct Child;
27 
28  typedef std::vector< Child* > ChildVector;
29 
34  struct Child
35  {
39  std::auto_ptr<MenuGroup> group;
40 
44  std::auto_ptr<MenuItem> item;
45 
51  Child();
52 
60  Child(const Child& kid_);
61 
67  ~Child();
68 
78  Child& operator=(const Child& rhs_);
79  };
80 
81  typedef std::auto_ptr<Child> ChildAP;
82 
94  MenuGroup();
95 
103  MenuGroup(const MenuGroup& m_);
104 
121  MenuGroup(
122  const BuiltinMenuGroup group_,
123  const std::string& text_,
124  const bool sort_ = false,
125  const bool mergeTop_ = false,
126  const bool divBelow_ = false,
127  const bool divAbove_ = false
128  );
129 
146  MenuGroup(
147  const MenuGroup& group_,
148  const std::string& text_,
149  const bool sort_ = false,
150  const bool mergeTop_ = false,
151  const bool divBelow_ = false,
152  const bool divAbove_ = false
153  );
154 
160  virtual ~MenuGroup();
161 
172  virtual void destroy();
173 
183  virtual MenuGroup& operator=(const MenuGroup& rhs_);
184 
193  virtual bool operator==(const MenuGroup& rhs_) const;
194 
203  virtual bool operator!=(const MenuGroup& rhs_) const;
204 
216  virtual AIMenuGroup aiMenuGroup() const;
217 
229  virtual AIMenuItemHandle aiMenuItemHandle() const;
230 
238  virtual bool isEmpty() const;
239 
254  virtual bool isPartial() const;
255 
265  virtual std::auto_ptr<MenuGroup> parent() const;
266 
281  virtual ChildVector children() const;
282 
292  virtual bool enabled() const;
293 
303  virtual void setEnabled(const bool enabled_);
304 
314  virtual std::string text() const;
315 
325  virtual void setText(const std::string& text_);
326 
334  virtual bool sorted() const;
335 
344  virtual void setSorted(const bool sort_);
345 
346 
347  private:
348  friend MenuGroup __accessCtor(AIMenuGroup, AIMenuItemHandle);
349 
353  void* __data;
354 
360  MenuGroup(AIMenuGroup, AIMenuItemHandle);
361  };
362 
363  typedef std::auto_ptr<MenuGroup> MenuGroupAP;
364 
365  extern MenuGroup __accessCtor(AIMenuGroup, AIMenuItemHandle);
366  }
367 }
368 
369 #endif
370 // __HDI_CORE_MENU_GROUP__
~Child()
Child object destructor.
Menu groups can have both groups and items as children, so this acts as a simple wrapper to store one...
Definition: hdicoreMenuGroup.h:34
virtual void destroy()
Destroys the UI menu group, converting the target object to an empty MenuGroup object (see the defaul...
virtual bool operator!=(const MenuGroup &rhs_) const
Tests whether a given MenuGroup object is not the same as another.
virtual bool operator==(const MenuGroup &rhs_) const
Tests whether a given MenuGroup object is the same as another.
virtual MenuGroup & operator=(const MenuGroup &rhs_)
Assigns one MenuGroup object to another.
virtual ~MenuGroup()
Destructs a MenuGroup object.
virtual bool sorted() const
Gets whether the children of the target menu group are sorted.
virtual bool enabled() const
Gets whether the menu group is enabled.
virtual void setEnabled(const bool enabled_)
Sets the menu group as enabled or disabled.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual AIMenuGroup aiMenuGroup() const
Gets the menu group around which the target object is wrapped.
virtual AIMenuItemHandle aiMenuItemHandle() const
Gets the menu item handle around which the target object is wrapped.
MenuGroup()
Constructs an empty MenuGroup object.
virtual void setText(const std::string &text_)
Sets the text of the menu group itself.
Child()
Constructs a new Child object with neither a group nor item.
virtual bool isEmpty() const
Gets whether the target MenuGroup object is empty (constructed with the default ctor) ...
Definition: hdicoreaiArray.h:12
virtual bool isPartial() const
Gets whether the menu group is a built-in Illustrator group.
Child & operator=(const Child &rhs_)
Overloaded assignment operator for Child objects.
virtual ChildVector children() const
Gets the children of the target menu group.
std::auto_ptr< MenuItem > item
Stores the child menu item.
Definition: hdicoreMenuGroup.h:44
Wraps around an Illustrator menu group.
Definition: hdicoreMenuGroup.h:23
std::auto_ptr< MenuGroup > group
Stores the child menu group.
Definition: hdicoreMenuGroup.h:39
virtual std::string text() const
Gets the text of the menu group itself.
virtual std::auto_ptr< MenuGroup > parent() const
Gets the parent of the target menu group.
virtual void setSorted(const bool sort_)
Sets whether the children of the target menu group art sorted alphabetically or in order of creation...