Messagelib

searchlinecommand.h
1/*
2 SPDX-FileCopyrightText: 2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8#include "messagelist_private_export.h"
9#include <QDebug>
10#include <QMap>
11#include <QObject>
12#include <QStringList>
13namespace MessageList
14{
15namespace Core
16{
17class MESSAGELIST_TESTS_EXPORT SearchLineCommand
18{
19 Q_GADGET
20public:
21 enum SearchLineType {
22 Unknown = 0,
23 HasStateOrAttachment,
24 Literal,
25 To,
26 Bcc,
27 Cc,
28 From,
29 Subject,
30 Date,
31 Size,
34 IsImportant,
35 IsRead,
36 IsUnRead,
37 IsIgnored,
38 IsHam,
39 IsSpam,
40 IsWatched,
41 IsReplied,
42 IsForwarded,
43 };
44 Q_ENUM(SearchLineType)
45 struct SearchLineInfo {
46 SearchLineType type = SearchLineType::Unknown;
47 QString argument;
48 void clear();
49 [[nodiscard]] bool isValid() const;
50 [[nodiscard]] bool operator==(const SearchLineInfo &other) const;
51 };
52 SearchLineCommand();
53 ~SearchLineCommand();
54
55 void parseSearchLineCommand(const QString &str);
56
57 [[nodiscard]] QString generateCommadLineStr() const;
58
59 [[nodiscard]] QList<SearchLineInfo> searchLineInfo() const;
60 void setSearchLineInfo(const QList<SearchLineInfo> &newSearchLineInfo);
61
62 [[nodiscard]] static bool hasSubType(const QString &v);
63
64private:
65 [[nodiscard]] QString convertSearchLinetypeToTranslatedString(SearchLineCommand::SearchLineType type) const;
67 QList<SearchLineInfo> mSearchLineInfo;
68};
69}
70}
71Q_DECLARE_TYPEINFO(MessageList::Core::SearchLineCommand::SearchLineInfo, Q_RELOCATABLE_TYPE);
72MESSAGELIST_TESTS_EXPORT QDebug operator<<(QDebug debug, const MessageList::Core::SearchLineCommand::SearchLineInfo &info);
AKONADI_MIME_EXPORT const char HasInvitation[]
AKONADI_MIME_EXPORT const char HasAttachment[]
bool isValid(QStringView ifopt)
KGuiItem clear()
KTEXTEDITOR_EXPORT QDebug operator<<(QDebug s, const MovingCursor &cursor)
bool operator==(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.