1 /* search_frame.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef SEARCH_FRAME_H
11 #define SEARCH_FRAME_H
12 
13 #include <config.h>
14 
15 #include "accordion_frame.h"
16 
17 #include "cfile.h"
18 
19 namespace Ui {
20 class SearchFrame;
21 }
22 
23 class SearchFrame : public AccordionFrame
24 {
25     Q_OBJECT
26 
27 public:
28     explicit SearchFrame(QWidget *parent = 0);
29     ~SearchFrame();
30     void animatedShow();
31     void findNext();
32     void findPrevious();
33     void setFocus();
34 
35 public slots:
36     void setCaptureFile(capture_file *cf);
37     void findFrameWithFilter(QString &filter);
38 
39 protected:
40     virtual void keyPressEvent(QKeyEvent *event);
41     void changeEvent(QEvent* event);
42 
43 private:
44     bool regexCompile();
45     void applyRecentSearchSettings();
46     void updateWidgets();
47 
48     Ui::SearchFrame *sf_ui_;
49     capture_file *cap_file_;
50     GRegex *regex_;
51     QString regex_error_;
52 
53 private slots:
54     void on_searchInComboBox_currentIndexChanged(int idx);
55     void on_charEncodingComboBox_currentIndexChanged(int idx);
56     void on_caseCheckBox_toggled(bool checked);
57     void on_searchTypeComboBox_currentIndexChanged(int idx);
58     void on_searchLineEdit_textChanged(const QString &);
59     void on_findButton_clicked();
60     void on_cancelButton_clicked();
61 };
62 
63 #endif // SEARCH_FRAME_H
64