Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
hdi::core::TreeColumnEntry Class Reference

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

#include <hdicoreTreeColumnEntry.h>

Public Types

typedef std::vector< EntryValueValueVector
 
typedef std::vector< bool > EditableVector
 
typedef std::vector< void * > DataVector
 

Public Member Functions

 TreeColumnEntry ()
 Constructs an empty TreeColumnEntry object.
 
 TreeColumnEntry (const TreeColumnEntry &e_)
 Constructs a new TreeColumnEntry object from an existing TreeColumnEntry object (copy constructor)
 
 TreeColumnEntry (const std::string &id_, const ValueVector &values_, const DataVector &userData_, const bool enabled_, const bool expanded_, const EditableVector &editable_)
 Constructs a TreeColumnEntry object with some custom data.
 
virtual ~TreeColumnEntry ()
 Destructs a TreeColumnEntry object.
 
virtual TreeColumnEntryoperator= (const TreeColumnEntry &rhs_)
 Assigns one TreeColumnEntry object to another.
 
virtual bool isEmpty () const
 Gets whether the target TreeColumnEntry object is empty (constructed with the default ctor)
 
virtual std::vector< std::string > idPath () const
 Gets the full ID path of the target entry.
 
virtual std::string entryID () const
 Gets the ID string of an entry.
 
virtual void setEntryID (const std::string &id_)
 Sets the ID string of an entry.
 
virtual ValueVector values () const
 Gets the value objects of an entry.
 
virtual void setValues (const ValueVector &values_)
 Sets the value objects of an entry.
 
virtual bool enabled () const
 Gets whether the entry should be enabled (selectable by the user in the list)
 
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 void setExpanded (const bool exp_)
 Sets whether the entry is expanded (i.e. its children are visible)
 
virtual EditableVector editable () const
 Gets the editability of each cell in the entry (whether the user can edit it inline)
 
virtual void setEditable (const EditableVector &editable_)
 Sets the editability of each cell in the entry (whether the user can edit it inline)
 
virtual DataVector userData () const
 Gets the custom data of an entry.
 
virtual void setUserData (const DataVector &data_)
 Sets the custom data of an entry.
 
virtual bool hasChild (const std::string &id_) const
 Gets whether the entry has a child with the given ID string.
 
virtual std::unique_ptr< TreeColumnEntrychildWithID (const std::string &id_) const
 Get the child entry with the given ID string, if it exists within the target.
 
virtual uint32_t childCount () const
 Gets the count of child entries in the target entry.
 
virtual std::unique_ptr< TreeColumnEntrychildAtIndex (const uint32_t index_) const
 Gets a specific child of the target entry.
 
virtual bool pushChild (const TreeColumnEntry &child_)
 Pushes a new entry onto the end of the list of children of the target entry.
 
virtual bool popChild (TreeColumnEntry &child__)
 Pops an existing entry off the end of the list of children of the target entry.
 
virtual bool insertChild (const std::string &id_, const TreeColumnEntry &child_)
 Inserts an entry into the list of child entries at a given position.
 
virtual bool removeChild (const std::string &id_, TreeColumnEntry &child__)
 Removes a specific entry from the list of child entries.
 
virtual bool operator== (const TreeColumnEntry &rhs_) const
 Tests whether a given TreeColumnEntry object is the same as another.
 
virtual bool operator!= (const TreeColumnEntry &rhs_) const
 Tests whether a given TreeColumnEntry object is not the same as another.
 

Static Public Attributes

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

Friends

pui::TreeColumnEntryData * __accessImpl (const TreeColumnEntry &)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ TreeColumnEntry() [1/3]

hdi::core::TreeColumnEntry::TreeColumnEntry ( )

Constructs an empty TreeColumnEntry object.

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

◆ TreeColumnEntry() [2/3]

hdi::core::TreeColumnEntry::TreeColumnEntry ( const TreeColumnEntry e_)

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

Author
GW
Date
01/2015
Parameters
e_Existing TreeColumnEntry object

◆ TreeColumnEntry() [3/3]

hdi::core::TreeColumnEntry::TreeColumnEntry ( const std::string &  id_,
const ValueVector &  values_,
const DataVector &  userData_,
const bool  enabled_,
const bool  expanded_,
const EditableVector &  editable_ 
)

Constructs a TreeColumnEntry object with some custom data.

Author
GW
Date
01/2015
Parameters
id_Entry ID string, as UTF-8 (must form a unique ID path in the target container)
values_Entry value objects, one for each column
userData_Data to store in each column of the entry
enabled_Whether the entry should be enabled
expanded_true to expand the entry, false to collapse
editable_Whether each cell in the entry should be inline editable

◆ ~TreeColumnEntry()

virtual hdi::core::TreeColumnEntry::~TreeColumnEntry ( )
virtual

Destructs a TreeColumnEntry object.

Author
GW
Date
01/2015

Member Function Documentation

◆ childAtIndex()

virtual std::unique_ptr< TreeColumnEntry > hdi::core::TreeColumnEntry::childAtIndex ( const uint32_t  index_) const
virtual

Gets a specific child of the target entry.

Author
GW
Date
01/2015
Parameters
index_Index of the desired child entry
Returns
The child at the given index, or NULL for error

◆ childCount()

virtual uint32_t hdi::core::TreeColumnEntry::childCount ( ) const
virtual

Gets the count of child entries in the target entry.

Author
GW
Date
01/2015
Returns
The count of child entries

◆ childWithID()

virtual std::unique_ptr< TreeColumnEntry > hdi::core::TreeColumnEntry::childWithID ( const std::string &  id_) const
virtual

Get the child entry with the given ID string, if it exists within the target.

Author
GW
Date
12/2022
Parameters
id_ID of the child to search for
Returns
The found child entry, or NULL if not found
Note
This method performs an O(n) operation, and only searches direct children (i.e. not a full-subtree search).

◆ editable()

virtual EditableVector hdi::core::TreeColumnEntry::editable ( ) const
virtual

Gets the editability of each cell in the entry (whether the user can edit it inline)

Author
GW
Date
07/2022
Returns
true for enabled, false otherwise

◆ enabled()

virtual bool hdi::core::TreeColumnEntry::enabled ( ) const
virtual

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

Author
GW
Date
01/2015
Returns
true for enabled, false otherwise

◆ entryID()

virtual std::string hdi::core::TreeColumnEntry::entryID ( ) const
virtual

Gets the ID string of an entry.

Author
GW
Date
01/2015
Returns
The unique ID of the entry, as UTF-8

◆ expanded()

virtual bool hdi::core::TreeColumnEntry::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

◆ hasChild()

virtual bool hdi::core::TreeColumnEntry::hasChild ( const std::string &  id_) const
virtual

Gets whether the entry has a child with the given ID string.

Author
GW
Date
12/2022
Parameters
id_ID of the child to search for
Returns
true if found, false otherwise
Note
This method performs an O(n) operation, and only searches direct children (i.e. not a full-subtree search).

◆ idPath()

virtual std::vector< std::string > hdi::core::TreeColumnEntry::idPath ( ) const
virtual

Gets the full ID path of the target entry.

Author
GW
Date
12/2022
Returns
The the ID path for the target, from top-most to the target
Warning
Only valid after the entry and its ancestors have been added to a HierarchicalWidget, and can change if the entries are e.g. reorganized and the widget is updated.

◆ insertChild()

virtual bool hdi::core::TreeColumnEntry::insertChild ( const std::string &  id_,
const TreeColumnEntry child_ 
)
virtual

Inserts an entry into the list of child entries at a given position.

Author
GW
Date
12/2022
Parameters
id_Existing entry immediately before the position at which the new entry will be inserted, as UTF-8; pass "" to insert at the beginning
child_New entry object to insert into the list of children
Returns
true if the entry is inserted successfully, false otherwise
Note
If the entry for id_ doesn't exist in the list, the new child will not be inserted.
If the passed child is already present in the list (based on its ID), it will not be inserted.

◆ isEmpty()

virtual bool hdi::core::TreeColumnEntry::isEmpty ( ) const
virtual

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

Author
GW
Date
01/2015
Returns
true if the target TreeColumnEntry object is empty, false otherwise

◆ operator!=()

virtual bool hdi::core::TreeColumnEntry::operator!= ( const TreeColumnEntry rhs_) const
virtual

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

Author
GW
Date
01/2015
Parameters
rhs_TreeColumnEntry to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different entries, false otherwise

◆ operator=()

virtual TreeColumnEntry & hdi::core::TreeColumnEntry::operator= ( const TreeColumnEntry rhs_)
virtual

Assigns one TreeColumnEntry object to another.

Author
GW
Date
01/2015
Parameters
rhs_Existing TreeColumnEntry object to copy values from
Returns
The target TreeColumnEntry object, but with its values updated to match that of the rhs_ argument

◆ operator==()

virtual bool hdi::core::TreeColumnEntry::operator== ( const TreeColumnEntry rhs_) const
virtual

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

Author
GW
Date
01/2015
Parameters
rhs_TreeColumnEntry to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same entry, false otherwise

◆ popChild()

virtual bool hdi::core::TreeColumnEntry::popChild ( TreeColumnEntry child__)
virtual

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

Author
GW
Date
01/2015
Parameters
child__Return-by-reference for the child entry that was removed
Returns
true if the child could be acquired and popped, false otherwise

◆ pushChild()

virtual bool hdi::core::TreeColumnEntry::pushChild ( const TreeColumnEntry child_)
virtual

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

Author
GW
Date
01/2015
Parameters
child_New child to add to the end of the list of children
Returns
true if the child could be pushed, false otherwise

◆ removeChild()

virtual bool hdi::core::TreeColumnEntry::removeChild ( const std::string &  id_,
TreeColumnEntry child__ 
)
virtual

Removes a specific entry from the list of child entries.

Author
GW
Date
12/2022
Parameters
id_ID of the entry to be removed, as UTF-8
entry__Return-by-reference for the removed child, so the caller can inspect which one was removed
Returns
true if the child was removed and acquired, false otherwise

◆ setEditable()

virtual void hdi::core::TreeColumnEntry::setEditable ( const EditableVector &  editable_)
virtual

Sets the editability of each cell in the entry (whether the user can edit it inline)

Author
GW
Date
07/2022
Parameters
enabled_true for enabled, false otherwise

◆ setEnabled()

virtual void hdi::core::TreeColumnEntry::setEnabled ( const bool  enabled_)
virtual

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

Author
GW
Date
01/2015
Parameters
enabled_true for enabled, false otherwise

◆ setEntryID()

virtual void hdi::core::TreeColumnEntry::setEntryID ( const std::string &  id_)
virtual

Sets the ID string of an entry.

Author
GW
Date
01/2015
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.

◆ setExpanded()

virtual void hdi::core::TreeColumnEntry::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

◆ setUserData()

virtual void hdi::core::TreeColumnEntry::setUserData ( const DataVector &  data_)
virtual

Sets the custom data of an entry.

Author
GW
Date
01/2015
Parameters
data_New custom data to store

◆ setValues()

virtual void hdi::core::TreeColumnEntry::setValues ( const ValueVector &  values_)
virtual

Sets the value objects of an entry.

Author
GW
Date
01/2015
Parameters
values_New entry value objects

◆ userData()

virtual DataVector hdi::core::TreeColumnEntry::userData ( ) const
virtual

Gets the custom data of an entry.

Author
GW
Date
01/2015
Returns
The data stored inside the target entry object

◆ values()

virtual ValueVector hdi::core::TreeColumnEntry::values ( ) const
virtual

Gets the value objects of an entry.

Author
GW
Date
01/2015
Returns
The entry's value objects