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

Allows combo boxes, popups, and lists to store more data than simply strings and indices. More...

#include <hdicoreListEntry.h>

Public Member Functions

 ListEntry ()
 Constructs an empty ListEntry object. More...
 
 ListEntry (const ListEntry &e_)
 Constructs a new ListEntry object from an existing ListEntry object (copy constructor) More...
 
 ListEntry (const std::string &id_, const std::string &value_, void *userData_, const bool enabled_=true)
 Constructs an ListEntry object with some custom data. More...
 
virtual ~ListEntry ()
 Destructs an ListEntry object. More...
 
virtual ListEntryoperator= (const ListEntry &rhs_)
 Assigns one ListEntry object to another. More...
 
virtual bool isEmpty () const
 Gets whether the target ListEntry 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 std::string value () const
 Gets the string value of an entry (what the user sees in the popup/list/etc.) More...
 
virtual void setValue (const std::string &value_)
 Sets the string value of an entry (what the user sees in the popup/list/etc.) More...
 
virtual bool enabled () const
 Gets whether the entry should be enabled (selectable by the user in the popup/list/etc.) More...
 
virtual void setEnabled (const bool enabled_)
 Sets whether the entry should be enabled (selectable by the user in the popup/list/etc.) 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 bool operator== (const ListEntry &rhs_) const
 Tests whether a given ListEntry object is the same as another. More...
 
virtual bool operator!= (const ListEntry &rhs_) const
 Tests whether a given ListEntry 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 ListEntry object with this as its value.
 

Friends

plugin::BaseEntryData * __accessImpl (const ListEntry &)
 

Detailed Description

Allows combo boxes, popups, and lists to store more data than simply strings and indices.

Constructor & Destructor Documentation

hdi::core::ListEntry::ListEntry ( )

Constructs an empty ListEntry object.

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

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

Author
GW
Date
09/2013
Parameters
e_Existing ListEntry object
hdi::core::ListEntry::ListEntry ( const std::string &  id_,
const std::string &  value_,
void *  userData_,
const bool  enabled_ = true 
)

Constructs an ListEntry object with some custom data.

Author
GW
Date
09/2013
Parameters
id_Entry ID string (must be unique across all entries in the target container), as UTF-8
value_Entry string value, as UTF-8
userData_Data to store in the entry
enabled_Whether the entry should be enabled
virtual hdi::core::ListEntry::~ListEntry ( )
virtual

Destructs an ListEntry object.

Author
GW
Date
09/2013

Member Function Documentation

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

Gets whether the entry should be enabled (selectable by the user in the popup/list/etc.)

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

Gets the ID string of an entry.

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

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

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

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

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

Assigns one ListEntry object to another.

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

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

Author
GW
Date
09/2013
Parameters
rhs_ListEntry to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same entry, false otherwise
virtual void hdi::core::ListEntry::setEnabled ( const bool  enabled_)
virtual

Sets whether the entry should be enabled (selectable by the user in the popup/list/etc.)

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

Sets the ID string of an entry.

Author
GW
Date
09/2013
Parameters
id_New entry ID string, as UTF-8
Note
It is up to the caller to ensure that the ID is not in use with other entries within the same container widget.
virtual void hdi::core::ListEntry::setUserData ( void *  data_)
virtual

Sets the custom data of an entry.

Author
GW
Date
09/2013
Parameters
data_New custom data to store
virtual void hdi::core::ListEntry::setValue ( const std::string &  value_)
virtual

Sets the string value of an entry (what the user sees in the popup/list/etc.)

Author
GW
Date
09/2013
Parameters
value_New entry string value, as UTF-8
virtual void* const hdi::core::ListEntry::userData ( ) const
virtual

Gets the custom data of an entry.

Author
GW
Date
09/2013
Returns
The data stored inside the target entry object
virtual std::string hdi::core::ListEntry::value ( ) const
virtual

Gets the string value of an entry (what the user sees in the popup/list/etc.)

Author
GW
Date
09/2013
Returns
The entry's string value, as UTF-8