Mailcommon

searchrulestatus.h
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "mailcommon/searchpattern.h"
10#include "mailcommon_export.h"
11#include <Akonadi/Item>
12#include <Akonadi/MessageStatus>
13
14namespace MailCommon
15{
16/**
17 * This class represents a search to be performed against the status of a
18 * message. The status is represented by a bitfield.
19 *
20 * @short This class represents a search pattern rule operating on message
21 * status.
22 */
23class MAILCOMMON_EXPORT SearchRuleStatus : public SearchRule
24{
25public:
26 explicit SearchRuleStatus(const QByteArray &field = QByteArray(), Function function = FuncContains, const QString &contents = QString());
27
28 explicit SearchRuleStatus(Akonadi::MessageStatus status, Function function = FuncContains);
29
30 [[nodiscard]] bool isEmpty() const override;
31 [[nodiscard]] bool matches(const Akonadi::Item &item) const override;
32
33 /**
34 * @copydoc SearchRule::requiredPart()
35 */
36 [[nodiscard]] RequiredPart requiredPart() const override;
37
38 void addQueryTerms(Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const override;
39
40 // Not possible to implement optimized form for status searching
41 using SearchRule::matches;
42
43 static Akonadi::MessageStatus statusFromEnglishName(const QString &);
44
45 [[nodiscard]] QString informationAboutNotValidRules() const override;
46
47private:
49};
50}
This class represents a search to be performed against the status of a message.
This class represents one search pattern rule.
Definition searchrule.h:24
Function
Describes operators for comparison of field and contents.
Definition searchrule.h:40
RequiredPart
Possible required parts.
Definition searchrule.h:68
Q_SCRIPTABLE CaptureState status()
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.