floatpump-firmware/Middlewares/floatpump/Inc/Menu_Entry.h

39 lines
720 B
C
Raw Normal View History

2023-01-04 12:22:45 +00:00
//
// Created by robtor on 04.01.23.
//
#ifndef FLOATPUMP_MENU_ENTRY_H
#define FLOATPUMP_MENU_ENTRY_H
#include <Menu_Entry_Type_Delegate.h>
2023-01-06 12:51:07 +00:00
namespace floatpump::menu {
2023-01-04 12:22:45 +00:00
2023-01-06 12:51:07 +00:00
class Menu_Entry {
public:
Menu_Entry(Menu_Entry_Type_Delegate *type, std::string name) : m_type(type), m_name(name) {};
2023-01-04 12:22:45 +00:00
2023-01-06 12:51:07 +00:00
//Retreive string for putting on display
std::string printLine();
2023-01-04 12:22:45 +00:00
2023-01-06 12:51:07 +00:00
void action_press();
2023-01-04 12:22:45 +00:00
2023-01-06 12:51:07 +00:00
void action_increase();
2023-01-04 12:22:45 +00:00
2023-01-06 12:51:07 +00:00
void action_decrease();
2023-01-04 13:54:51 +00:00
2023-01-06 12:51:07 +00:00
//Check if currently entered
bool isEntered();
2023-01-04 12:22:45 +00:00
2023-01-06 12:51:07 +00:00
private:
std::string m_name;
menu::Menu_Entry_Type_Delegate *m_type; //Saves type of this menu entry
};
}
2023-01-04 12:22:45 +00:00
#endif //FLOATPUMP_MENU_ENTRY_H