Rose
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
rose::ButtonSemantics Class Reference

Interpret interaction events to drive button operation semantics. More...

#include <PointerInteractions.h>

Collaboration diagram for rose::ButtonSemantics:
Collaboration graph
[legend]

Public Member Functions

 ButtonSemantics (Widget &)
 
 ButtonSemantics (const ButtonSemantics &)=delete
 
 ButtonSemantics (ButtonSemantics &&)=delete
 
ButtonSemanticsoperator= (const ButtonSemantics &)=delete
 
ButtonSemanticsoperator= (ButtonSemantics &&)=delete
 
void setButtonType (ButtonType buttonType)
 
void setButtonDisplayCallback (ButtonDisplayCallback buttonDisplayCallback)
 Set the ButtonDisplayCallback function. More...
 
void setButtonStateChangeCallback (ButtonStateChangeCallback buttonStateChangeCallback)
 Set the ButtonStateChangeCallback function. More...
 
void setButtonCommandCallback (uint commandId, ButtonCommandCallback buttonCommandCallback)
 

Protected Types

enum  InteractionState {
  Inactive, Active, PressedActive, PressedInactive,
  SetActive, SetInactive
}
 Internal state. More...
 

Protected Member Functions

void setButtonState (bool active)
 Called when the Active/Inactive state is resolved.
 
void enterLeaveCallback ()
 Callback when the pointer enters or leaves the Widget.
 
void displayState ()
 Called when the button display state changes.
 

Protected Attributes

InteractionState mState {Inactive}
 Hold the internal interaction state.
 
ButtonType mButtonType {ButtonType::PushButton}
 The button type.
 
WidgetmWidget
 The Widget that implements the button.
 
uint mButtonCommandId {0}
 The Widget command associated with the button.
 
ButtonDisplayCallback mButtonDisplayCallback {}
 A callback to the Widget to change the display state.
 
ButtonStateChangeCallback mButtonStateChangeCallback {}
 A callback to the Widget with the new button state.
 
ButtonCommandCallback mButtonCommandCallback {}
 A callback to the Widget with the button state and command id.
 

Detailed Description

Interpret interaction events to drive button operation semantics.

Member Enumeration Documentation

◆ InteractionState

Internal state.

Enumerator
Inactive 

Button in Inactive state.

Active 

Button in Active state.

PressedActive 

Button was pressed in the Active state.

PressedInactive 

Button was pressed in the Inactive state.

SetActive 

Transitional state moving to Active.

SetInactive 

Transitional state moving to Inactive.

Member Function Documentation

◆ setButtonCommandCallback()

void rose::ButtonSemantics::setButtonCommandCallback ( uint  commandId,
ButtonCommandCallback  buttonCommandCallback 
)
inline
Parameters
Setthe ButtonCommandCallback.
commandIdThe identifier of the command to the Widget receiving the callback.
buttonCommandCallbackThe callback.

◆ setButtonDisplayCallback()

void rose::ButtonSemantics::setButtonDisplayCallback ( ButtonDisplayCallback  buttonDisplayCallback)
inline

Set the ButtonDisplayCallback function.

Parameters
buttonDisplayCallbackThe function.

◆ setButtonStateChangeCallback()

void rose::ButtonSemantics::setButtonStateChangeCallback ( ButtonStateChangeCallback  buttonStateChangeCallback)
inline

Set the ButtonStateChangeCallback function.

Parameters
buttonStateChangeCallbackThe function.

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