Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
capture_filter_edit.h
Go to the documentation of this file.
1
10#ifndef CAPTURE_FILTER_EDIT_H
11#define CAPTURE_FILTER_EDIT_H
12
13#include <QThread>
14#include <QToolButton>
15#include <QActionGroup>
16
18
21
26{
27 Q_OBJECT
28public:
34 explicit CaptureFilterEdit(QWidget *parent = 0, bool plain = false);
35
40
45 void setConflict(bool conflict = false);
46
57 static QPair<const QString, bool> getSelectedFilter();
58
59protected:
64 void paintEvent(QPaintEvent *evt);
65
70 void resizeEvent(QResizeEvent *event);
71
77
83
84public slots:
88 void checkFilter();
89
93 void updateBookmarkMenu();
94
98 void saveFilter();
99
103 void removeFilter();
104
108 void showFilters();
109
113 void prepareFilter();
114
115private slots:
119 void applyCaptureFilter();
120
125 void checkFilter(const QString &filter);
126
133 void setFilterSyntaxState(QString filter, int state, QString err_msg);
134
138 void bookmarkClicked();
139
143 void clearFilter();
144
145private:
149 void updateFilter();
150
151 bool plain_;
152 bool field_name_only_;
153 bool enable_save_action_;
154 QString placeholder_text_;
155 QAction *save_action_;
156 QAction *remove_action_;
157 QActionGroup * actions_;
158 StockIconToolButton *bookmark_button_;
159 StockIconToolButton *clear_button_;
160 StockIconToolButton *apply_button_;
161 CaptureFilterSyntaxWorker *syntax_worker_;
162 QThread *syntax_thread_;
163 QTimer *line_edit_timer_;
170 void buildCompletionList(const QString &primitive_word, const QString &preamble);
171
172signals:
178
183 void captureFilterChanged(const QString filter);
184
189
194 void addBookmark(const QString filter);
195
196};
197
198#endif // CAPTURE_FILTER_EDIT_H
A line edit widget specialized for editing, validating, and managing capture filters.
Definition capture_filter_edit.h:26
void paintEvent(QPaintEvent *evt)
Handles paint events for the widget.
Definition capture_filter_edit.cpp:232
void removeFilter()
Removes the current filter from the saved filters list.
Definition capture_filter_edit.cpp:526
void captureFilterChanged(const QString filter)
Signal emitted when the capture filter text changes.
~CaptureFilterEdit()
Destroys the CaptureFilterEdit widget.
Definition capture_filter_edit.cpp:224
void captureFilterSyntaxChanged(bool valid)
Signal emitted when the filter syntax validity changes.
void keyPressEvent(QKeyEvent *event)
Handles key press events, forwarding to completion logic.
Definition capture_filter_edit.h:76
void updateBookmarkMenu()
Updates the bookmark menu with current saved filters.
Definition capture_filter_edit.cpp:389
void saveFilter()
Saves the current filter to the bookmarks/saved filters list.
Definition capture_filter_edit.cpp:518
void startCapture()
Signal emitted to request starting a capture using the current filter.
void focusInEvent(QFocusEvent *event)
Handles focus in events, forwarding to completion logic.
Definition capture_filter_edit.h:82
static QPair< const QString, bool > getSelectedFilter()
Gets the currently selected filter from the UI state.
Definition capture_filter_edit.cpp:302
void checkFilter()
Triggers a syntax check of the current filter text.
Definition capture_filter_edit.cpp:379
void showFilters()
Displays the list of available filters.
Definition capture_filter_edit.cpp:548
void setConflict(bool conflict=false)
Sets the visual conflict state of the capture filter edit.
Definition capture_filter_edit.cpp:286
void prepareFilter()
Prepares the filter string for application.
Definition capture_filter_edit.cpp:556
void addBookmark(const QString filter)
Signal emitted to request adding a bookmark for the given filter.
void resizeEvent(QResizeEvent *event)
Handles resize events for the widget.
Definition capture_filter_edit.cpp:260
Worker class for checking capture filter syntax in the background.
Definition capture_filter_syntax_worker.h:21
A tool button that displays a stock icon.
Definition stock_icon_tool_button.h:19
QLineEdit subclass that adds syntax-state colouring, error messaging, and partial token-based autocom...
Definition syntax_line_edit.h:28
virtual bool event(QEvent *event)
Intercepts Tab and other keys to trigger or dismiss the completer.
Definition syntax_line_edit.cpp:295
void completionKeyPressEvent(QKeyEvent *event)
Handles key press events while the completer popup is visible, forwarding navigation keys to the popu...
Definition syntax_line_edit.cpp:333
void completionFocusInEvent(QFocusEvent *event)
Triggers a completion refresh when the widget gains focus.
Definition syntax_line_edit.cpp:381