mirror-chatterino2/src/singletons/windowmanager.hpp

55 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
2017-01-15 16:38:30 +01:00
2017-11-12 17:21:50 +01:00
#include "widgets/window.hpp"
2017-01-15 16:38:30 +01:00
2017-01-18 21:30:23 +01:00
namespace chatterino {
2017-12-31 22:58:35 +01:00
namespace singletons {
2017-01-18 21:30:23 +01:00
2017-12-31 00:50:07 +01:00
class ThemeManager;
2017-04-12 17:46:44 +02:00
class WindowManager
2017-01-15 16:38:30 +01:00
{
2017-12-31 00:50:07 +01:00
explicit WindowManager(ThemeManager &_themeManager);
2017-11-12 17:21:50 +01:00
2017-12-31 00:50:07 +01:00
public:
static WindowManager &getInstance();
2017-01-15 16:38:30 +01:00
2018-01-24 15:08:22 +01:00
void showSettingsDialog();
void showAccountSelectPopup(QPoint point);
2017-04-13 19:25:33 +02:00
void layoutVisibleChatWidgets(Channel *channel = nullptr);
void repaintVisibleChatWidgets(Channel *channel = nullptr);
void repaintGifEmotes();
// void updateAll();
2017-04-13 19:25:33 +02:00
2017-11-12 17:21:50 +01:00
widgets::Window &getMainWindow();
2017-12-14 00:25:06 +01:00
widgets::Window &getSelectedWindow();
widgets::Window &createWindow(widgets::Window::WindowType type);
2017-04-13 19:25:33 +02:00
2017-12-14 00:25:06 +01:00
int windowCount();
widgets::Window *windowAt(int index);
2017-04-13 19:25:33 +02:00
void save();
void initialize();
void closeAll();
2017-01-26 21:04:01 +01:00
pajlada::Signals::NoArgSignal repaintGifs;
pajlada::Signals::Signal<Channel *> layout;
2017-09-17 02:13:57 +02:00
2017-01-15 16:38:30 +01:00
private:
2017-12-31 00:50:07 +01:00
ThemeManager &themeManager;
bool initialized = false;
2017-11-12 17:21:50 +01:00
std::vector<widgets::Window *> windows;
2017-01-15 16:38:30 +01:00
2017-11-12 17:21:50 +01:00
widgets::Window *mainWindow = nullptr;
2017-12-14 00:25:06 +01:00
widgets::Window *selectedWindow = nullptr;
void encodeChannel(IndirectChannel channel, QJsonObject &obj);
IndirectChannel decodeChannel(const QJsonObject &obj);
2017-01-15 16:38:30 +01:00
};
} // namespace singletons
2017-04-14 17:52:22 +02:00
} // namespace chatterino