TelegramTUI/inc/view.h

29 lines
413 B
C
Raw Normal View History

2023-11-20 19:57:37 +01:00
#pragma once
2023-11-21 19:46:57 +01:00
#include <string>
2023-11-20 19:57:37 +01:00
class TgTUI;
class View {
public:
2023-11-21 19:46:57 +01:00
static std::string FormatTime(time_t t);
2023-11-20 19:57:37 +01:00
View(TgTUI& tgtui);
virtual ~View();
virtual void open();
virtual void close();
virtual void paint() = 0;
2023-11-20 21:24:51 +01:00
// return -2 -> exit
// return -1 -> keep current ViewMode
// return 0 <= -> switch to other ViewMode
virtual int keyIn(int key);
2023-11-20 19:57:37 +01:00
protected:
TgTUI& tgtui;
2023-11-20 21:24:51 +01:00
int maxRows, maxCols;
2023-11-20 19:57:37 +01:00
};