Finish documention until someone change something
This commit is contained in:
+53
-5
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuEntry.h
|
||||
* @file menuAction.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains the MenuAction class
|
||||
* @version 0.1
|
||||
* @date 2022-01-12
|
||||
*
|
||||
@@ -14,15 +14,63 @@
|
||||
#include "menu.h"
|
||||
|
||||
class MenuControl;
|
||||
|
||||
/**
|
||||
* @brief This class forms the transition between menus.
|
||||
*
|
||||
* In the Menu these are the entries.
|
||||
* This class can be call an submenu or a function.
|
||||
*/
|
||||
class MenuAction {
|
||||
public:
|
||||
MenuAction(const char* name, void (*function) (), void (*callback) ());
|
||||
MenuAction(const char* name, void (*function) ());
|
||||
|
||||
/**
|
||||
* @brief Construct a new Menu Action object
|
||||
*
|
||||
* @param name shown in the Menu
|
||||
* @param function to call when activate the entry
|
||||
* @param callback to call when leave the entry
|
||||
*/
|
||||
MenuAction(const char* name, void (*function) (), void (*callback) () = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Construct a new Menu Action object
|
||||
*
|
||||
* This constructer is used for submenus.
|
||||
*
|
||||
* @param name shown in the Menu
|
||||
* @param menu to call when activate the entry
|
||||
*/
|
||||
MenuAction(const char* name, MenuControl* menu);
|
||||
|
||||
/**
|
||||
* @brief activates the entry
|
||||
*/
|
||||
void runAction();
|
||||
|
||||
/**
|
||||
* @brief Get the Name string
|
||||
*
|
||||
* @return const char*
|
||||
*/
|
||||
const char* getName();
|
||||
|
||||
/**
|
||||
* @brief Get the Is Menu object
|
||||
*
|
||||
* @return true runAction calls a submenu
|
||||
* @return false runAction call a function
|
||||
*/
|
||||
bool getIsMenu();
|
||||
|
||||
/**
|
||||
* @brief Get the Menu object
|
||||
*
|
||||
* Before call this function it may be useful
|
||||
* to check if is it a submenu with getIsMenu.
|
||||
*
|
||||
* @return MenuControl*
|
||||
*/
|
||||
MenuControl* getMenu();
|
||||
|
||||
private:
|
||||
@@ -35,4 +83,4 @@ class MenuAction {
|
||||
MenuControl* menu;
|
||||
};
|
||||
|
||||
#endif // MENU_ENTRY_H
|
||||
#endif // MENU_ENTRY_H
|
||||
|
||||
Reference in New Issue
Block a user