2018-05-06 00:32:45 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "controllers/highlights/HighlightPhrase.hpp"
|
|
|
|
#include "util/SignalVectorModel.hpp"
|
2018-05-06 00:32:45 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace controllers {
|
|
|
|
namespace highlights {
|
|
|
|
|
|
|
|
class HighlightController;
|
|
|
|
|
|
|
|
class HighlightModel : public util::SignalVectorModel<HighlightPhrase>
|
|
|
|
{
|
|
|
|
explicit HighlightModel(QObject *parent);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// turn a vector item into a model row
|
2018-05-26 20:25:00 +02:00
|
|
|
virtual HighlightPhrase getItemFromRow(std::vector<QStandardItem *> &row,
|
|
|
|
const HighlightPhrase &original) override;
|
2018-05-06 00:32:45 +02:00
|
|
|
|
|
|
|
// turns a row in the model into a vector item
|
|
|
|
virtual void getRowFromItem(const HighlightPhrase &item,
|
|
|
|
std::vector<QStandardItem *> &row) override;
|
|
|
|
|
|
|
|
virtual void afterInit() override;
|
|
|
|
|
|
|
|
virtual void customRowSetData(const std::vector<QStandardItem *> &row, int column,
|
|
|
|
const QVariant &value, int role) override;
|
|
|
|
|
|
|
|
friend class HighlightController;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace highlights
|
|
|
|
} // namespace controllers
|
|
|
|
} // namespace chatterino
|