Libksieve

findbarbase.h
1 /* SPDX-FileCopyrightText: 2010 Torgny Nyblom <[email protected]>
2  * SPDX-FileCopyrightText: 2010-2021 Laurent Montel <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 #pragma once
8 
9 #include "ksieveui_export.h"
10 #include <QWidget>
11 class QAction;
12 class QPushButton;
13 class QMenu;
14 class QLabel;
15 namespace PimCommon
16 {
17 class LineEditWithCompleterNg;
18 }
19 namespace KSieveUi
20 {
21 class KSIEVEUI_EXPORT FindBarBase : public QWidget
22 {
23  Q_OBJECT
24 public:
25  explicit FindBarBase(QWidget *parent = nullptr);
26  ~FindBarBase() override;
27 
28  Q_REQUIRED_RESULT QString text() const;
29  void setText(const QString &text);
30  void focusAndSetCursor();
31 
32 protected:
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 
42 public 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 
49 Q_SIGNALS:
50  void hideFindBar();
51 
52 protected Q_SLOTS:
53  void caseSensitivityChanged(bool);
54  void slotHighlightAllChanged(bool);
55 
56 protected:
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 }
71 
const QList< QKeySequence > & findPrev()
const QList< QKeySequence > & findNext()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Apr 11 2021 23:09:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.