File indexing completed on 2024-04-28 15:51:57

0001 /*
0002     SPDX-FileCopyrightText: 2004 Enrico Ros <eros.kde@email.it>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _OKULAR_SEARCHWIDGET_H_
0008 #define _OKULAR_SEARCHWIDGET_H_
0009 
0010 #include <qwidget.h>
0011 
0012 namespace Okular
0013 {
0014 class Document;
0015 }
0016 
0017 class QAction;
0018 class QMenu;
0019 
0020 class SearchLineEdit;
0021 
0022 /**
0023  * @short A widget for find-as-you-type search. Outputs to the Document.
0024  *
0025  * This widget accepts keyboard input and performs a call to findTextAll(..)
0026  * in the Okular::Document class when there are 3 or more chars to search for.
0027  * It supports case sensitive/unsensitive(default) and provides a button
0028  * for switching between the 2 modes.
0029  */
0030 class SearchWidget : public QWidget
0031 {
0032     Q_OBJECT
0033 public:
0034     SearchWidget(QWidget *parent, Okular::Document *document);
0035     void clearText();
0036 
0037 private:
0038     QMenu *m_menu;
0039     QAction *m_matchPhraseAction, *m_caseSensitiveAction, *m_marchAllWordsAction, *m_marchAnyWordsAction;
0040     SearchLineEdit *m_lineEdit;
0041 
0042 private Q_SLOTS:
0043     void slotMenuChaged(QAction *);
0044 };
0045 
0046 #endif