25 #ifndef WITEMSELECTIONITEM_H
26 #define WITEMSELECTIONITEM_H
41 typedef std::shared_ptr< WItemSelectionItem >
SPtr;
46 typedef std::shared_ptr< const WItemSelectionItem >
ConstSPtr;
55 WItemSelectionItem( std::string name, std::string description =
"",
const char** icon = NULL );
88 template<
typename T >
91 return dynamic_cast< T*
>( this );
99 template<
typename T >
102 return dynamic_cast< T*
>( this );
Class for keeping a single named item in a WItemSelection.
T * getAs()
Dynamic cast of the object, if a derivative of WItemSelectionItem was add to WItemSelection.
virtual ~WItemSelectionItem()
Destruction.
std::string getDescription() const
The description of the item.
std::string m_description
Item description.
bool operator==(const WItemSelectionItem &other) const
Compares this and another item using their names only.
const T * getAs() const
Dynamic cast of the object, if a derivative of WItemSelectionItem was add to WItemSelection.
WItemSelectionItem(std::string name, std::string description="", const char **icon=NULL)
Constructs a new item with the specified values.
const char ** m_icon
Item icon.
std::shared_ptr< const WItemSelectionItem > ConstSPtr
Abbreviation for a const shared pointer.
std::string getName() const
Returns the name of the item.
const char ** getIcon() const
The icon associated with this item.
std::shared_ptr< WItemSelectionItem > SPtr
Abbreviation for a shared pointer.
std::string m_name
Item name.