2018-04-30 23:30:05 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "controllers/commands/Command.hpp"
|
|
|
|
#include "util/SignalVectorModel.hpp"
|
2018-04-30 23:30:05 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace controllers {
|
|
|
|
namespace commands {
|
|
|
|
|
|
|
|
class CommandController;
|
|
|
|
|
|
|
|
class CommandModel : public util::SignalVectorModel<Command>
|
|
|
|
{
|
|
|
|
explicit CommandModel(QObject *parent);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// turn a vector item into a model row
|
2018-05-26 20:25:00 +02:00
|
|
|
virtual Command getItemFromRow(std::vector<QStandardItem *> &row,
|
|
|
|
const Command &command) override;
|
2018-04-30 23:30:05 +02:00
|
|
|
|
|
|
|
// turns a row in the model into a vector item
|
|
|
|
virtual void getRowFromItem(const Command &item, std::vector<QStandardItem *> &row) override;
|
|
|
|
|
|
|
|
friend class CommandController;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace commands
|
|
|
|
} // namespace controllers
|
|
|
|
} // namespace chatterino
|