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#include "mailcommon_private_export.h"
9#include "searchpattern.h"
10#include <Akonadi/Item>
11namespace MailCommon
12{
13class MAILCOMMON_TESTS_EXPORT 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
41 using SearchRule::matches;
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}
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.