TelegramTUI/inc/tgtui.h

37 lines
468 B
C++

#pragma once
#include <thread>
#include "slimchat.h"
#include "tgclient.h"
class View;
class TgTUI {
public:
TgTUI();
~TgTUI();
void run();
void stop();
const std::vector<SlimChat>& getChats();
private:
void initDoneCB();
void threadLoop();
void handleNewChat(objptr<td_api::chat> chat);
TGClient tgclient;
View* currentView = nullptr;
std::vector<View*> views;
std::vector<SlimChat> chats;
bool shouldRun = false;
std::thread tuiThread;
};