Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
search_frame.h
Go to the documentation of this file.
1
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 <epan/cfile.h>
18
19#include <QComboBox>
20#include <QList>
21#include <QTimer>
22
23class InPacketSearch;
24
25namespace Ui {
26class SearchFrame;
27}
28
35{
36 Q_OBJECT
37
38public:
43 explicit SearchFrame(QWidget *parent = 0);
44
48 virtual ~SearchFrame();
49
53 void animatedShow();
54
58 void findNext();
59
63 void findPrevious();
64
68 void setFocus();
69
74
78 void setInPacketMode(bool enabled);
79
86 void setSelectedFrames(const QList<int> &frames, bool single_selected);
87
88 bool inPacketMode() const;
89
90public slots:
96
100 void refreshWidgets();
101
107 void findFrameWithFilter(QString &filter);
108
112 void cancelSearch();
113
114protected:
120 virtual void keyPressEvent(QKeyEvent *event) override;
121
127 void changeEvent(QEvent *event) override;
128
133 void updateWidgets();
134
139 QComboBox *searchInComboBox() const;
140
141 bool eventFilter(QObject *obj, QEvent *event) override;
142
143private:
149 bool regexCompile();
150
155 void applyRecentSearchSettings();
156
160 void executeInPacketSearch();
161
165 void advanceInPacketSearch(bool backward);
166
170 void refreshInPacketSearchForSelectedFrame();
171
175 int searchTypeIndex() const;
176
180 void configureSearchTypeComboBox(bool in_packet_mode);
181
185 void applySearchLineEditForSearchType(int search_type);
186
190 void saveRecentSearchType(int search_type);
191
195 void updateSearchTypeToolTip(int combo_index);
196
200 void updateInPacketSearchSyntax();
201
205 void updateInPacketFindCounter();
206
207 InPacketSearch *in_packet_search_;
208 QTimer *in_packet_debounce_timer_;
209 Ui::SearchFrame *sf_ui_;
210 capture_file *cap_file_;
211 ws_regex_t *regex_;
212 QString regex_error_;
213 QString in_packet_last_pattern_;
214 QString full_search_type_tooltip_;
215 QString in_packet_string_tooltip_;
216 QString in_packet_regex_tooltip_;
217 bool packet_selected_;
218 int selected_frame_;
219 int last_searched_frame_;
220 int saved_full_search_type_;
221
222private slots:
228 void on_searchInComboBox_currentIndexChanged(int idx);
229
234 void on_charEncodingComboBox_currentIndexChanged(int idx);
235
240 void on_caseCheckBox_toggled(bool checked);
241
247 void on_searchTypeComboBox_currentIndexChanged(int idx);
248
253 void on_searchLineEdit_textChanged(const QString &);
254
259 void on_dirCheckBox_toggled(bool checked);
260
265 void on_multipleCheckBox_toggled(bool checked);
266
271 void inPacketCheckBoxToggled(bool checked);
272
276 void onApplicationFocusChanged(QWidget *old, QWidget *now);
277
281 void executeSearch();
282};
283
284#endif // SEARCH_FRAME_H
struct _capture_file capture_file
Represents a capture file and its associated metadata.
AccordionFrame(QWidget *parent=0)
Create an AccordionFrame with the given parent.
Definition accordion_frame.cpp:22
Search-within-current-packet logic shared by Find Packet (main window) and InPacketFindBar (single-pa...
Definition in_packet_search.h:24
void setFocus()
Transfers keyboard focus to the search input field.
Definition search_frame.cpp:274
QComboBox * searchInComboBox() const
Returns the "Search In" combo box widget for use by subclasses or tests.
Definition search_frame.cpp:122
void setInPacketSearch(InPacketSearch *search)
Attach in-packet search engine for the main-window proto tree.
Definition search_frame.cpp:127
void animatedShow()
Expands the frame with an animation and focuses the search input.
Definition search_frame.cpp:203
void findNext()
Navigates to the next frame matching the current search criteria.
Definition search_frame.cpp:210
void refreshWidgets()
Refreshes widget enablement and validation state.
Definition search_frame.cpp:289
void updateWidgets()
Enables or disables UI controls based on the current search type, direction, and validity of the sear...
Definition search_frame.cpp:496
void setInPacketMode(bool enabled)
Enable or disable in-packet search mode on the Find toolbar.
Definition search_frame.cpp:136
virtual void keyPressEvent(QKeyEvent *event) override
Handles key press events; maps Enter/Return to findNext() and Escape to collapsing the frame.
Definition search_frame.cpp:320
SearchFrame(QWidget *parent=0)
Constructs a SearchFrame in its collapsed (hidden) state.
Definition search_frame.cpp:52
void setSelectedFrames(const QList< int > &frames, bool single_selected)
Reflect packet list selection for in-packet find.
Definition search_frame.cpp:148
virtual ~SearchFrame()
Destroys the SearchFrame and releases all associated resources.
Definition search_frame.cpp:114
void findFrameWithFilter(QString &filter)
Populates the search field with filter, switches the search type to display filter,...
Definition search_frame.cpp:294
void cancelSearch()
Collapses the search frame and clears any active search highlight.
Definition search_frame.cpp:1045
void findPrevious()
Navigates to the previous frame matching the current search criteria.
Definition search_frame.cpp:242
void setCaptureFile(capture_file *cf)
Updates the capture file pointer used for frame searches.
Definition search_frame.cpp:280
void changeEvent(QEvent *event) override
Responds to language or palette change events by retranslating and refreshing the UI.
Definition search_frame.cpp:1064