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

General widget view information class. The WidgetViewBase holds the general information of a WidgetView. More...

#include "WidgetViewBase.h"

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

Public Types

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

 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)
 
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 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 (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.
 

Detailed Description

General widget view information class. The WidgetViewBase holds the general information of a WidgetView.

Member Typedef Documentation

◆ ViewFlags

Member Enumeration Documentation

◆ ViewDockLocation

/ref ViewFlag "ViewFlag"

The ViewDockLocation is used to determine the dock location when adding the view to the manager.

Enumerator
Default 
Left 

Default (Central) dock location.

Top 

Left dock location.

Right 

Top dock location.

Bottom 

Right dock location.

Bottom dock location.

◆ ViewFlag

ViewFlags are used to describe the view behaviour in the frontend.

Enumerator
NoViewFlags 
ViewIsCloseable 

Default value (no flags set)

ViewDefaultCloseHandling 

If set the view may be closed.

ViewIsPinnable 

If set and 'ViewIsCloseable' is set the view will close with the default close behaviour, otherwise a closeRequested signal is emitted.

ViewIsCentral 

If set the view may be pinned to the auto hide areas.

ViewIsSide 

If set the view is assumed to be a main view and therefore rather be located in the middle of the screen (Should not be mixed with ViewIsSide or ViewIsTool).

ViewIsTool 

If set the view is assumed to be a side view and therefore rather be located on the outer dock areas of the screen (Should not be mixed with ViewIsCentral or ViewIsTool).

◆ ViewType

Enumerator
View3D 
View1D 

3D view.

ViewText 

1D plot view.

ViewTable 

Text editor view.

ViewVersion 

Table view.

ViewGraphics 

Version graph view.

ViewGraphicsPicker 

Graphics view.

ViewProperties 

Graphics picker view.

ViewNavigation 

Properties view.

CustomView 

Navigation view.

Custom view.

Constructor & Destructor Documentation

◆ WidgetViewBase() [1/4]

ot::WidgetViewBase::WidgetViewBase ( ViewType _type,
ViewFlags _flags = ViewFlags() )

◆ WidgetViewBase() [2/4]

ot::WidgetViewBase::WidgetViewBase ( const std::string & _entityName,
const std::string & _title,
ViewType _type,
ViewFlags _flags = ViewFlags() )

◆ WidgetViewBase() [3/4]

ot::WidgetViewBase::WidgetViewBase ( const std::string & _entityName,
const std::string & _title,
ViewDockLocation _dockLocation,
ViewType _type,
ViewFlags _flags = ViewFlags() )

◆ WidgetViewBase() [4/4]

ot::WidgetViewBase::WidgetViewBase ( const WidgetViewBase & _other)

◆ ~WidgetViewBase()

ot::WidgetViewBase::~WidgetViewBase ( )
virtual

Member Function Documentation

◆ addToJsonObject()

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

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference
_allocatorAllocator

Reimplemented from ot::BasicEntityInformation.

Reimplemented in ot::TableCfg, and ot::TextEditorCfg.

◆ getDockLocation()

ViewDockLocation ot::WidgetViewBase::getDockLocation ( void ) const
inline

Returns the dock location.

◆ getTitle()

const std::string & ot::WidgetViewBase::getTitle ( void ) const
inline

◆ getViewFlags()

ViewFlags ot::WidgetViewBase::getViewFlags ( void ) const
inline

Returns the current flags.

◆ getViewType()

ViewType ot::WidgetViewBase::getViewType ( void ) const
inline

◆ operator=()

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

◆ setDockLocation()

void ot::WidgetViewBase::setDockLocation ( ViewDockLocation _dockLocation)
inline

Set the dock location.

Parameters
_dockLocationThe dock location to set.

◆ setEntityInformation()

void ot::WidgetViewBase::setEntityInformation ( const BasicEntityInformation & _info)

◆ setFromJsonObject()

void ot::WidgetViewBase::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)

Reimplemented from ot::BasicEntityInformation.

Reimplemented in ot::TableCfg, and ot::TextEditorCfg.

◆ setTitle()

void ot::WidgetViewBase::setTitle ( const std::string & _title)
inline

◆ setViewFlag()

void ot::WidgetViewBase::setViewFlag ( ViewFlag _flag,
bool _active = true )
inline

Set the widget view flag.

Parameters
_flagFlag to set.
_activeIf false the flag will be unset instead.

◆ setViewFlags()

void ot::WidgetViewBase::setViewFlags ( ViewFlags _flags)
inline

Replace the current flags with the flags provided.

◆ setViewType()

void ot::WidgetViewBase::setViewType ( ViewType _type)
inline

◆ stringListToViewFlags()

ot::WidgetViewBase::ViewFlags ot::WidgetViewBase::stringListToViewFlags ( const std::list< std::string > & _flags)
static

Returns the view flags represented by the provided string list.

Parameters
_flagsThe string representations of the set flags (/ref toStringList(ViewFlags _flags) "Flags to string list").

◆ stringToDockLocation()

ot::WidgetViewBase::ViewDockLocation ot::WidgetViewBase::stringToDockLocation ( const std::string & _dockLocation)
static

Returns the view dock location represented by the provided string.

Parameters
_dockLocationThe string representing the dock location (/ref toString(ViewDockLocation _dockLocation) "Dock location to string")

◆ stringToViewFlag()

ot::WidgetViewBase::ViewFlag ot::WidgetViewBase::stringToViewFlag ( const std::string & _flag)
static

Returns The view flag represented by the provided string.

Parameters
_flagThe string representing the flag (/ref toString(ViewFlag _flag) "Flag to string").

◆ stringToViewType()

ot::WidgetViewBase::ViewType ot::WidgetViewBase::stringToViewType ( const std::string & _type)
static

Returns the view type represented by the provided string.

◆ toString() [1/3]

std::string ot::WidgetViewBase::toString ( ViewDockLocation _dockLocation)
static

Returns the string representation of the provided view dock location.

Parameters
Theview dock location to be converted to a string.

◆ toString() [2/3]

std::string ot::WidgetViewBase::toString ( ViewFlag _flag)
static

Returns a string representation of the provided view flag.

Parameters
_flagThe single view flag to be converted to a string.

◆ toString() [3/3]

std::string ot::WidgetViewBase::toString ( ViewType _type)
static

Returns the string representation of the provided view type.

◆ toStringList()

std::list< std::string > ot::WidgetViewBase::toStringList ( ViewFlags _flags)
static

Returns a string list contaning a string representation of every set flag in the provided view flags.

Parameters
_flagsThe flags to be converted to a string list.

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