2012-01-04 22:13:01 +00:00
|
|
|
/* display_filter_edit.h
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2012-01-04 22:13:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DISPLAYFILTEREDIT_H
|
|
|
|
#define DISPLAYFILTEREDIT_H
|
|
|
|
|
2017-11-07 15:51:43 +00:00
|
|
|
#include <QDrag>
|
2019-11-04 13:42:44 +00:00
|
|
|
#include <QActionGroup>
|
2017-11-07 15:51:43 +00:00
|
|
|
|
2017-07-05 14:56:45 +00:00
|
|
|
#include <ui/qt/widgets/syntax_line_edit.h>
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2015-03-03 20:27:10 +00:00
|
|
|
class QEvent;
|
2015-09-02 21:51:33 +00:00
|
|
|
class StockIconToolButton;
|
2015-03-03 20:27:10 +00:00
|
|
|
|
2015-11-16 19:00:32 +00:00
|
|
|
typedef enum {
|
|
|
|
DisplayFilterToApply,
|
|
|
|
DisplayFilterToEnter,
|
2015-11-21 07:46:10 +00:00
|
|
|
ReadFilterToApply
|
2015-11-16 19:00:32 +00:00
|
|
|
} DisplayFilterEditType;
|
|
|
|
|
2012-10-08 20:01:59 +00:00
|
|
|
class DisplayFilterEdit : public SyntaxLineEdit
|
2012-01-04 22:13:01 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-11-16 19:00:32 +00:00
|
|
|
explicit DisplayFilterEdit(QWidget *parent = 0, DisplayFilterEditType type = DisplayFilterToEnter);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *evt);
|
|
|
|
void resizeEvent(QResizeEvent *);
|
2015-05-19 17:18:54 +00:00
|
|
|
void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
|
|
|
|
void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
|
|
|
|
void focusOutEvent(QFocusEvent *event);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2017-11-07 15:51:43 +00:00
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dragMoveEvent(QDragMoveEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
2019-11-05 11:41:18 +00:00
|
|
|
virtual void contextMenuEvent(QContextMenuEvent *menu);
|
2017-11-07 15:51:43 +00:00
|
|
|
|
2012-12-07 01:46:20 +00:00
|
|
|
public slots:
|
2015-08-18 19:15:27 +00:00
|
|
|
bool checkFilter();
|
2016-01-27 20:30:52 +00:00
|
|
|
void updateBookmarkMenu();
|
2012-12-07 01:46:20 +00:00
|
|
|
void applyDisplayFilter();
|
|
|
|
void displayFilterSuccess(bool success);
|
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
private slots:
|
2015-09-02 21:51:33 +00:00
|
|
|
void checkFilter(const QString &filter_text);
|
2014-03-11 04:27:50 +00:00
|
|
|
void clearFilter();
|
2013-12-21 16:55:43 +00:00
|
|
|
void changeEvent(QEvent* event);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2015-09-02 21:51:33 +00:00
|
|
|
void saveFilter();
|
|
|
|
void removeFilter();
|
|
|
|
void showFilters();
|
2015-10-27 16:52:51 +00:00
|
|
|
void showExpressionPrefs();
|
2017-03-01 09:11:27 +00:00
|
|
|
void applyOrPrepareFilter();
|
2015-09-02 21:51:33 +00:00
|
|
|
|
2019-11-05 11:41:18 +00:00
|
|
|
void triggerAlignementAction();
|
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
private:
|
2015-11-16 19:00:32 +00:00
|
|
|
DisplayFilterEditType type_;
|
2015-03-03 20:27:10 +00:00
|
|
|
QString placeholder_text_;
|
2016-01-27 20:30:52 +00:00
|
|
|
QAction *save_action_;
|
|
|
|
QAction *remove_action_;
|
2019-11-04 13:42:44 +00:00
|
|
|
QActionGroup * actions_;
|
2015-09-02 21:51:33 +00:00
|
|
|
StockIconToolButton *bookmark_button_;
|
|
|
|
StockIconToolButton *clear_button_;
|
|
|
|
StockIconToolButton *apply_button_;
|
2019-11-05 11:41:18 +00:00
|
|
|
bool leftAlignActions_;
|
2015-03-03 20:27:10 +00:00
|
|
|
|
2015-11-16 19:00:32 +00:00
|
|
|
void setDefaultPlaceholderText();
|
2015-03-03 20:27:10 +00:00
|
|
|
void buildCompletionList(const QString& field_word);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2019-06-16 10:02:37 +00:00
|
|
|
void createFilterTextDropMenu(QDropEvent *event, bool prepare, QString filterText = QString());
|
2019-06-11 21:15:44 +00:00
|
|
|
|
2019-11-05 11:41:18 +00:00
|
|
|
void alignActionButtons();
|
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
signals:
|
2015-03-04 23:43:33 +00:00
|
|
|
void pushFilterSyntaxStatus(const QString&);
|
2012-01-14 00:16:16 +00:00
|
|
|
void popFilterSyntaxStatus();
|
2015-09-11 18:13:23 +00:00
|
|
|
void filterPackets(QString new_filter, bool force);
|
2017-12-29 16:23:07 +00:00
|
|
|
void showPreferencesDialog(QString pane_name);
|
2019-06-11 21:15:44 +00:00
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DISPLAYFILTEREDIT_H
|
2012-09-04 08:18:31 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|