53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
/**
|
|
* @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};
|
|
|
|
TUI(void);
|
|
|
|
static void initTUI();
|
|
|
|
void updateTUI(vector <Drive>* pvecDrives, int32_t i32SelectedEntry);
|
|
|
|
static enum UserInput readUserInput();
|
|
|
|
private:
|
|
static string sCpuUsage;
|
|
static string sRamUsage;
|
|
static string sLocalTime;
|
|
|
|
WINDOW *detailview;
|
|
WINDOW *overview;
|
|
WINDOW *systemview;
|
|
|
|
|
|
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 *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart,string sModelFamily, string sModelName, string sCapacity, bool bSelected);
|
|
static WINDOW *createSystemStats(int iXSize, int iYSize, int iYStart);
|
|
|
|
};
|
|
|
|
#endif // TUI_H_
|