Merge "persistent color scheme selection"
[trojita.git] / src / Gui / FindBar.h
blobe138c8a72f7a961edadec0316861cb6b462b73e9
1 /* ============================================================
3 * This file is a part of the rekonq project
5 * Copyright (C) 2008-2012 by Andrea Diamantini <adjam7 at gmail dot com>
6 * Copyright (C) 2009-2011 by Lionel Chauvin <megabigbug@yahoo.fr>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License or (at your option) version 3 or any later version
13 * accepted by the membership of KDE e.V. (or its successor approved
14 * by the membership of KDE e.V.), which shall act as a proxy
15 * defined in Section 14 of version 3 of the license.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * ============================================================ */
28 #ifndef GUI_FINDBAR_H
29 #define GUI_FINDBAR_H
31 #include <QPointer>
32 #include <QWidget>
34 class QCheckBox;
35 class QLineEdit;
36 class QString;
37 class QWebView;
39 namespace Gui {
41 class FindBar : public QWidget
43 Q_OBJECT
45 public:
46 explicit FindBar(QWidget *parent);
47 enum FindDirection { Forward = 0, Backward };
49 bool matchCase() const;
50 void notifyMatch(bool match);
51 bool highlightAllState() const;
53 void setVisible(bool visible);
54 void setAssociatedWebView(QWebView *webView);
56 protected:
57 void keyPressEvent(QKeyEvent *event);
59 private slots:
60 void findText(const QString &search);
61 void matchCaseUpdate();
62 void findNext();
63 void findPrevious();
64 void updateHighlight();
65 void resetAssociatedWebView();
67 signals:
68 void searchString(const QString &);
70 private:
71 void find(FindDirection dir);
73 private:
74 QLineEdit *m_lineEdit;
75 QCheckBox *m_matchCase;
76 QCheckBox *m_highlightAll;
78 QString _lastStringSearched;
79 QPointer<QWebView> m_associatedWebView;
84 #endif