1 #pragma once 2 3 #include <QObject> 4 5 #include "common/SignalVectorModel.hpp" 6 #include "controllers/highlights/HighlightPhrase.hpp" 7 8 namespace chatterino { 9 10 class HighlightModel : public SignalVectorModel<HighlightPhrase> 11 { 12 public: 13 explicit HighlightModel(QObject *parent); 14 15 // Used here, in HighlightingPage and in UserHighlightModel 16 enum Column { 17 Pattern = 0, 18 ShowInMentions = 1, 19 FlashTaskbar = 2, 20 PlaySound = 3, 21 UseRegex = 4, 22 CaseSensitive = 5, 23 SoundPath = 6, 24 Color = 7, 25 COUNT // keep this as last member of enum 26 }; 27 28 constexpr static int WHISPER_ROW = 1; 29 30 protected: 31 // turn a vector item into a model row 32 virtual HighlightPhrase getItemFromRow( 33 std::vector<QStandardItem *> &row, 34 const HighlightPhrase &original) override; 35 36 // turns a row in the model into a vector item 37 virtual void getRowFromItem(const HighlightPhrase &item, 38 std::vector<QStandardItem *> &row) override; 39 40 virtual void afterInit() override; 41 42 virtual void customRowSetData(const std::vector<QStandardItem *> &row, 43 int column, const QVariant &value, int role, 44 int rowIndex) override; 45 }; 46 47 } // namespace chatterino 48