mirror-chatterino2/src/Application.hpp

92 lines
1.9 KiB
C++
Raw Normal View History

#pragma once
2018-06-28 19:46:45 +02:00
#include "singletons/Resources.hpp"
#include <QApplication>
namespace chatterino {
2018-07-07 11:41:01 +02:00
class Singleton;
class TwitchServer;
class PubSub;
class CommandController;
class HighlightController;
2018-05-13 19:24:32 +02:00
class IgnoreController;
class TaggedUsersController;
class AccountController;
class ModerationActions;
2018-06-28 20:03:04 +02:00
class Theme;
class WindowManager;
2018-06-28 19:51:07 +02:00
class Logging;
class Paths;
class AccountManager;
2018-06-28 19:51:07 +02:00
class Emotes;
class NativeMessaging;
class Settings;
class Fonts;
class Resources;
class Application
{
Application(int _argc, char **_argv);
public:
2018-07-06 19:23:47 +02:00
static void instantiate(int argc_, char **argv_);
~Application() = delete;
void construct();
void initialize();
void load();
int run(QApplication &qtApp);
friend void test();
Settings *settings = nullptr;
Paths *paths = nullptr;
2018-07-07 11:41:01 +02:00
2018-06-28 20:03:04 +02:00
Theme *themes = nullptr;
WindowManager *windows = nullptr;
2018-06-28 19:51:07 +02:00
Logging *logging = nullptr;
2018-06-26 17:06:17 +02:00
CommandController *commands = nullptr;
HighlightController *highlights = nullptr;
IgnoreController *ignores = nullptr;
TaggedUsersController *taggedUsers = nullptr;
AccountController *accounts = nullptr;
2018-06-28 19:51:07 +02:00
Emotes *emotes = nullptr;
NativeMessaging *nativeMessaging = nullptr;
Fonts *fonts = nullptr;
Resources *resources = nullptr;
ModerationActions *moderationActions = nullptr;
2018-07-07 11:41:01 +02:00
TwitchServer *twitch2 = nullptr;
/// Provider-specific
struct {
2018-07-07 11:41:01 +02:00
[[deprecated("use twitch2 instead")]] TwitchServer *server = nullptr;
[[deprecated("use twitch2->pubsub instead")]] PubSub *pubsub = nullptr;
} twitch;
void save();
// Special application mode that only initializes the native messaging host
static void runNativeMessagingHost();
private:
2018-07-07 11:41:01 +02:00
void addSingleton(Singleton *singleton);
2018-07-06 19:23:47 +02:00
int argc_;
char **argv_;
2018-07-07 11:41:01 +02:00
std::vector<Singleton *> singletons_;
};
Application *getApp();
bool appInitialized();
} // namespace chatterino