#ifndef CHATDATASTORE_H #define CHATDATASTORE_H #include "../chatmodel.h" using json = nlohmann::json; class ChatDataStore { private: static bool instanced; static ChatDataStore* instance; Ui::MainWindow* ui; MainWindow* main; std::map data; ChatDataStore() { } public: static ChatDataStore* getInstance(); void clear(); void setData(QString key, ChatItem value); ChatItem getData(QString key); std::map getAllRawChatItems(); std::map getAllContactRequests(); std::map getAllMemos(); QString dump(); ~ChatDataStore() { ChatDataStore::instanced = false; ChatDataStore::instance = nullptr; } }; #endif