11#if !defined(UI_CORE_H)
14#include "pico/stdlib.h"
15#include "framebuffer.h"
31 RELEASED_AFTER_LONG_TIME,
32 RELEASED_AFTER_SHORT_TIME,
58 bool with_border{
true};
59 bool with_label{
true};
62 const unsigned char *font{
nullptr};
84 UIDisplayDevice(
size_t width,
size_t height, FramebufferFormat format = FramebufferFormat::MONO_VLSB, StructFramebufferText txt_cnf = {.font = font_8x8});
104 virtual void show(Framebuffer *frame, uint8_t anchor_x, uint8_t anchor_y) = 0;
118 bool change_flag{
true};
158 void clear_change_flag();
238 virtual void increment_value();
243 virtual void decrement_value();
281 std::vector<UIModelObject *> managed_models;
291 void make_managed_object_active();
296 void make_manager_active();
301 virtual void increment_focus();
306 virtual void decrement_focus();
380 bool widget_with_border{
true};
385 uint8_t widget_anchor_x;
390 uint8_t widget_anchor_y;
401 std::vector<UIWidget *> widgets;
406 size_t widget_width{128};
411 size_t widget_height{8};
416 uint8_t widget_start_x;
421 uint8_t widget_start_y;
426 uint8_t widget_border_width;
448 virtual void draw() = 0;
457 static FramebufferColor
blinking_us(uint32_t _blink_period);
472 uint8_t _widget_anchor_x, uint8_t _widget_anchor_y,
bool _widget_with_border, uint8_t _widget_border_width = 1,
473 FramebufferFormat _framebuffer_format = FramebufferFormat::MONO_VLSB, StructFramebufferText _framebuffer_txt_cnf = {.font = font_8x8});
~UIControlledIncrementalValue()
Destroy the UIControlledIncrementalValue object.
int get_max_value()
Get the max value object.
UIControlledIncrementalValue(int _min_value=0, int _max_value=10, bool _is_wrapable=false, int increment=1)
Construct a new UIControlledIncrementalValue object.
int get_min_value()
Get the min value object.
void set_clipped_value(int _new_value)
Set the clipped value object.
int get_value()
Get the value object.
void update_current_controlled_object(UIModelObject *_new_controlled_object)
~UIController()
Destroy the UIController object.
This is the abstract class to handle all generic behavior of physical display devices (e....
UIDisplayDevice(size_t width, size_t height, FramebufferFormat format=FramebufferFormat::MONO_VLSB, StructFramebufferText txt_cnf={.font=font_8x8})
Construct a new UIDisplayDevice object.
virtual void show(Framebuffer *frame, uint8_t anchor_x, uint8_t anchor_y)=0
This is an pure virtual member function that all final derived class must implement....
virtual ~UIDisplayDevice()
Destroy the UIDisplayDevice object.
virtual void show()=0
This is an pure virtual member function that all final derived class must implement....
void update_status(ControlledObjectStatus _new_status)
~UIModelObject()
Destroy the UIModelObject object.
void set_change_flag()
Set the change flag object.
virtual void process_control_event(ControlEvent _event)=0
ControlledObjectStatus get_status()
Get the status object.
void update_current_controller(UIController *_new_controller)
~UIObjectManager()
Destroy the UIObjectManager object.
void add_managed_model(UIModelObject *_new_model)
ControlledObjectStatus
The list of status that a model can have.
ControlEvent
The list of predefined event that a Controller can send to the controlled object, leaving it the resp...