Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Public Member Functions | Static Public Attributes | Friends | List of all members
hdi::core::TreeEntry Class Reference

Allows hierarchical views to store more data than simply strings and indices. More...

#include <hdicoreTreeEntry.h>

Public Member Functions

 TreeEntry ()
 Constructs an empty TreeEntry object. More...
 
 TreeEntry (const TreeEntry &e_)
 Constructs a new TreeEntry object from an existing TreeEntry object (copy constructor) More...
 
 TreeEntry (const std::string &id_, const EntryValue &value_, void *userData_, const bool enabled_=true, const bool expanded_=false)
 Constructs a TreeEntry object with some custom data. More...
 
virtual ~TreeEntry ()
 Destructs a TreeEntry object. More...
 
virtual TreeEntryoperator= (const TreeEntry &rhs_)
 Assigns one TreeEntry object to another. More...
 
virtual bool isEmpty () const
 Gets whether the target TreeEntry object is empty (constructed with the default ctor) More...
 
virtual std::string entryID () const
 Gets the ID string of an entry. More...
 
virtual void setEntryID (const std::string &id_)
 Sets the ID string of an entry. More...
 
virtual EntryValue value () const
 Gets the value object of an entry. More...
 
virtual void setValue (const EntryValue &value_)
 Sets the value object of an entry. More...
 
virtual bool enabled () const
 Gets whether the entry should be enabled (selectable by the user in the list) More...
 
virtual void setEnabled (const bool enabled_)
 Sets whether the entry should be enabled (selectable by the user in the list) More...
 
virtual bool expanded () const
 Gets whether the entry is expanded (i.e. its children are visible) More...
 
virtual void setExpanded (const bool exp_)
 Sets whether the entry is expanded (i.e. its children are visible) More...
 
virtual void *const userData () const
 Gets the custom data of an entry. More...
 
virtual void setUserData (void *data_)
 Sets the custom data of an entry. More...
 
virtual uint32_t childCount () const
 Gets the count of child entries in the target entry. More...
 
virtual std::auto_ptr< TreeEntrychildAtIndex (const uint32_t index_) const
 Gets a specific child of the target entry. More...
 
virtual bool pushChild (const TreeEntry &child_)
 Pushes a new entry onto the end of the list of children of the target entry. More...
 
virtual bool popChild (TreeEntry &child__)
 Pops an existing entry off the end of the list of children of the target entry. More...
 
virtual bool operator== (const TreeEntry &rhs_) const
 Tests whether a given TreeEntry object is the same as another. More...
 
virtual bool operator!= (const TreeEntry &rhs_) const
 Tests whether a given TreeEntry object is not the same as another. More...
 

Static Public Attributes

static const char * separatorValue
 When you want a separator in a container widget, create a TreeEntry object with this as its string value.
 

Friends

plugin::BaseTreeEntryData * __accessImpl (const TreeEntry &)
 

Detailed Description

Allows hierarchical views to store more data than simply strings and indices.

Constructor & Destructor Documentation

hdi::core::TreeEntry::TreeEntry ( )

Constructs an empty TreeEntry object.

Author
GW
Date
09/2014
Note
To test if a TreeEntry object is empty, call isEmpty() on it
Empty TreeEntry objects do not relate to any entry in any widget; they are designed to be "receivers" of some other TreeEntry object via the overloaded assignment operator. Empty TreeEntry objects are useless until such time (though it is safe to call any of their methods).
hdi::core::TreeEntry::TreeEntry ( const TreeEntry e_)

Constructs a new TreeEntry object from an existing TreeEntry object (copy constructor)

Author
GW
Date
09/2014
Parameters
e_Existing TreeEntry object
hdi::core::TreeEntry::TreeEntry ( const std::string &  id_,
const EntryValue value_,
void *  userData_,
const bool  enabled_ = true,
const bool  expanded_ = false 
)

Constructs a TreeEntry object with some custom data.

Author
GW
Date
09/2014
Parameters
id_Entry ID string, as UTF-8 (must form a unique ID path in the target container)
value_Entry value object
userData_Data to store in the entry
enabled_Whether the entry should be enabled
expanded_true to expand the entry, false to collapse
Note
A given entry ID can occur in multiple children vectors, so long as the ID path of at least one parent is not identical (e.g. "A"/"C" and "B"/"C" are allowed to exist in one widget, but "X"/"Y" and "X"/"Y" are not).
virtual hdi::core::TreeEntry::~TreeEntry ( )
virtual

Destructs a TreeEntry object.

Author
GW
Date
09/2014

Member Function Documentation

virtual std::auto_ptr<TreeEntry> hdi::core::TreeEntry::childAtIndex ( const uint32_t  index_) const
virtual

Gets a specific child of the target entry.

Author
GW
Date
09/2014
Parameters
index_Index of the desired child entry
Returns
The child at the given index, or NULL for error
virtual uint32_t hdi::core::TreeEntry::childCount ( ) const
virtual

Gets the count of child entries in the target entry.

Author
GW
Date
09/2014
Returns
The count of child entries
virtual bool hdi::core::TreeEntry::enabled ( ) const
virtual

Gets whether the entry should be enabled (selectable by the user in the list)

Author
GW
Date
09/2014
Returns
true for enabled, false otherwise
virtual std::string hdi::core::TreeEntry::entryID ( ) const
virtual

Gets the ID string of an entry.

Author
GW
Date
09/2014
Returns
The unique ID of the entry, as UTF-8
virtual bool hdi::core::TreeEntry::expanded ( ) const
virtual

Gets whether the entry is expanded (i.e. its children are visible)

Author
GW
Date
02/2015
Returns
true for expanded, false for collapsed
virtual bool hdi::core::TreeEntry::isEmpty ( ) const
virtual

Gets whether the target TreeEntry object is empty (constructed with the default ctor)

Author
GW
Date
09/2014
Returns
true if the target TreeEntry object is empty, false otherwise
virtual bool hdi::core::TreeEntry::operator!= ( const TreeEntry rhs_) const
virtual

Tests whether a given TreeEntry object is not the same as another.

Author
GW
Date
09/2014
Parameters
rhs_TreeEntry to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different entries, false otherwise
virtual TreeEntry& hdi::core::TreeEntry::operator= ( const TreeEntry rhs_)
virtual

Assigns one TreeEntry object to another.

Author
GW
Date
09/2014
Parameters
rhs_Existing TreeEntry object to copy values from
Returns
The target TreeEntry object, but with its values updated to match that of the rhs_ argument
virtual bool hdi::core::TreeEntry::operator== ( const TreeEntry rhs_) const
virtual

Tests whether a given TreeEntry object is the same as another.

Author
GW
Date
09/2014
Parameters
rhs_TreeEntry to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same entry, false otherwise
virtual bool hdi::core::TreeEntry::popChild ( TreeEntry child__)
virtual

Pops an existing entry off the end of the list of children of the target entry.

Author
GW
Date
09/2014
Parameters
child__Return-by-reference for the child entry that was removed
Returns
true if the child could be acquired and popped, false otherwise
virtual bool hdi::core::TreeEntry::pushChild ( const TreeEntry child_)
virtual

Pushes a new entry onto the end of the list of children of the target entry.

Author
GW
Date
09/2014
Parameters
child_New child to add to the end of the list of children
Returns
true if the child could be pushed, false otherwise
virtual void hdi::core::TreeEntry::setEnabled ( const bool  enabled_)
virtual

Sets whether the entry should be enabled (selectable by the user in the list)

Author
GW
Date
09/2014
Parameters
enabled_true for enabled, false otherwise
virtual void hdi::core::TreeEntry::setEntryID ( const std::string &  id_)
virtual

Sets the ID string of an entry.

Author
GW
Date
09/2014
Parameters
id_New entry ID string, as UTF-8
Note
It is up to the caller to ensure that the ID path is not in use with other entries within the same container widget.
virtual void hdi::core::TreeEntry::setExpanded ( const bool  exp_)
virtual

Sets whether the entry is expanded (i.e. its children are visible)

Author
GW
Date
02/2015
Parameters
exp_true for expanded, false for collapsed
virtual void hdi::core::TreeEntry::setUserData ( void *  data_)
virtual

Sets the custom data of an entry.

Author
GW
Date
09/2014
Parameters
data_New custom data to store
virtual void hdi::core::TreeEntry::setValue ( const EntryValue value_)
virtual

Sets the value object of an entry.

Author
GW
Date
09/2014
Parameters
value_New entry value object
virtual void* const hdi::core::TreeEntry::userData ( ) const
virtual

Gets the custom data of an entry.

Author
GW
Date
09/2014
Returns
The data stored inside the target entry object
virtual EntryValue hdi::core::TreeEntry::value ( ) const
virtual

Gets the value object of an entry.

Author
GW
Date
09/2014
Returns
The entry's value object