Mailcommon

searchruledate.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 "searchpattern.h"
10#include <Akonadi/Item>
11namespace MailCommon
12{
13class SearchRuleDate : public SearchRule
14{
15public:
16 /**
17 * Creates new date search rule.
18 *
19 * @param field The field to search in.
20 * @param function The function to use for searching.
21 * @param contents The contents to search for.
22 */
23 explicit SearchRuleDate(const QByteArray &field = QByteArray(), Function function = FuncContains, const QString &contents = QString());
24 /**
25 * @copydoc SearchRule::isEmpty()
26 */
27 [[nodiscard]] bool isEmpty() const override;
28
29 /**
30 * @copydoc SearchRule::matches()
31 */
32 bool matches(const Akonadi::Item &item) const override;
33
34 /**
35 * @copydoc SearchRule::requiredPart()
36 */
37 [[nodiscard]] RequiredPart requiredPart() const override;
38
39 // Optimized matching not implemented, will use the unoptimized matching
40 // from SearchRule
42
43 /**
44 * A helper method for the main matches() method.
45 * Does the actual comparing.
46 */
47 [[nodiscard]] bool matchesInternal(QDate dateValue, QDate msgDate) const;
48
49 /**
50 * @copydoc SearchRule::addQueryTerms()
51 */
52 void addQueryTerms(Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const override;
53 [[nodiscard]] QString informationAboutNotValidRules() const override;
54};
55}
QByteArray field() const
Returns the message header field name (without the trailing ':').
Function function() const
Returns the filter function of the rule.
QString contents() const
Returns the contents of the rule.
RequiredPart
Possible required parts.
Definition searchrule.h:68
virtual bool matches(const Akonadi::Item &item) const =0
Tries to match the rule against the KMime::Message in the given item.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:01 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.