mirror-chatterino2/src/controllers/commands/CommandController.hpp

41 lines
788 B
C++
Raw Normal View History

#pragma once
#include <QMap>
#include <memory>
2018-06-05 18:51:14 +02:00
#include <mutex>
2018-06-26 14:09:39 +02:00
#include "controllers/commands/Command.hpp"
2018-06-26 15:33:51 +02:00
#include "common/SignalVector2.hpp"
namespace chatterino {
class Channel;
class CommandModel;
class CommandController
{
public:
CommandController();
QString execCommand(const QString &text, std::shared_ptr<Channel> channel, bool dryRun);
QStringList getDefaultTwitchCommandList();
void load();
void save();
CommandModel *createModel(QObject *parent);
util::UnsortedSignalVector<Command> items;
private:
QMap<QString, Command> commandsMap;
std::mutex mutex;
QString filePath;
QString execCustomCommand(const QStringList &words, const Command &command);
};
} // namespace chatterino