Libksieve

findbarbase.h
1/* SPDX-FileCopyrightText: 2010 Torgny Nyblom <nyblom@kde.org>
2 * SPDX-FileCopyrightText: 2010-2024 Laurent Montel <montel@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#pragma once
8
9#include "ksieveui_export.h"
10#include <QWidget>
11class QAction;
12class QPushButton;
13class QMenu;
14class QLabel;
15namespace PimCommon
16{
17class LineEditWithCompleterNg;
18}
19namespace KSieveUi
20{
21class KSIEVEUI_EXPORT FindBarBase : public QWidget
22{
23 Q_OBJECT
24public:
25 explicit FindBarBase(QWidget *parent = nullptr);
26 ~FindBarBase() override;
27
28 [[nodiscard]] QString text() const;
29 void setText(const QString &text);
30 void focusAndSetCursor();
31
32protected:
33 bool event(QEvent *e) override;
34 virtual void clearSelections();
35 virtual void updateHighLight(bool);
36 virtual void searchText(bool backward, bool isAutoSearch);
37 virtual void updateSensitivity(bool);
38
39 void setFoundMatch(bool match);
40 QMenu *optionsMenu();
41
42public Q_SLOTS:
43 void findNext();
44 void findPrev();
45 void autoSearch(const QString &str);
46 void slotSearchText(bool backward = false, bool isAutoSearch = true);
47 void closeBar();
48
49Q_SIGNALS:
50 void hideFindBar();
51
52protected Q_SLOTS:
53 void caseSensitivityChanged(bool);
54 void slotHighlightAllChanged(bool);
55
56protected:
57 QString mNotFoundString;
58 QString mPositiveBackground;
59 QString mNegativeBackground;
60 QString mLastSearchStr;
61 PimCommon::LineEditWithCompleterNg *mSearch = nullptr;
62 QAction *mCaseSensitiveAct = nullptr;
63
64 QPushButton *mFindPrevBtn = nullptr;
65 QPushButton *mFindNextBtn = nullptr;
66 QMenu *mOptionsMenu = nullptr;
67 QLabel *mStatus = nullptr;
68 void addToCompletion(const QString &text);
69};
70}
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
const QList< QKeySequence > & findPrev()
const QList< QKeySequence > & findNext()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.