aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/expert_info_dialog.h
blob: 2128b78c8fe07b2c5e5825dacbdf02a04fafadbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* expert_info_dialog.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
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef EXPERT_INFO_DIALOG_H
#define EXPERT_INFO_DIALOG_H

#include <config.h>

#include <glib.h>

#include "filter_action.h"
#include "wireshark_dialog.h"

#include <QMenu>
#include <QTreeWidgetItem>

struct epan_dissect;
struct expert_info_s;
struct _packet_info;

namespace Ui {
class ExpertInfoDialog;
}

class ExpertPacketTreeWidgetItem;

class ExpertInfoDialog : public WiresharkDialog
{
    Q_OBJECT

public:
    explicit ExpertInfoDialog(QWidget &parent, CaptureFile& capture_file);
    ~ExpertInfoDialog();

    void clearAllData();
    void setDisplayFilter(const QString &display_filter = QString());

signals:
    void goToPacket(int packet_num, int hf_id);
    void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);

private:
    Ui::ExpertInfoDialog *ui;

    int comment_events_;
//    int disp_events;
    int chat_events_;
    int note_events_;
    int warn_events_;
    int error_events_;

    bool need_show_hide_;

    QMenu ctx_menu_;

    QHash<QString, QTreeWidgetItem*> ei_to_ti_;
    QHash<QTreeWidgetItem*, QList<QTreeWidgetItem *> > gti_packets_;
    QList<QAction *> severity_actions_;

    QString display_filter_;

    void addExpertInfo(ExpertPacketTreeWidgetItem *packet_ti);
    // Called from tapPacket
    void addExpertInfo(struct expert_info_s *expert_info);
    // Called from tapDraw
    void updateCounts();

    // Callbacks for register_tap_listener
    static void tapReset(void *eid_ptr);
    static gboolean tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data);
    static void tapDraw(void *eid_ptr);

    QTreeWidgetItem *ensureGroupTreeWidgetItem(ExpertPacketTreeWidgetItem *packet_ti);
    void addPacketTreeItems();

private slots:
    void retapPackets();
    void retapStarted();
    void retapFinished();

    void updateWidgets();

    void actionShowToggled();
    void showProtoHierMenu(QPoint pos);
    void filterActionTriggered();
    void captureFileClosing();

    void on_expertInfoTreeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *);
    void on_limitCheckBox_toggled(bool);
    void on_groupBySummaryCheckBox_toggled(bool);
    void on_searchLineEdit_textChanged(const QString &search_re);
    void on_buttonBox_helpRequested();
};

#endif // EXPERT_INFO_DIALOG_H

/*
 * 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:
 */