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

#include "TableCfg.h"

Inheritance diagram for ot::TableCfg:
ot::WidgetViewBase ot::BasicEntityInformation ot::Serializable

Public Types

enum class  TableHeaderMode { NoHeader , Horizontal , Vertical }
 
- Public Types inherited from ot::WidgetViewBase
enum  ViewFlag {
  NoViewFlags = 0x00 , ViewIsCloseable = 0x01 , ViewDefaultCloseHandling = 0x02 , ViewIsPinnable = 0x04 ,
  ViewIsCentral = 0x10 , ViewIsSide = 0x20 , ViewIsTool = 0x40
}
 ViewFlags are used to describe the view behaviour in the frontend. More...
 
enum  ViewDockLocation {
  Default , Left , Top , Right ,
  Bottom
}
 /ref ViewFlag "ViewFlag" More...
 
enum  ViewType {
  View3D , View1D , ViewText , ViewTable ,
  ViewVersion , ViewGraphics , ViewGraphicsPicker , ViewProperties ,
  ViewNavigation , CustomView
}
 
typedef Flags< ViewFlagViewFlags
 

Public Member Functions

 TableCfg (int _rows=0, int _columns=0, WidgetViewBase _baseInfo=WidgetViewBase(WidgetViewBase::ViewTable, WidgetViewBase::ViewIsCentral|WidgetViewBase::ViewIsCloseable))
 
 TableCfg (const ot::GenericDataStructMatrix &_matrix, TableCfg::TableHeaderMode _headerMode)
 
 TableCfg (const TableCfg &_other)
 
 TableCfg (TableCfg &&_other) noexcept
 
virtual ~TableCfg ()
 
TableCfgoperator= (const TableCfg &_other)
 
TableCfgoperator= (TableCfg &&_other) noexcept
 
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
 Set the object contents from the provided JSON object.
 
GenericDataStructMatrix createMatrix (void) const
 
void clear (void)
 Clears all the data. Resets the row and column count back to 0.
 
int getRowCount (void) const
 
int getColumnCount (void) const
 
const std::vector< std::vector< std::string > > & getRows (void) const
 
const std::vector< std::string > & getRow (int _row) const
 
void setCellText (int _row, int _column, const std::string &_text)
 
const std::string & getCellText (int _row, int _column) const
 
void setRowHeader (int _row, const std::string &_headerText)
 
void setRowHeader (int _row, TableHeaderItemCfg *_item)
 
const TableHeaderItemCfggetRowHeader (int _row) const
 
void setColumnHeader (int _column, const std::string &_headerText)
 
void setColumnHeader (int _column, TableHeaderItemCfg *_item)
 
const TableHeaderItemCfggetColumnHeader (int _column) const
 
- Public Member Functions inherited from ot::WidgetViewBase
 WidgetViewBase (ViewType _type, ViewFlags _flags=ViewFlags())
 
 WidgetViewBase (const std::string &_entityName, const std::string &_title, ViewType _type, ViewFlags _flags=ViewFlags())
 
 WidgetViewBase (const std::string &_entityName, const std::string &_title, ViewDockLocation _dockLocation, ViewType _type, ViewFlags _flags=ViewFlags())
 
 WidgetViewBase (const WidgetViewBase &_other)
 
virtual ~WidgetViewBase ()
 
WidgetViewBaseoperator= (const WidgetViewBase &_other)
 
void setTitle (const std::string &_title)
 
const std::string & getTitle (void) const
 
void setViewFlag (ViewFlag _flag, bool _active=true)
 Set the widget view flag.
 
void setViewFlags (ViewFlags _flags)
 Replace the current flags with the flags provided.
 
ViewFlags getViewFlags (void) const
 Returns the current flags.
 
void setViewType (ViewType _type)
 
ViewType getViewType (void) const
 
void setDockLocation (ViewDockLocation _dockLocation)
 Set the dock location.
 
ViewDockLocation getDockLocation (void) const
 Returns the dock location.
 
void setEntityInformation (const BasicEntityInformation &_info)
 
- Public Member Functions inherited from ot::BasicEntityInformation
 BasicEntityInformation ()
 
 BasicEntityInformation (const std::string &_entityName)
 
 BasicEntityInformation (const std::string &_entityName, UID _entityId, UID _entityVersion)
 
 BasicEntityInformation (const BasicEntityInformation &_other)
 
virtual ~BasicEntityInformation ()
 
BasicEntityInformationoperator= (const BasicEntityInformation &_other)
 
void setEntityName (const std::string &_entityName)
 
const std::string & getEntityName (void) const
 
void setEntityID (UID _entityId)
 
UID getEntityID (void) const
 
void setEntityVersion (UID _entityVersion)
 
UID getEntityVersion (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string toString (TableHeaderMode _headerMode)
 
static TableHeaderMode stringToHeaderMode (const std::string &_headerMode)
 
- Static Public Member Functions inherited from ot::WidgetViewBase
static std::string toString (ViewFlag _flag)
 Returns a string representation of the provided view flag.
 
static ViewFlag stringToViewFlag (const std::string &_flag)
 Returns The view flag represented by the provided string.
 
static std::list< std::string > toStringList (ViewFlags _flags)
 Returns a string list contaning a string representation of every set flag in the provided view flags.
 
static ViewFlags stringListToViewFlags (const std::list< std::string > &_flags)
 Returns the view flags represented by the provided string list.
 
static std::string toString (ViewDockLocation _dockLocation)
 Returns the string representation of the provided view dock location.
 
static ViewDockLocation stringToDockLocation (const std::string &_dockLocation)
 Returns the view dock location represented by the provided string.
 
static std::string toString (ViewType _type)
 Returns the string representation of the provided view type.
 
static ViewType stringToViewType (const std::string &_type)
 Returns the view type represented by the provided string.
 

Member Enumeration Documentation

◆ TableHeaderMode

enum class ot::TableCfg::TableHeaderMode
strong
Enumerator
NoHeader 
Horizontal 
Vertical 

Constructor & Destructor Documentation

◆ TableCfg() [1/4]

ot::TableCfg::TableCfg ( int _rows = 0,
int _columns = 0,
WidgetViewBase _baseInfo = WidgetViewBase(WidgetViewBase::ViewTableWidgetViewBase::ViewIsCentral | WidgetViewBase::ViewIsCloseable) )

◆ TableCfg() [2/4]

ot::TableCfg::TableCfg ( const ot::GenericDataStructMatrix & _matrix,
TableCfg::TableHeaderMode _headerMode )

◆ TableCfg() [3/4]

ot::TableCfg::TableCfg ( const TableCfg & _other)

◆ TableCfg() [4/4]

ot::TableCfg::TableCfg ( TableCfg && _other)
noexcept

◆ ~TableCfg()

ot::TableCfg::~TableCfg ( )
virtual

Member Function Documentation

◆ addToJsonObject()

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

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference to write the data to.
_allocatorAllocator.

Reimplemented from ot::WidgetViewBase.

◆ clear()

void ot::TableCfg::clear ( void )

Clears all the data. Resets the row and column count back to 0.

◆ createMatrix()

ot::GenericDataStructMatrix ot::TableCfg::createMatrix ( void ) const

◆ getCellText()

const std::string & ot::TableCfg::getCellText ( int _row,
int _column ) const

◆ getColumnCount()

int ot::TableCfg::getColumnCount ( void ) const
inline

◆ getColumnHeader()

const ot::TableHeaderItemCfg * ot::TableCfg::getColumnHeader ( int _column) const

◆ getRow()

const std::vector< std::string > & ot::TableCfg::getRow ( int _row) const

◆ getRowCount()

int ot::TableCfg::getRowCount ( void ) const
inline

◆ getRowHeader()

const ot::TableHeaderItemCfg * ot::TableCfg::getRowHeader ( int _row) const

◆ getRows()

const std::vector< std::vector< std::string > > & ot::TableCfg::getRows ( void ) const
inline

◆ operator=() [1/2]

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

◆ operator=() [2/2]

ot::TableCfg & ot::TableCfg::operator= ( TableCfg && _other)
noexcept

◆ setCellText()

void ot::TableCfg::setCellText ( int _row,
int _column,
const std::string & _text )

◆ setColumnHeader() [1/2]

void ot::TableCfg::setColumnHeader ( int _column,
const std::string & _headerText )

◆ setColumnHeader() [2/2]

void ot::TableCfg::setColumnHeader ( int _column,
TableHeaderItemCfg * _item )

◆ setFromJsonObject()

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

Set the object contents from the provided JSON object.

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

Reimplemented from ot::WidgetViewBase.

◆ setRowHeader() [1/2]

void ot::TableCfg::setRowHeader ( int _row,
const std::string & _headerText )

◆ setRowHeader() [2/2]

void ot::TableCfg::setRowHeader ( int _row,
TableHeaderItemCfg * _item )

◆ stringToHeaderMode()

ot::TableCfg::TableHeaderMode ot::TableCfg::stringToHeaderMode ( const std::string & _headerMode)
static

◆ toString()

std::string ot::TableCfg::toString ( TableHeaderMode _headerMode)
static

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