| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
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#include <QPointer>
16
17#include <ui/qt/widgets/syntax_line_edit.h>
18
19class QEvent;
20class StockIconToolButton;
21
22typedef enum {
23 DisplayFilterToApply,
24 DisplayFilterToEnter,
25 ReadFilterToApply,
26 CustomColumnToEnter,
27} DisplayFilterEditType;
28
29 class DisplayFilterEdit : public SyntaxLineEdit
30{
31 Q_OBJECT
32public:
33 explicit DisplayFilterEdit(QWidget *parent = 0, DisplayFilterEditType type = DisplayFilterToEnter);
34 void setType(DisplayFilterEditType type);
35
36protected:
37 void paintEvent(QPaintEvent *evt);
38 void resizeEvent(QResizeEvent *);
39 void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
40 void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
41 void focusOutEvent(QFocusEvent *event);
42
43 virtual void dragEnterEvent(QDragEnterEvent *event);
44 virtual void dragMoveEvent(QDragMoveEvent *event);
45 virtual void dropEvent(QDropEvent *event);
46 virtual void contextMenuEvent(QContextMenuEvent *menu);
47
48public slots:
49 bool checkFilter();
50 void updateBookmarkMenu();
51 void applyDisplayFilter();
52 void displayFilterSuccess(bool success);
53 void setStyleSheet(const QString &style_sheet);
54
55private slots:
56 void checkFilter(const QString &filter_text);
57 void clearFilter();
58 void changeEvent(QEvent* event);
59
60 void displayFilterExpression();
61
62 void saveFilter();
63 void removeFilter();
64 void showFilters();
65 void showExpressionPrefs();
66 void applyOrPrepareFilter();
67
68 void triggerAlignementAction();
69
70 void connectToMainWindow();
71
72private:
73 DisplayFilterEditType type_;
74 QString placeholder_text_;
75 QAction *save_action_;
76 QAction *remove_action_;
77 QActionGroup * actions_;
78 QPointer<StockIconToolButton> bookmark_button_;
79 QPointer<StockIconToolButton> clear_button_;
80 QPointer<StockIconToolButton> apply_button_;
81 bool leftAlignActions_;
82 QString last_applied_;
83 QString filter_word_preamble_;
84 bool autocomplete_accepts_field_;
85 QString style_sheet_;
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
95signals:
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
DisplayFilterEdit
Definition display_filter_edit.h:30
StockIconToolButton
Definition stock_icon_tool_button.h:16
SyntaxLineEdit
Definition syntax_line_edit.h:23
syntax_line_edit.h