Wireshark  4.3.0
The Wireshark network protocol analyzer
display_filter_edit.h
Go to the documentation of this file.
1 
10 #ifndef DISPLAYFILTEREDIT_H
11 #define DISPLAYFILTEREDIT_H
12 
13 #include <QDrag>
14 #include <QActionGroup>
15 
17 
18 class QEvent;
20 
21 typedef enum {
22  DisplayFilterToApply,
23  DisplayFilterToEnter,
24  ReadFilterToApply
25 } DisplayFilterEditType;
26 
28 {
29  Q_OBJECT
30 public:
31  explicit DisplayFilterEdit(QWidget *parent = 0, DisplayFilterEditType type = DisplayFilterToEnter);
32 
33 protected:
34  void paintEvent(QPaintEvent *evt);
35  void resizeEvent(QResizeEvent *);
36  void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
37  void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
38  void focusOutEvent(QFocusEvent *event);
39 
40  virtual void dragEnterEvent(QDragEnterEvent *event);
41  virtual void dragMoveEvent(QDragMoveEvent *event);
42  virtual void dropEvent(QDropEvent *event);
43  virtual void contextMenuEvent(QContextMenuEvent *menu);
44 
45 public slots:
46  bool checkFilter();
47  void updateBookmarkMenu();
48  void applyDisplayFilter();
49  void displayFilterSuccess(bool success);
50 
51 private slots:
52  void checkFilter(const QString &filter_text);
53  void clearFilter();
54  void changeEvent(QEvent* event);
55 
56  void displayFilterExpression();
57 
58  void saveFilter();
59  void removeFilter();
60  void showFilters();
61  void showExpressionPrefs();
62  void applyOrPrepareFilter();
63 
64  void triggerAlignementAction();
65 
66  void connectToMainWindow();
67 
68 private:
69  DisplayFilterEditType type_;
70  QString placeholder_text_;
71  QAction *save_action_;
72  QAction *remove_action_;
73  QActionGroup * actions_;
74  StockIconToolButton *bookmark_button_;
75  StockIconToolButton *clear_button_;
76  StockIconToolButton *apply_button_;
77  bool leftAlignActions_;
78  QString last_applied_;
79  QString filter_word_preamble_;
80  bool autocomplete_accepts_field_;
81 
82  void setDefaultPlaceholderText();
83  void buildCompletionList(const QString &field_word, const QString &preamble);
84 
85  void createFilterTextDropMenu(QDropEvent *event, bool prepare, QString filterText = QString());
86 
87  void alignActionButtons();
88  void updateClearButton();
89 
90 signals:
91  void pushFilterSyntaxStatus(const QString&);
92  void popFilterSyntaxStatus();
93  void filterPackets(QString new_filter, bool force);
94  void showPreferencesDialog(QString pane_name);
95 
96 };
97 
98 #endif // DISPLAYFILTEREDIT_H
Definition: display_filter_edit.h:28
Definition: stock_icon_tool_button.h:16
Definition: syntax_line_edit.h:23