89 lines
1.9 KiB
C++
89 lines
1.9 KiB
C++
/**
|
|
* @file menuInformationSites.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief Contains a class to print informations over more pages
|
|
* @version 0.1
|
|
* @date 2022-12-27
|
|
*
|
|
* @copyright Copyright (c) 2022
|
|
*
|
|
*/
|
|
#ifndef MENU_INFORMATION_SITES_H
|
|
#define MENU_INFORMATION_SITES_H
|
|
|
|
#include "menuControl.h"
|
|
|
|
class MenuInformationSites : public MenuControl {
|
|
public:
|
|
/**
|
|
* @brief Construct a new Menu Information Sites object
|
|
*
|
|
* @param amount of pages
|
|
*/
|
|
MenuInformationSites(uint8_t pages = 1);
|
|
|
|
/**
|
|
* @brief Next page
|
|
*/
|
|
void down() override;
|
|
|
|
/**
|
|
* @brief Previous page
|
|
*/
|
|
void up() override;
|
|
|
|
/**
|
|
* @brief Update information
|
|
*/
|
|
void right() override;
|
|
|
|
/**
|
|
* @brief Go to the parent menu
|
|
*/
|
|
void left() override;
|
|
|
|
/**
|
|
* @brief Go to the parent menu
|
|
*/
|
|
void no() override;
|
|
|
|
/**
|
|
* @brief Update information
|
|
*/
|
|
void yes() override;
|
|
|
|
/**
|
|
* @brief Prints the Information to display and console
|
|
*
|
|
* Prints the selected page.
|
|
* The informations are only printed to the display if it
|
|
* set.
|
|
*/
|
|
void printMenu() override;
|
|
|
|
protected:
|
|
bool setCountPages(uint8_t pages);
|
|
uint8_t getCountPages() const;
|
|
uint8_t getCurrentPage() const;
|
|
|
|
virtual void printPage() const = 0;
|
|
virtual void runCommandNo() const {}
|
|
virtual void runCommand() const {}
|
|
virtual void init() {}
|
|
|
|
void printDefault() const;
|
|
|
|
uint8_t lastPageNumber = 0;
|
|
bool leaved = true;
|
|
|
|
private:
|
|
uint8_t countPages;
|
|
uint8_t currentPage;
|
|
|
|
|
|
const uint16_t delay = 5000;
|
|
uint32_t lastMillis = 0;
|
|
};
|
|
|
|
#endif // MENU_INFORMATION_SITES_H
|