Wireshark  4.3.0
The Wireshark network protocol analyzer
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 
23 {
24  Q_OBJECT
25 public:
26  explicit CaptureFilterEdit(QWidget *parent = 0, bool plain = false);
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  bool plain_;
57  bool field_name_only_;
58  bool enable_save_action_;
59  QString placeholder_text_;
60  QAction *save_action_;
61  QAction *remove_action_;
62  QActionGroup * actions_;
63  StockIconToolButton *bookmark_button_;
64  StockIconToolButton *clear_button_;
65  StockIconToolButton *apply_button_;
66  CaptureFilterSyntaxWorker *syntax_worker_;
67  QThread *syntax_thread_;
68 
69  void buildCompletionList(const QString &primitive_word, const QString &preamble);
70 
71 signals:
72  void captureFilterSyntaxChanged(bool valid);
73  void captureFilterChanged(const QString filter);
74  void startCapture();
75  void addBookmark(const QString filter);
76 
77 };
78 
79 #endif // CAPTURE_FILTER_EDIT_H
Definition: capture_filter_edit.h:23
Definition: capture_filter_syntax_worker.h:18
Definition: stock_icon_tool_button.h:16
Definition: syntax_line_edit.h:23