C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
UIModelManager Class Reference

This is an Abstract class that is used to implement the manager of object on a screen. More...

#include <ui_core.h>

Inheritance diagram for UIModelManager:
Inheritance graph
Collaboration diagram for UIModelManager:
Collaboration graph

Public Member Functions

 UIModelManager (bool is_wrappable=false)
 Construct a new UIModelManager object.
 
 ~UIModelManager ()
 Destroy the UIModelManager object.
 
void add_managed_model (UIControlledModel *_new_model)
 add a new Model to the list of managed objects.
 
- Public Member Functions inherited from UIControlledIncrementalValue
 UIControlledIncrementalValue (int min_value=0, int max_value=10, bool is_wrappable=false, int increment=1)
 Construct a new UIControlledIncrementalValue object.
 
 ~UIControlledIncrementalValue ()
 Destroy the UIControlledIncrementalValue object.
 
virtual void increment_value ()
 Add "increment" to the current value.
 
virtual void decrement_value ()
 Substract "increment" to the current value.
 
void set_clipped_value (int _new_value)
 Set value to _new_value, and clip the result to min or max value if needed.
 
int get_value ()
 Get the value object.
 
int get_min_value ()
 Get the min value object.
 
int get_max_value ()
 Get the max value object.
 
- Public Member Functions inherited from UIControlledModel
void update_status (ControlledObjectStatus _new_status)
 check if the _new_status change is effective, then change it and set the change_flag to true.
 
void update_current_controller (UIController *_new_controller)
 if _new_controller is different from the current controller, change the current controller associated to the Model. the new controller has is member current_controlled_model also changed.
 
ControlledObjectStatus get_status ()
 Get the status object.
 
UIControllerget_current_controller ()
 Get the current controller object.
 
virtual void process_control_event (UIControlEvent _event)=0
 The purpose of this function is to implement the behavior of the implemented model object when a ControlEvent is received.
 
- Public Member Functions inherited from Model
 Model ()
 Construct the Model object.
 
 ~Model ()
 Destroy the Model object.
 
void update_attached_widgets (Widget *new_widget)
 add a new widget to the set of attached_widgets
 
int get_number_of_attached_widget ()
 get the number of attached widgets
 
bool has_changed ()
 get the change flag status
 
void set_change_flag ()
 Set the change flag object to true.
 
void draw_widget_done ()
 Set the change flag object to false.
 
uint32_t get_time_since_last_change ()
 compute time since the last status change
 
virtual void draw_refresh_all_attached_widgets ()
 update drawing for each attached widgets
 

Protected Member Functions

ControlledObjectStatusTimeOutReason check_time_out (uint32_t managed_object_status_time_out_us=3000000)
 check if there is a time out either on the managed models or the manager itself.
 
void make_managed_model_active ()
 change the status of model object under focus to IS_ACTIVE
 
void make_manager_active ()
 leave the current managed object and return control to the manager
 
virtual void increment_focus ()
 set focus on the next model in the list.
 
virtual void decrement_focus ()
 set focus on the previous model in the list.
 

Protected Attributes

std::vector< UIControlledModel * > managed_models
 The list of managed objects.
 
UIControlledModelcurrent_active_model
 the reference to the current active model object
 
- Protected Attributes inherited from UIControlledIncrementalValue
int value
 The internal value incremented or decremented by action on the controller.
 
int max_value
 The maximum value that can be reached. Can be either negative or positive.
 
int min_value
 The minimum value that can be reached. Can be either negative or positive.
 
int increment
 The number that is added or substracted to the current value. Default to 1.
 
bool is_wrappable
 If true, once the max (resp. min) value is reached, the next one wraps to min (resp*; max) value. If false values are clipped on min and max values.
 
- Protected Attributes inherited from Model
std::set< Widget * > attached_widgets
 the set of widgets that are in charge of viewing this model.
 

Detailed Description

This is an Abstract class that is used to implement the manager of object on a screen.

An UIModelManager is built from :

Constructor & Destructor Documentation

◆ UIModelManager()

UIModelManager::UIModelManager ( bool is_wrappable = false)

Construct a new UIModelManager object.

Parameters
is_wrappableif true, the scan over managed object wrap.
Here is the call graph for this function:

Member Function Documentation

◆ add_managed_model()

void UIModelManager::add_managed_model ( UIControlledModel * _new_model)

add a new Model to the list of managed objects.

Parameters
_new_model

◆ check_time_out()

ControlledObjectStatusTimeOutReason UIModelManager::check_time_out ( uint32_t managed_object_status_time_out_us = 3000000)
protected

check if there is a time out either on the managed models or the manager itself.

This means no action on focus control and active status control.

NOTICE: this is usefull when controller use IRQ, because we cannot detect no action when no more IRQ are triggered (up to now)

Parameters
managed_object_status_time_out_usthe time out value in microsecond. default to 3000000 (3seconds)
Returns
ControlledObjectStatusTimeOutReason
  • chek time_out for active model
  • check time_out for model under focus
Here is the call graph for this function:

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