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  void enableBookmarks(bool enabled);
34 
35 protected:
36  void paintEvent(QPaintEvent *evt);
37  void resizeEvent(QResizeEvent *);
38  void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
39  void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
40  void focusOutEvent(QFocusEvent *event);
41 
42  virtual void dragEnterEvent(QDragEnterEvent *event);
43  virtual void dragMoveEvent(QDragMoveEvent *event);
44  virtual void dropEvent(QDropEvent *event);
45  virtual void contextMenuEvent(QContextMenuEvent *menu);
46 
47 public slots:
48  bool checkFilter();
49  void updateBookmarkMenu();
50  void applyDisplayFilter();
51  void displayFilterSuccess(bool success);
52  void setStyleSheet(const QString &style_sheet);
53 
54 private slots:
55  void checkFilter(const QString &filter_text);
56  void clearFilter();
57  void changeEvent(QEvent* event);
58 
59  void displayFilterExpression();
60 
61  void saveFilter();
62  void removeFilter();
63  void showFilters();
64  void showExpressionPrefs();
65  void applyOrPrepareFilter();
66 
67  void triggerAlignementAction();
68 
69  void connectToMainWindow();
70 
71 private:
72  DisplayFilterEditType type_;
73  QString placeholder_text_;
74  QAction *save_action_;
75  QAction *remove_action_;
76  QActionGroup * actions_;
77  StockIconToolButton *bookmark_button_;
78  StockIconToolButton *clear_button_;
79  StockIconToolButton *apply_button_;
80  bool leftAlignActions_;
81  QString last_applied_;
82  QString filter_word_preamble_;
83  bool autocomplete_accepts_field_;
84  QString style_sheet_;
85  bool bookmarks_enabled_;
86 
87  void setDefaultPlaceholderText();
88  void buildCompletionList(const QString &field_word, const QString &preamble);
89 
90  void createFilterTextDropMenu(QDropEvent *event, bool prepare, QString filterText = QString());
91 
92  void alignActionButtons();
93  void updateClearButton();
94 
95 signals:
96  void pushFilterSyntaxStatus(const QString&);
97  void popFilterSyntaxStatus();
98  void filterPackets(QString new_filter, bool force);
99  void showPreferencesDialog(QString pane_name);
100 
101 };
102 
103 #endif // DISPLAYFILTEREDIT_H
Definition: display_filter_edit.h:28
Definition: stock_icon_tool_button.h:16
Definition: syntax_line_edit.h:23