X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtuimessageprocessor.h;h=57ed9bcc5ea1b1537ebaaf8ae50b5ee8a1aa5c58;hp=cfbc13944c3af12e811b190eb3332b56b31eabf3;hb=17b8c981d7c47800392b7fd1c043c5ac1bcb19ef;hpb=5159e200a1c4c0998f302ae7c57325ed322c1e85 diff --git a/src/qtui/qtuimessageprocessor.h b/src/qtui/qtuimessageprocessor.h index cfbc1394..57ed9bcc 100644 --- a/src/qtui/qtuimessageprocessor.h +++ b/src/qtui/qtuimessageprocessor.h @@ -21,6 +21,7 @@ #ifndef QTUIMESSAGEPROCESSOR_H_ #define QTUIMESSAGEPROCESSOR_H_ +#include #include #include "abstractmessageprocessor.h" @@ -28,32 +29,51 @@ class QtUiMessageProcessor : public AbstractMessageProcessor { Q_OBJECT - public: - enum Mode { - TimerBased, - Concurrent - }; +public: + enum Mode { + TimerBased, + Concurrent + }; - QtUiMessageProcessor(QObject *parent); - inline bool isProcessing() const { return _processing; } - inline Mode processMode() const { return _processMode; } + QtUiMessageProcessor(QObject *parent); - public slots: - void process(Message &msg); - void process(QList &msgs); + inline bool isProcessing() const { return _processing; } + inline Mode processMode() const { return _processMode; } - private slots: - void processNextMessage(); + void reset(); - private: - void checkForHighlight(Message &msg); - void startProcessing(); +public slots: + void process(Message &msg); + void process(QList &msgs); - QList > _processQueue; - QList _currentBatch; - QTimer _processTimer; - bool _processing; - Mode _processMode; +private slots: + void processNextMessage(); + void highlightListChanged(const QVariant &variant); + void highlightNickChanged(const QVariant &variant); + +private: + void checkForHighlight(Message &msg); + void startProcessing(); + void updateProgress(bool start = false); + + QList > _processQueue; + QList _currentBatch; + QTimer _processTimer; + bool _processing; + Mode _processMode; + int _msgsProcessed, _msgCount; + QTime _progressTimer; + + struct HighlightRule { + QString name; + bool isEnabled; + Qt::CaseSensitivity caseSensitive; + bool isRegExp; + inline HighlightRule(const QString &name, bool enabled, Qt::CaseSensitivity cs, bool regExp) : name(name), isEnabled(enabled), caseSensitive(cs), isRegExp(regExp) {} + }; + + QList _highlightRules; + NotificationSettings::HighlightNickType _highlightNick; }; #endif