| 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
17#include <ui/qt/widgets/syntax_line_edit.h>
18
19 class CaptureFilterSyntaxWorker;
20 class StockIconToolButton;
21
22 class CaptureFilterEdit : public SyntaxLineEdit
23{
24 Q_OBJECT
25 public:
26 explicit CaptureFilterEdit(QWidget *parent = 0, bool plain = false);
27 ~CaptureFilterEdit();
28 void setConflict(bool conflict = false);
29 // No selections: (QString(), false)
30 // Selections, same filter: (filter, false)
31 // Selections, different filters (QString(), true)
32 static QPair<const QString, bool> getSelectedFilter();
33
34 protected:
35 void paintEvent(QPaintEvent *evt);
36 void resizeEvent(QResizeEvent *);
37 void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
38 void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
39
40 public slots:
41 void checkFilter();
42 void updateBookmarkMenu();
43 void saveFilter();
44 void removeFilter();
45 void showFilters();
46 void prepareFilter();
47
48 private slots:
49 void applyCaptureFilter();
50 void checkFilter(const QString &filter);
51 void setFilterSyntaxState(QString filter, int state, QString err_msg);
52 void bookmarkClicked();
53 void clearFilter();
54
55 private:
56 void updateFilter();
57
58 bool plain_;
59 bool field_name_only_;
60 bool enable_save_action_;
61 QString placeholder_text_;
62 QAction *save_action_;
63 QAction *remove_action_;
64 QActionGroup * actions_;
65 StockIconToolButton *bookmark_button_;
66 StockIconToolButton *clear_button_;
67 StockIconToolButton *apply_button_;
68 CaptureFilterSyntaxWorker *syntax_worker_;
69 QThread *syntax_thread_;
70 QTimer *line_edit_timer_;
71
72 void buildCompletionList(const QString &primitive_word, const QString &preamble);
73
74signals:
75 void captureFilterSyntaxChanged(bool valid);
76 void captureFilterChanged(const QString filter);
77 void startCapture();
78 void addBookmark(const QString filter);
79
80};
81
82#endif // CAPTURE_FILTER_EDIT_H
CaptureFilterEdit
Definition capture_filter_edit.h:23
CaptureFilterSyntaxWorker
Definition capture_filter_syntax_worker.h:18
StockIconToolButton
Definition stock_icon_tool_button.h:16
SyntaxLineEdit
Definition syntax_line_edit.h:23
syntax_line_edit.h