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
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2012-01-04 22:13:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DISPLAYFILTEREDIT_H
|
|
|
|
#define DISPLAYFILTEREDIT_H
|
|
|
|
|
2012-10-08 20:01:59 +00:00
|
|
|
#include "syntax_line_edit.h"
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2015-03-03 20:27:10 +00:00
|
|
|
class QEvent;
|
|
|
|
class QToolButton;
|
|
|
|
|
2012-10-08 20:01:59 +00:00
|
|
|
class DisplayFilterEdit : public SyntaxLineEdit
|
2012-01-04 22:13:01 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2013-11-21 01:28:17 +00:00
|
|
|
explicit DisplayFilterEdit(QWidget *parent = 0, bool plain = true);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
|
|
|
protected:
|
2015-03-03 20:27:10 +00:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
2012-01-04 22:13:01 +00:00
|
|
|
void paintEvent(QPaintEvent *evt);
|
2015-03-03 20:27:10 +00:00
|
|
|
#endif
|
2012-01-04 22:13:01 +00:00
|
|
|
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
|
|
|
|
2012-12-07 01:46:20 +00:00
|
|
|
public slots:
|
2015-08-18 19:15:27 +00:00
|
|
|
bool checkFilter();
|
2012-12-07 01:46:20 +00:00
|
|
|
void applyDisplayFilter();
|
|
|
|
void displayFilterSuccess(bool success);
|
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
private slots:
|
|
|
|
void checkFilter(const QString &text);
|
2013-02-06 18:22:54 +00:00
|
|
|
void bookmarkClicked();
|
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
|
|
|
|
|
|
|
private:
|
2012-08-23 02:59:31 +00:00
|
|
|
bool plain_;
|
2015-03-03 20:27:10 +00:00
|
|
|
QString placeholder_text_;
|
2012-08-23 02:59:31 +00:00
|
|
|
QToolButton *bookmark_button_;
|
|
|
|
QToolButton *clear_button_;
|
|
|
|
QToolButton *apply_button_;
|
2015-03-03 20:27:10 +00:00
|
|
|
|
|
|
|
void buildCompletionList(const QString& field_word);
|
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-03-04 23:43:33 +00:00
|
|
|
void pushFilterSyntaxWarning(const QString&);
|
2012-12-07 01:46:20 +00:00
|
|
|
void filterPackets(QString& new_filter, bool force);
|
2013-02-06 18:22:54 +00:00
|
|
|
void addBookmark(QString filter);
|
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:
|
|
|
|
*/
|