ESPHome  2024.9.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::display_menu_base::DisplayMenuComponent Class Referenceabstract

Class to display a hierarchical menu. More...

#include <display_menu_base.h>

Inheritance diagram for esphome::display_menu_base::DisplayMenuComponent:
esphome::Component esphome::graphical_display_menu::GraphicalDisplayMenu esphome::lcd_menu::LCDCharacterMenuComponent

Public Member Functions

void set_root_item (MenuItemMenu *item)
 
void set_active (bool active)
 
void set_mode (MenuMode mode)
 
void set_rows (uint8_t rows)
 
float get_setup_priority () const override
 
void up ()
 
void down ()
 
void left ()
 
void right ()
 
void enter ()
 
void show_main ()
 
void show ()
 
void hide ()
 
void draw ()
 
bool is_active () const
 
- Public Member Functions inherited from esphome::Component
virtual void setup ()
 Where the component's initialization should happen. More...
 
virtual void loop ()
 This method will be called repeatedly. More...
 
virtual void dump_config ()
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed. More...
 
bool is_failed () const
 
bool is_ready () const
 
virtual bool can_proceed ()
 
bool status_has_warning () const
 
bool status_has_error () const
 
void status_set_warning (const char *message="unspecified")
 
void status_set_error (const char *message="unspecified")
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 

Protected Member Functions

void reset_ ()
 
void process_initial_ ()
 
bool check_healthy_and_active_ ()
 
MenuItemget_selected_item_ ()
 
bool cursor_up_ ()
 
bool cursor_down_ ()
 
bool enter_menu_ ()
 
bool leave_menu_ ()
 
void finish_editing_ ()
 
virtual void draw_menu ()
 
virtual void draw_item (const MenuItem *item, uint8_t row, bool selected)=0
 
virtual void update ()
 
virtual void draw_and_update ()
 
virtual void on_before_show ()
 
virtual void on_after_show ()
 
virtual void on_before_hide ()
 
virtual void on_after_hide ()
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 

Protected Attributes

uint8_t rows_
 
bool active_
 
MenuMode mode_
 
MenuItemMenuroot_item_ {nullptr}
 
MenuItemMenudisplayed_item_ {nullptr}
 
uint8_t top_index_ {0}
 
uint8_t cursor_index_ {0}
 
std::forward_list< std::pair< uint8_t, uint8_t > > selection_stack_ {}
 
bool editing_ {false}
 
bool root_on_enter_called_ {false}
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 

Detailed Description

Class to display a hierarchical menu.

Definition at line 22 of file display_menu_base.h.

Member Function Documentation

◆ check_healthy_and_active_()

bool esphome::display_menu_base::DisplayMenuComponent::check_healthy_and_active_ ( )
protected

Definition at line 241 of file display_menu_base.cpp.

◆ cursor_down_()

bool esphome::display_menu_base::DisplayMenuComponent::cursor_down_ ( )
protected

Definition at line 265 of file display_menu_base.cpp.

◆ cursor_up_()

bool esphome::display_menu_base::DisplayMenuComponent::cursor_up_ ( )
protected

Definition at line 250 of file display_menu_base.cpp.

◆ down()

void esphome::display_menu_base::DisplayMenuComponent::down ( )

Definition at line 28 of file display_menu_base.cpp.

◆ draw()

void esphome::display_menu_base::DisplayMenuComponent::draw ( )

Definition at line 164 of file display_menu_base.cpp.

◆ draw_and_update()

virtual void esphome::display_menu_base::DisplayMenuComponent::draw_and_update ( )
inlineprotectedvirtual

Reimplemented in esphome::graphical_display_menu::GraphicalDisplayMenu.

Definition at line 58 of file display_menu_base.h.

◆ draw_item()

virtual void esphome::display_menu_base::DisplayMenuComponent::draw_item ( const MenuItem item,
uint8_t  row,
bool  selected 
)
protectedpure virtual

◆ draw_menu()

void esphome::display_menu_base::DisplayMenuComponent::draw_menu ( )
protectedvirtual

◆ enter()

void esphome::display_menu_base::DisplayMenuComponent::enter ( )

Definition at line 116 of file display_menu_base.cpp.

◆ enter_menu_()

bool esphome::display_menu_base::DisplayMenuComponent::enter_menu_ ( )
protected

Definition at line 280 of file display_menu_base.cpp.

◆ finish_editing_()

void esphome::display_menu_base::DisplayMenuComponent::finish_editing_ ( )
protected

Definition at line 306 of file display_menu_base.cpp.

◆ get_selected_item_()

MenuItem* esphome::display_menu_base::DisplayMenuComponent::get_selected_item_ ( )
inlineprotected

Definition at line 49 of file display_menu_base.h.

◆ get_setup_priority()

float esphome::display_menu_base::DisplayMenuComponent::get_setup_priority ( ) const
inlineoverridevirtual

Reimplemented from esphome::Component.

Reimplemented in esphome::lcd_menu::LCDCharacterMenuComponent.

Definition at line 29 of file display_menu_base.h.

◆ hide()

void esphome::display_menu_base::DisplayMenuComponent::hide ( )

Definition at line 215 of file display_menu_base.cpp.

◆ is_active()

bool esphome::display_menu_base::DisplayMenuComponent::is_active ( ) const
inline

Definition at line 43 of file display_menu_base.h.

◆ leave_menu_()

bool esphome::display_menu_base::DisplayMenuComponent::leave_menu_ ( )
protected

Definition at line 290 of file display_menu_base.cpp.

◆ left()

void esphome::display_menu_base::DisplayMenuComponent::left ( )

Definition at line 49 of file display_menu_base.cpp.

◆ on_after_hide()

virtual void esphome::display_menu_base::DisplayMenuComponent::on_after_hide ( )
inlineprotectedvirtual

Definition at line 66 of file display_menu_base.h.

◆ on_after_show()

virtual void esphome::display_menu_base::DisplayMenuComponent::on_after_show ( )
inlineprotectedvirtual

Definition at line 64 of file display_menu_base.h.

◆ on_before_hide()

virtual void esphome::display_menu_base::DisplayMenuComponent::on_before_hide ( )
inlineprotectedvirtual

Reimplemented in esphome::graphical_display_menu::GraphicalDisplayMenu.

Definition at line 65 of file display_menu_base.h.

◆ on_before_show()

virtual void esphome::display_menu_base::DisplayMenuComponent::on_before_show ( )
inlineprotectedvirtual

Reimplemented in esphome::graphical_display_menu::GraphicalDisplayMenu.

Definition at line 63 of file display_menu_base.h.

◆ process_initial_()

void esphome::display_menu_base::DisplayMenuComponent::process_initial_ ( )
protected

Definition at line 234 of file display_menu_base.cpp.

◆ reset_()

void esphome::display_menu_base::DisplayMenuComponent::reset_ ( )
protected

Definition at line 228 of file display_menu_base.cpp.

◆ right()

void esphome::display_menu_base::DisplayMenuComponent::right ( )

Definition at line 87 of file display_menu_base.cpp.

◆ set_active()

void esphome::display_menu_base::DisplayMenuComponent::set_active ( bool  active)
inline

Definition at line 25 of file display_menu_base.h.

◆ set_mode()

void esphome::display_menu_base::DisplayMenuComponent::set_mode ( MenuMode  mode)
inline

Definition at line 26 of file display_menu_base.h.

◆ set_root_item()

void esphome::display_menu_base::DisplayMenuComponent::set_root_item ( MenuItemMenu item)
inline

Definition at line 24 of file display_menu_base.h.

◆ set_rows()

void esphome::display_menu_base::DisplayMenuComponent::set_rows ( uint8_t  rows)
inline

Definition at line 27 of file display_menu_base.h.

◆ show()

void esphome::display_menu_base::DisplayMenuComponent::show ( )

Definition at line 199 of file display_menu_base.cpp.

◆ show_main()

void esphome::display_menu_base::DisplayMenuComponent::show_main ( )

Definition at line 169 of file display_menu_base.cpp.

◆ up()

void esphome::display_menu_base::DisplayMenuComponent::up ( )

Definition at line 7 of file display_menu_base.cpp.

◆ update()

virtual void esphome::display_menu_base::DisplayMenuComponent::update ( )
inlineprotectedvirtual

Field Documentation

◆ active_

bool esphome::display_menu_base::DisplayMenuComponent::active_
protected

Definition at line 69 of file display_menu_base.h.

◆ cursor_index_

uint8_t esphome::display_menu_base::DisplayMenuComponent::cursor_index_ {0}
protected

Definition at line 75 of file display_menu_base.h.

◆ displayed_item_

MenuItemMenu* esphome::display_menu_base::DisplayMenuComponent::displayed_item_ {nullptr}
protected

Definition at line 73 of file display_menu_base.h.

◆ editing_

bool esphome::display_menu_base::DisplayMenuComponent::editing_ {false}
protected

Definition at line 77 of file display_menu_base.h.

◆ mode_

MenuMode esphome::display_menu_base::DisplayMenuComponent::mode_
protected

Definition at line 70 of file display_menu_base.h.

◆ root_item_

MenuItemMenu* esphome::display_menu_base::DisplayMenuComponent::root_item_ {nullptr}
protected

Definition at line 71 of file display_menu_base.h.

◆ root_on_enter_called_

bool esphome::display_menu_base::DisplayMenuComponent::root_on_enter_called_ {false}
protected

Definition at line 78 of file display_menu_base.h.

◆ rows_

uint8_t esphome::display_menu_base::DisplayMenuComponent::rows_
protected

Definition at line 66 of file display_menu_base.h.

◆ selection_stack_

std::forward_list<std::pair<uint8_t, uint8_t> > esphome::display_menu_base::DisplayMenuComponent::selection_stack_ {}
protected

Definition at line 76 of file display_menu_base.h.

◆ top_index_

uint8_t esphome::display_menu_base::DisplayMenuComponent::top_index_ {0}
protected

Definition at line 74 of file display_menu_base.h.


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