+ inline bool isProcessing() const { return _processing; }
+ inline Mode processMode() const { return _processMode; }
+
+ void reset();
+
+public slots:
+ void process(Message &msg);
+ void process(QList<Message> &msgs);
+
+ /**
+ * Network removed from system
+ *
+ * Handles cleaning up cache from stale networks.
+ *
+ * @param id Network ID of removed network
+ */
+ inline void networkRemoved(NetworkId id) {
+ // Clean up nickname matching cache
+ _nickMatcher.removeNetwork(id);
+ }
+
+private slots:
+ void processNextMessage();
+ void nicksCaseSensitiveChanged(const QVariant &variant);
+ void highlightListChanged(const QVariant &variant);
+ void highlightNickChanged(const QVariant &variant);
+
+private:
+ /**
+ * Individual highlight rule (legacy client-side version)
+ */
+ class LegacyHighlightRule
+ {
+ public:
+ /**
+ * Construct an empty highlight rule
+ */
+ LegacyHighlightRule() {}
+
+ /**
+ * Construct a highlight rule with the given parameters
+ *
+ * @param contents String representing a message contents expression to match
+ * @param isRegEx True if regular expression, otherwise false
+ * @param isCaseSensitive True if case sensitive, otherwise false
+ * @param isEnabled True if enabled, otherwise false
+ * @param chanName String representing a channel name expression to match
+ */
+ LegacyHighlightRule(QString contents, bool isRegEx, bool isCaseSensitive, bool isEnabled,
+ QString chanName)
+ : _contents(contents), _isRegEx(isRegEx), _isCaseSensitive(isCaseSensitive),
+ _isEnabled(isEnabled), _chanName(chanName)
+ {
+ _cacheInvalid = true;
+ // Cache expression matches on construction
+ //
+ // This provides immediate feedback on errors when loading the rule. If profiling shows
+ // this as a performance bottleneck, this can be removed in deference to caching on
+ // first use.
+ //
+ // Inversely, if needed for validity checks, caching can be done on every update below
+ // instead of on first use.
+ determineExpressions();
+ }
+
+ /**
+ * Gets the message contents this rule matches
+ *
+ * NOTE: Use HighlightRule::contentsMatcher() for performing matches
+ *
+ * CAUTION: For legacy reasons, "contents" doubles as the identifier for the ignore rule.
+ * Duplicate entries are not allowed.
+ *
+ * @return String representing a phrase or expression to match
+ */
+ inline QString contents() const {
+ return _contents;
+ }
+ /**
+ * Sets the message contents this rule matches
+ *
+ * @param contents String representing a phrase or expression to match
+ */
+ inline void setContents(const QString &contents) {
+ _contents = contents;
+ _cacheInvalid = true;
+ }
+
+ /**
+ * Gets if this is a regular expression rule
+ *
+ * @return True if regular expression, otherwise false
+ */
+ inline bool isRegEx() const {
+ return _isRegEx;
+ }
+ /**
+ * Sets if this rule is a regular expression rule
+ *
+ * @param isRegEx True if regular expression, otherwise false
+ */
+ inline void setIsRegEx(bool isRegEx) {
+ _isRegEx = isRegEx;
+ _cacheInvalid = true;
+ }
+
+ /**
+ * Gets if this rule is case sensitive
+ *
+ * @return True if case sensitive, otherwise false
+ */
+ inline bool isCaseSensitive() const {
+ return _isCaseSensitive;
+ }
+ /**
+ * Sets if this rule is case sensitive
+ *
+ * @param isCaseSensitive True if case sensitive, otherwise false
+ */
+ inline void setIsCaseSensitive(bool isCaseSensitive) {
+ _isCaseSensitive = isCaseSensitive;
+ _cacheInvalid = true;
+ }
+
+ /**
+ * Gets if this rule is enabled and active
+ *
+ * @return True if enabled, otherwise false
+ */
+ inline bool isEnabled() const {
+ return _isEnabled;
+ }
+ /**
+ * Sets if this rule is enabled and active
+ *
+ * @param isEnabled True if enabled, otherwise false
+ */
+ inline void setIsEnabled(bool isEnabled) {
+ _isEnabled = isEnabled;
+ }