FMI Ticket System
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |
src
Generic
ConsoleInterface
Menu.h
Go to the documentation of this file.
1
#ifndef HEADER_CONSOLEINTERFACE_MENU
2
#define HEADER_CONSOLEINTERFACE_MENU
3
8
#include "
Command.h
"
9
#include "../List/List.hpp"
10
17
class
Menu
{
18
char
title[256];
19
List<Command>
menuOptions;
20
21
bool
backExistsApp;
22
bool
isSubMenu;
23
24
public
:
26
Menu
();
28
Menu
(
const
char
* title,
bool
backExistsApp,
bool
isSubMenu);
30
Menu
(
const
char
* title,
bool
backExistsApp,
bool
isSubMenu,
const
Command
* commands,
unsigned
commandCount);
31
33
void
addCommand
(
const
Command
& command);
34
36
void
registerError
(
const
char
* message)
const
;
38
void
registerWarning
(
const
char
* message)
const
;
40
void
registerSuccess
(
const
char
* message)
const
;
41
43
void
navigate
()
const
;
44
};
45
46
#endif
Command.h
Stores the declaration of class Command.
Command
Stores a 256 character name and a function pointer to be executed when calling run()
Definition:
Command.h:12
List< Command >
Menu
Handles navigation between multiple commands.
Definition:
Menu.h:17
Menu::navigate
void navigate() const
Lists commands and after user input executes an appropriate command run() function.
Definition:
Menu.cpp:93
Menu::addCommand
void addCommand(const Command &command)
Adds a command to the internal Command list.
Definition:
Menu.cpp:32
Menu::registerSuccess
void registerSuccess(const char *message) const
Tell Menu to show a success message next time it prints.
Definition:
Menu.cpp:76
Menu::registerWarning
void registerWarning(const char *message) const
Tell Menu to show a warning message next time it prints.
Definition:
Menu.cpp:64
Menu::registerError
void registerError(const char *message) const
Tell Menu to show an error message next time it prints.
Definition:
Menu.cpp:52
Menu::Menu
Menu()
Sets name as "Menu", leaves all flags to false and creates an empty Command list.
Definition:
Menu.cpp:5
Generated by
1.9.3