Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreTreeEntry.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_TREE_ENTRY__
8#define __HDI_CORE_TREE_ENTRY__
9
10#include <vector>
11
12#include "hdicoreEntryValue.h"
13#include "hdicoreMacros.h"
14
15namespace hdi
16{
17 namespace pui
18 {
19 class BaseTreeEntryData;
20 }
21
22 namespace core
23 {
28 {
29 public:
34 static const char* separatorValue;
35
48
56 TreeEntry(const TreeEntry& e_);
57
75 const std::string& id_,
76 const EntryValue& value_,
77 void* userData_,
78 const bool enabled_,
79 const bool expanded_,
80 const bool editable_
81 );
82
88 virtual ~TreeEntry();
89
99 virtual TreeEntry& operator=(const TreeEntry& rhs_);
100
108 virtual bool isEmpty() const;
109
120 virtual std::vector<std::string> idPath() const;
121
129 virtual std::string entryID() const;
130
141 virtual void setEntryID(const std::string& id_);
142
150 virtual EntryValue value() const;
151
159 virtual void setValue(const EntryValue& value_);
160
168 virtual bool enabled() const;
169
177 virtual void setEnabled(const bool enabled_);
178
186 virtual bool expanded() const;
187
195 virtual void setExpanded(const bool exp_);
196
204 virtual bool editable() const;
205
213 virtual void setEditable(const bool editable_);
214
222 virtual void* const userData() const;
223
231 virtual void setUserData(void* data_);
232
244 virtual bool hasChild(const std::string& id_) const;
245
257 virtual std::unique_ptr<TreeEntry> childWithID(const std::string& id_) const;
258
266 virtual uint32_t childCount() const;
267
276 virtual std::unique_ptr<TreeEntry> childAtIndex(const uint32_t index_) const;
277
286 virtual bool pushChild(const TreeEntry& child_);
287
296 virtual bool popChild(TreeEntry& child__);
297
312 virtual bool insertChild(const std::string& id_, const TreeEntry& child_);
313
324 virtual bool removeChild(const std::string& id_, TreeEntry& child__);
325
334 virtual bool operator==(const TreeEntry& rhs_) const;
335
344 virtual bool operator!=(const TreeEntry& rhs_) const;
345
346
347 private:
348 friend pui::BaseTreeEntryData* __accessImpl(const TreeEntry&);
349
353 void* __data;
354
360 void* __impl() const;
361 };
362
363 typedef std::unique_ptr<TreeEntry> TreeEntryUP;
364 typedef std::shared_ptr<TreeEntry> TreeEntrySP;
365 typedef std::weak_ptr<TreeEntry> TreeEntryWP;
366
367 extern pui::BaseTreeEntryData* __accessImpl(const TreeEntry&);
368 }
369}
370
371#endif
372// __HDI_CORE_TREE_ENTRY__
Allows for a *Entry class to store either a string value or PNGI image ID for a row/column.
Definition: hdicoreEntryValue.h:21
Allows hierarchical views to store more data than simply strings and indices.
Definition: hdicoreTreeEntry.h:28
virtual bool operator==(const TreeEntry &rhs_) const
Tests whether a given TreeEntry object is the same as another.
virtual std::string entryID() const
Gets the ID string of an entry.
virtual bool removeChild(const std::string &id_, TreeEntry &child__)
Removes a specific entry from the list of child entries.
virtual void *const userData() const
Gets the custom data of an entry.
TreeEntry(const std::string &id_, const EntryValue &value_, void *userData_, const bool enabled_, const bool expanded_, const bool editable_)
Constructs a TreeEntry object with some custom data.
virtual TreeEntry & operator=(const TreeEntry &rhs_)
Assigns one TreeEntry object to another.
virtual bool operator!=(const TreeEntry &rhs_) const
Tests whether a given TreeEntry object is not the same as another.
virtual ~TreeEntry()
Destructs a TreeEntry object.
TreeEntry()
Constructs an empty TreeEntry object.
virtual void setEntryID(const std::string &id_)
Sets the ID string of an entry.
virtual void setEditable(const bool editable_)
Sets the editability of the entry (whether the user can edit it inline)
virtual bool enabled() const
Gets whether the entry should be enabled (selectable by the user in the list)
virtual bool editable() const
Gets the editability of the entry (whether the user can edit it inline)
virtual void setExpanded(const bool exp_)
Sets whether the entry is expanded (i.e. its children are visible)
virtual void setEnabled(const bool enabled_)
Sets whether the entry should be enabled (selectable by the user in the list)
virtual bool expanded() const
Gets whether the entry is expanded (i.e. its children are visible)
virtual bool insertChild(const std::string &id_, const TreeEntry &child_)
Inserts an entry into the list of child entries at a given position.
virtual bool popChild(TreeEntry &child__)
Pops an existing entry off the end of the list of children of the target entry.
virtual bool hasChild(const std::string &id_) const
Gets whether the entry has a child with the given ID string.
virtual EntryValue value() const
Gets the value object of an entry.
virtual bool pushChild(const TreeEntry &child_)
Pushes a new entry onto the end of the list of children of the target entry.
virtual std::vector< std::string > idPath() const
Gets the full ID path of the target entry.
virtual std::unique_ptr< TreeEntry > childWithID(const std::string &id_) const
Get the child entry with the given ID string, if it exists within the target.
virtual void setValue(const EntryValue &value_)
Sets the value object of an entry.
static const char * separatorValue
When you want a separator in a container widget, create a TreeEntry object with this as its string va...
Definition: hdicoreTreeEntry.h:34
virtual std::unique_ptr< TreeEntry > childAtIndex(const uint32_t index_) const
Gets a specific child of the target entry.
TreeEntry(const TreeEntry &e_)
Constructs a new TreeEntry object from an existing TreeEntry object (copy constructor)
virtual bool isEmpty() const
Gets whether the target TreeEntry object is empty (constructed with the default ctor)
virtual uint32_t childCount() const
Gets the count of child entries in the target entry.
virtual void setUserData(void *data_)
Sets the custom data of an entry.
Header file for storing entry string values or image IDs.
Header file for a variety of plugin convenience macros.