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 addCompletionItem(const QString &str);
33 void slotClearHistory();
34 void clearFilterButtonClicked();
35 void filterAdded();
36 void slotInsertCommand(const QString &command);
37Q_SIGNALS:
38 void clearButtonClicked();
39 void forceLostFocus();
40 void saveFilter();
41 void activateFilter(MessageList::Core::Filter *f);
42 void searchCommandActionRequested();
43
44protected:
45 void contextMenuEvent(QContextMenuEvent *e) override;
46 void keyPressEvent(QKeyEvent *e) override;
47
48private:
49 MESSAGELIST_NO_EXPORT void slotToggledLockAction();
50 MESSAGELIST_NO_EXPORT void clearFilterAction();
51 MESSAGELIST_NO_EXPORT void updateLockAction();
52 MESSAGELIST_NO_EXPORT void initializeActions();
53 MESSAGELIST_NO_EXPORT void updateFilterLineEditBackgroundColor();
54 MESSAGELIST_NO_EXPORT void slotClear();
55 MESSAGELIST_NO_EXPORT void showSavedFiltersMenu();
56 MESSAGELIST_NO_EXPORT void slotConfigureFilters();
57 MESSAGELIST_NO_EXPORT void slotActivateFilter(const QString &identifier);
58
59 bool mLocked = false;
60 bool mHasFilter = false;
61 QAction *mLockAction = nullptr;
62 QAction *mSaveFilterAction = nullptr;
63 QAction *mSearchCommandAction = nullptr;
64 QCompleter *const mCompleter;
65 QStringListModel *const mCompleterListModel;
66 FilterSavedMenu *mFilterSavedMenu = nullptr;
67 QStringList mListCompetion;
68 QString mColorName;
69};
70}
71}
This class is responsible of matching messages that should be displayed in the View.
Definition filter.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.