Messagelib

quicksearchline.h
1/*
2 SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5
6*/
7
8#pragma once
9
10#include "config-messagelist.h"
11#include "messagelist_export.h"
12#include "searchmessagebybuttons.h"
13#include <Akonadi/MessageStatus>
14#include <QWidget>
15
16class QComboBox;
17namespace MessageList
18{
19namespace Core
20{
21class SearchLineStatus;
22class Filter;
23class SearchStatusButtons;
24class SearchMessageByButtons;
25class SearchLineCommandWidget;
26/**
27 * @brief The QuickSearchLine class
28 * @author Laurent Montel <montel@kde.org>
29 */
30class MESSAGELIST_EXPORT QuickSearchLine : public QWidget
31{
32 Q_OBJECT
33public:
34 explicit QuickSearchLine(QWidget *parent = nullptr);
35 ~QuickSearchLine() override;
36
37 [[nodiscard]] SearchMessageByButtons::SearchOptions searchOptions() const;
38
39 void focusQuickSearch(const QString &selectedText);
40
41 [[nodiscard]] QComboBox *tagFilterComboBox() const;
42 [[nodiscard]] SearchLineStatus *searchEdit() const;
43 void resetFilter();
44 [[nodiscard]] QList<Akonadi::MessageStatus> status() const;
45
46 void updateComboboxVisibility();
47
48 [[nodiscard]] bool containsOutboundMessages() const;
49 void setContainsOutboundMessages(bool containsOutboundMessages);
50
51 void changeQuicksearchVisibility(bool show);
52 void addCompletionItem(const QString &str);
53
54 void setSearchOptions(SearchMessageByButtons::SearchOptions opts);
55 void setFilterMessageStatus(const QList<Akonadi::MessageStatus> &newLstStatus);
56
57Q_SIGNALS:
58 void clearButtonClicked();
59 void searchEditTextEdited(const QString &);
60 void searchOptionChanged();
61 void statusButtonsClicked();
62 void forceLostFocus();
63 void saveFilter();
64 void activateFilter(MessageList::Core::Filter *f);
65
66protected:
67 bool eventFilter(QObject *object, QEvent *e) override;
68private Q_SLOTS:
69 MESSAGELIST_NO_EXPORT void slotSearchEditTextEdited(const QString &text);
70 MESSAGELIST_NO_EXPORT void slotClearButtonClicked();
71 MESSAGELIST_NO_EXPORT void slotFilterActionChanged(const QList<Akonadi::MessageStatus> &lst);
72
73private:
74 SearchLineStatus *const mSearchEdit;
75 SearchStatusButtons *const mSearchStatusButtons;
76 SearchMessageByButtons *const mSearchMessageByButtons;
77#if USE_SEARCH_COMMAND_LINE
78 SearchLineCommandWidget *const mSearchLineCommandWidget;
79#endif
80 QComboBox *const mTagFilterCombo;
82};
83}
84}
This class is responsible of matching messages that should be displayed in the View.
Definition filter.h:34
The QuickSearchLine class.
Q_SCRIPTABLE CaptureState status()
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.