SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | List of all members
smtk::view::UIElementState Class Referenceabstract

A base class for user interface elements that wish to serialize their state. More...

#include <UIElementState.h>

Inheritance diagram for smtk::view::UIElementState:
[legend]

Public Member Functions

 smtkTypenameMacroBase (UIElementState)
 
virtual smtk::string::Token elementType () const =0
 Return an (application-unique) token for the type of user-interface element this state object will serialize/deserialize. More...
 
virtual nlohmann::json configuration ()=0
 Return the UI element's current, in-memory state to be serialized.
 
virtual bool configure (const nlohmann::json &data)=0
 Using the deserialized configuration data, configure the user interface element to match it.
 

Detailed Description

A base class for user interface elements that wish to serialize their state.

UI elements, such as panels, should

  1. Inherit or own an instance of this class.
  2. Insert this class into a map of such instances held by the smtk::common::Managers object used for application context.

Read and write operations will then iterate the map to serialize or deserialize each entry.

Member Function Documentation

◆ elementType()

virtual smtk::string::Token smtk::view::UIElementState::elementType ( ) const
pure virtual

Return an (application-unique) token for the type of user-interface element this state object will serialize/deserialize.

We suggest the type-name of the UI element (e.g., "pqSMTKDiagramPanel") that owns or inherits this UIElementState instance.

Implemented in pqSMTKDiagramPanel.


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