OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::NavigationTreeItem Class Reference

#include "NavigationTreeItem.h"

Inheritance diagram for ot::NavigationTreeItem:
ot::Serializable

Public Member Functions

 NavigationTreeItem ()
 
 NavigationTreeItem (const std::string &_text, ot::NavigationTreeItemFlags _flags=ot::NoNavigationTreeItemFlags)
 
 NavigationTreeItem (const std::string &_text, const std::string &_iconPath, ot::NavigationTreeItemFlags _flags=ot::NoNavigationTreeItemFlags)
 
 NavigationTreeItem (const std::string &_text, const std::string &_iconPath, const std::list< NavigationTreeItem > &_childItems, ot::NavigationTreeItemFlags _flags=ot::NoNavigationTreeItemFlags)
 
 NavigationTreeItem (const NavigationTreeItem &_other)
 
virtual ~NavigationTreeItem ()
 
NavigationTreeItemoperator= (const NavigationTreeItem &_other)
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ot::ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
void setText (const std::string &_text)
 
const std::string text (void) const
 
void setIconPath (const std::string &_iconPath)
 
const std::string & iconPath (void) const
 
void addChildItem (const NavigationTreeItem &_item)
 
void setChildItems (const std::list< NavigationTreeItem > &_items)
 
const std::list< NavigationTreeItem > & childItems (void) const
 
void setFlag (NavigationTreeItemFlag _flag, bool _active=true)
 
void setFlags (ot::NavigationTreeItemFlags _flags)
 
ot::NavigationTreeItemFlags flags (void) const
 
void merge (const NavigationTreeItem &_other)
 
std::string itemPath (char _delimiter='/', const std::string &_suffix=std::string()) const
 
bool filter (NavigationTreeItemFlags _flags)
 Removes all child items which dont have the flag(s) set Returns true if this item or any of the childs matches the filter.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Protected Member Functions

void setParentNavigationTreeItem (NavigationTreeItem *_parent)
 
NavigationTreeItemparentNavigationTreeItem (void) const
 

Constructor & Destructor Documentation

◆ NavigationTreeItem() [1/5]

ot::NavigationTreeItem::NavigationTreeItem ( )

◆ NavigationTreeItem() [2/5]

ot::NavigationTreeItem::NavigationTreeItem ( const std::string & _text,
ot::NavigationTreeItemFlags _flags = ot::NoNavigationTreeItemFlags )

◆ NavigationTreeItem() [3/5]

ot::NavigationTreeItem::NavigationTreeItem ( const std::string & _text,
const std::string & _iconPath,
ot::NavigationTreeItemFlags _flags = ot::NoNavigationTreeItemFlags )

◆ NavigationTreeItem() [4/5]

ot::NavigationTreeItem::NavigationTreeItem ( const std::string & _text,
const std::string & _iconPath,
const std::list< NavigationTreeItem > & _childItems,
ot::NavigationTreeItemFlags _flags = ot::NoNavigationTreeItemFlags )

◆ NavigationTreeItem() [5/5]

ot::NavigationTreeItem::NavigationTreeItem ( const NavigationTreeItem & _other)

◆ ~NavigationTreeItem()

ot::NavigationTreeItem::~NavigationTreeItem ( )
virtual

Member Function Documentation

◆ addChildItem()

void ot::NavigationTreeItem::addChildItem ( const NavigationTreeItem & _item)

◆ addToJsonObject()

void ot::NavigationTreeItem::addToJsonObject ( ot::JsonValue & _object,
ot::JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference
_allocatorAllocator

Implements ot::Serializable.

◆ childItems()

const std::list< NavigationTreeItem > & ot::NavigationTreeItem::childItems ( void ) const
inline

◆ filter()

bool ot::NavigationTreeItem::filter ( NavigationTreeItemFlags _flags)

Removes all child items which dont have the flag(s) set Returns true if this item or any of the childs matches the filter.

◆ flags()

ot::NavigationTreeItemFlags ot::NavigationTreeItem::flags ( void ) const
inline

◆ iconPath()

const std::string & ot::NavigationTreeItem::iconPath ( void ) const
inline

◆ itemPath()

std::string ot::NavigationTreeItem::itemPath ( char _delimiter = '/',
const std::string & _suffix = std::string() ) const

◆ merge()

void ot::NavigationTreeItem::merge ( const NavigationTreeItem & _other)

◆ operator=()

ot::NavigationTreeItem & ot::NavigationTreeItem::operator= ( const NavigationTreeItem & _other)

◆ parentNavigationTreeItem()

NavigationTreeItem * ot::NavigationTreeItem::parentNavigationTreeItem ( void ) const
inlineprotected

◆ setChildItems()

void ot::NavigationTreeItem::setChildItems ( const std::list< NavigationTreeItem > & _items)

◆ setFlag()

void ot::NavigationTreeItem::setFlag ( NavigationTreeItemFlag _flag,
bool _active = true )
inline

◆ setFlags()

void ot::NavigationTreeItem::setFlags ( ot::NavigationTreeItemFlags _flags)
inline

◆ setFromJsonObject()

void ot::NavigationTreeItem::setFromJsonObject ( const ot::ConstJsonObject & _object)
overridevirtual

Will set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Implements ot::Serializable.

◆ setIconPath()

void ot::NavigationTreeItem::setIconPath ( const std::string & _iconPath)
inline

◆ setParentNavigationTreeItem()

void ot::NavigationTreeItem::setParentNavigationTreeItem ( NavigationTreeItem * _parent)
inlineprotected

◆ setText()

void ot::NavigationTreeItem::setText ( const std::string & _text)
inline

◆ text()

const std::string ot::NavigationTreeItem::text ( void ) const
inline

The documentation for this class was generated from the following files: