X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtuimessageprocessor.h;h=3073c7bfbb325ab285e25d04ea251afad52086a1;hp=91cc5770abdf1b721b1ae05b15235c9d0d5aa49c;hb=7a413a4808e9357e7d2c69840efe913b4c4ab0a3;hpb=efa00e5a912c34c37bcc6dad7b8bc6e3a6f3e4fb diff --git a/src/qtui/qtuimessageprocessor.h b/src/qtui/qtuimessageprocessor.h index 91cc5770..3073c7bf 100644 --- a/src/qtui/qtuimessageprocessor.h +++ b/src/qtui/qtuimessageprocessor.h @@ -1,5 +1,5 @@ /*************************************************************************** -* Copyright (C) 2005-08 by the Quassel Project * +* Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,19 +21,60 @@ #ifndef QTUIMESSAGEPROCESSOR_H_ #define QTUIMESSAGEPROCESSOR_H_ +#include +#include + #include "abstractmessageprocessor.h" class QtUiMessageProcessor : public AbstractMessageProcessor { Q_OBJECT - public: - QtUiMessageProcessor(QObject *parent); +public: + enum Mode { + TimerBased, + Concurrent + }; + + QtUiMessageProcessor(QObject *parent); + + inline bool isProcessing() const { return _processing; } + inline Mode processMode() const { return _processMode; } + + void reset(); + +public slots: + void process(Message &msg); + void process(QList &msgs); + +private slots: + void processNextMessage(); + void nicksCaseSensitiveChanged(const QVariant &variant); + void highlightListChanged(const QVariant &variant); + void highlightNickChanged(const QVariant &variant); + +private: + void checkForHighlight(Message &msg); + void startProcessing(); + QList > _processQueue; + QList _currentBatch; + QTimer _processTimer; + bool _processing; + Mode _processMode; - protected: - void processMessage(Message &msg); - void processMessages(QList &msgs); + struct HighlightRule { + QString name; + bool isEnabled; + Qt::CaseSensitivity caseSensitive; + bool isRegExp; + QString chanName; + inline HighlightRule(const QString &name, bool enabled, Qt::CaseSensitivity cs, bool regExp, const QString &chanName) + : name(name), isEnabled(enabled), caseSensitive(cs), isRegExp(regExp), chanName(chanName) {} + }; + QList _highlightRules; + NotificationSettings::HighlightNickType _highlightNick; + bool _nicksCaseSensitive; }; #endif