Messagelib

searchlinestatus.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagelist_private_export.h"
10#include "quicksearchline.h"
11#include <Akonadi/MessageStatus>
12#include <QIcon>
13#include <QLineEdit>
15class QAction;
16namespace MessageList
17{
18namespace Core
19{
20class FilterSavedMenu;
21class Filter;
22class MESSAGELIST_TESTS_EXPORT SearchLineStatus : public QLineEdit
23{
24 Q_OBJECT
25public:
26 explicit SearchLineStatus(QWidget *parent = nullptr);
27 ~SearchLineStatus() override;
28
29 void setLocked(bool b);
30 [[nodiscard]] bool locked() const;
31
32 void setContainsOutboundMessages(bool containsOutboundMessages);
33 [[nodiscard]] bool containsOutboundMessages() const;
34 [[nodiscard]] QuickSearchLine::SearchOptions searchOptions() const;
35 void setSearchOptions(QuickSearchLine::SearchOptions opts);
36 void setFilterMessageStatus(const QList<Akonadi::MessageStatus> &newLstStatus);
37 void addCompletionItem(const QString &str);
38 void slotClearHistory();
39 void clearFilterButtonClicked();
40Q_SIGNALS:
41 void filterActionChanged(const QList<Akonadi::MessageStatus> &lst);
42 void searchOptionChanged();
43 void clearButtonClicked();
44 void forceLostFocus();
45 void saveFilter();
46 void activateFilter(MessageList::Core::Filter *f);
47
48protected:
49 void contextMenuEvent(QContextMenuEvent *e) override;
50 void keyPressEvent(QKeyEvent *e) override;
51
52private:
53 MESSAGELIST_NO_EXPORT void slotToggledLockAction();
54 MESSAGELIST_NO_EXPORT void showMenu();
55 MESSAGELIST_NO_EXPORT void slotFilterActionClicked(QAction *act);
56 MESSAGELIST_NO_EXPORT void clearFilterAction();
57 MESSAGELIST_NO_EXPORT void createFilterAction(const QIcon &icon, const QString &text, int value);
58 MESSAGELIST_NO_EXPORT void createMenuSearch();
59 MESSAGELIST_NO_EXPORT void updateLockAction();
60 MESSAGELIST_NO_EXPORT void initializeActions();
61 MESSAGELIST_NO_EXPORT void updateFilterActionIcon();
62 MESSAGELIST_NO_EXPORT void updateFilters();
63 MESSAGELIST_NO_EXPORT void createFilterByAction();
64 MESSAGELIST_NO_EXPORT void clearFilterByAction();
65 MESSAGELIST_NO_EXPORT void changeSearchAgainstFromOrToText();
66 MESSAGELIST_NO_EXPORT void slotClear();
67 MESSAGELIST_NO_EXPORT void showSavedFiltersMenu();
68 MESSAGELIST_NO_EXPORT void slotConfigureFilters();
69 MESSAGELIST_NO_EXPORT void slotActivateFilter(const QString &identifier);
70
71 bool mLocked = false;
72 bool mHasFilter = false;
73 QIcon mWithoutFilter;
74 QIcon mWithFilter;
75 QAction *mLockAction = nullptr;
76 QAction *mFiltersAction = nullptr;
77 QAction *mSaveFilterAction = nullptr;
78 QMenu *mFilterMenu = nullptr;
79 QCompleter *const mCompleter;
80 QList<QAction *> mFilterListActions;
81 QAction *mSearchEveryWhereAction = nullptr;
82 QAction *mSearchAgainstBodyAction = nullptr;
83 QAction *mSearchAgainstSubjectAction = nullptr;
84 QAction *mSearchAgainstFromOrToAction = nullptr;
85 QAction *mSearchAgainstBccAction = nullptr;
86 QStringListModel *const mCompleterListModel;
87 FilterSavedMenu *mFilterSavedMenu = nullptr;
88 QStringList mListCompetion;
89 QString mColorName;
90 bool mContainsOutboundMessages = false;
91};
92}
93}
This class is responsible of matching messages that should be displayed in the View.
Definition filter.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.