/** * @file tui.h * @brief display user interface * @author hendrik schutter * @date 03.08.2020 */ #ifndef TUI_H_ #define TUI_H_ #include "reHDD.h" #define COLOR_AREA_STDSCR 1 #define COLOR_AREA_OVERVIEW 2 #define COLOR_AREA_ENTRY 3 #define COLOR_AREA_ENTRY_SELECTED 4 #define COLOR_AREA_DETAIL 5 class TUI { protected: public: enum UserInput { UpKey, DownKey, Abort, Shred, Delete, Enter, ESC, Undefined}; struct MenuState { bool bAbort; bool bShred; bool bDelete; bool bConfirmShred; bool bConfirmDelete; }; TUI(void); static void initTUI(); void updateTUI(vector * pvecDrives, uint8_t u8SelectedEntry); static enum UserInput readUserInput(); private: static string sCpuUsage; static string sRamUsage; static string sLocalTime; WINDOW* overview; WINDOW* systemview; WINDOW* detailview; WINDOW* menuview; WINDOW* dialog; static void centerTitle(WINDOW *pwin, const char * title); static WINDOW *createOverViewWindow( int iXSize, int iYSize); static WINDOW *createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive drive); static WINDOW *overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart); static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart,string sModelFamily, string sModelName, string sCapacity, string sState, bool bSelected); static WINDOW *createSystemStats(int iXSize, int iYSize, int iYStart); static WINDOW *createMenuView(int iXSize, int iYSize, int iXStart, int iYStart, struct MenuState menustate); static WINDOW *createDialog(int iXSize, int iYSize, int iXStart, int iYStart, string selectedTask, string optionA, string optionB); void displaySelectedDrive(Drive drive, int stdscrX, int stdscrY); }; #endif // TUI_H_