/usr/include/KF5/mailcommon/searchrulestatus.h is in libkf5mailcommon-dev 4:17.12.3-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | /*
Copyright (c) 2015-2017 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SEARCHRULESTATUS_H
#define SEARCHRULESTATUS_H
#include <AkonadiCore/Item>
#include "mailcommon/searchpattern.h"
#include <Akonadi/KMime/MessageStatus>
namespace MailCommon {
//TODO: Check if the below one is needed or not!
// The below are used in several places and here so they are accessible.
struct MessageStatusInfo {
const char *text;
const char *icon;
};
// If you change the ordering here; also do it in the enum below
static const MessageStatusInfo StatusValues[] = {
{ I18N_NOOP2("message status", "Important"), "emblem-important" },
{ I18N_NOOP2("message status", "Action Item"), "mail-task" },
{ I18N_NOOP2("message status", "Unread"), "mail-unread" },
{ I18N_NOOP2("message status", "Read"), "mail-read" },
{ I18N_NOOP2("message status", "Deleted"), "mail-deleted" },
{ I18N_NOOP2("message status", "Replied"), "mail-replied" },
{ I18N_NOOP2("message status", "Forwarded"), "mail-forwarded" },
{ I18N_NOOP2("message status", "Queued"), "mail-queued" },
{ I18N_NOOP2("message status", "Sent"), "mail-sent" },
{ I18N_NOOP2("message status", "Watched"), "mail-thread-watch" },
{ I18N_NOOP2("message status", "Ignored"), "mail-thread-ignored" },
{ I18N_NOOP2("message status", "Spam"), "mail-mark-junk" },
{ I18N_NOOP2("message status", "Ham"), "mail-mark-notjunk" },
{ I18N_NOOP2("message status", "Has Attachment"), "mail-attachment" } //must be last
};
static const int StatusValueCount
= sizeof(StatusValues) / sizeof(MessageStatusInfo);
// we want to show all status entries in the quick search bar, but only the
// ones up to attachment in the search/filter dialog, because there the
// attachment case is handled separately.
static const int StatusValueCountWithoutHidden = StatusValueCount - 1;
/**
* This class represents a search to be performed against the status of a
* messsage. The status is represented by a bitfield.
*
* @short This class represents a search pattern rule operating on message
* status.
*/
class MAILCOMMON_EXPORT SearchRuleStatus : public SearchRule
{
public:
explicit SearchRuleStatus(const QByteArray &field = QByteArray(), Function function = FuncContains, const QString &contents = QString());
explicit SearchRuleStatus(Akonadi::MessageStatus status, Function function = FuncContains);
bool isEmpty() const override;
bool matches(const Akonadi::Item &item) const override;
/**
* @copydoc SearchRule::requiredPart()
*/
RequiredPart requiredPart() const override;
void addQueryTerms(Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const override;
//Not possible to implement optimized form for status searching
using SearchRule::matches;
static Akonadi::MessageStatus statusFromEnglishName(const QString &);
QString informationAboutNotValidRules() const override;
private:
Akonadi::MessageStatus mStatus;
};
}
#endif // SEARCHRULESTATUS_H
|