aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_stream_dialog.h
blob: e18543aa9ff4a26c7a78bac0cdb6b0fe1b4219c5 (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
/* rtp_stream_dialog.h
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef RTP_STREAM_DIALOG_H
#define RTP_STREAM_DIALOG_H

#include "wireshark_dialog.h"

#include "ui/rtp_stream.h"
#include "rtp_player_dialog.h"

#include <QAbstractButton>
#include <QMenu>

namespace Ui {
class RtpStreamDialog;
}

class RtpStreamDialog : public WiresharkDialog
{
    Q_OBJECT

public:
    explicit RtpStreamDialog(QWidget &parent, CaptureFile &cf);
    ~RtpStreamDialog();
    void selectRtpStream(rtpstream_id_t *id);
    void deselectRtpStream(rtpstream_id_t *id);

signals:
    // Tells the packet list to redraw. An alternative might be to add a
    // cf_packet_marked callback to file.[ch] but that's synchronous and
    // might incur too much overhead.
    void packetsMarked();
    void updateFilter(QString filter, bool force = false);
    void goToPacket(int packet_num);
    void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_info_t *> stream_infos);
    void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_info_t *> stream_infos);
    void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_info_t *> stream_infos);
    void rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_infos);
    void rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_infos);
    void rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_infos);

public slots:
    void displayFilterSuccess(bool success);
    void rtpPlayerReplace();
    void rtpPlayerAdd();
    void rtpPlayerRemove();
    void rtpAnalysisReplace();
    void rtpAnalysisAdd();
    void rtpAnalysisRemove();

protected:
    bool eventFilter(QObject *obj, QEvent *event);
    void captureFileClosing();
    void captureFileClosed();

private:
    Ui::RtpStreamDialog *ui;
    rtpstream_tapinfo_t tapinfo_;
    QPushButton *find_reverse_button_;
    QPushButton *prepare_button_;
    QPushButton *export_button_;
    QPushButton *copy_button_;
    QPushButton *analyze_button_;
    QPushButton *player_button_;
    QMenu ctx_menu_;
    bool need_redraw_;
    QList<rtpstream_id_t> last_selected_;

    static void tapReset(rtpstream_tapinfo_t *tapinfo);
    static void tapDraw(rtpstream_tapinfo_t *tapinfo);
    static void tapMarkPacket(rtpstream_tapinfo_t *tapinfo, frame_data *fd);

    void updateStreams();
    void updateWidgets();
    void showPlayer();

    void setRtpStreamSelection(rtpstream_id_t *id, bool state);

    QList<QVariant> streamRowData(int row) const;
    void freeLastSelected();
    void invertSelection();
    QVector<rtpstream_info_t *>getSelectedRtpStreams();
    QVector<rtpstream_id_t *>getSelectedRtpStreamIDs();

private slots:
    void showStreamMenu(QPoint pos);
    void on_actionCopyAsCsv_triggered();
    void on_actionCopyAsYaml_triggered();
    void on_actionFindReverseNormal_triggered();
    void on_actionFindReversePair_triggered();
    void on_actionFindReverseSingle_triggered();
    void on_actionGoToSetup_triggered();
    void on_actionMarkPackets_triggered();
    void on_actionPrepareFilter_triggered();
    void on_streamTreeWidget_itemSelectionChanged();
    void on_buttonBox_helpRequested();
    void on_actionExportAsRtpDump_triggered();
    void captureEvent(CaptureEvent e);
    void on_displayFilterCheckBox_toggled(bool checked);
    void on_todCheckBox_toggled(bool checked);
    void on_actionSelectAll_triggered();
    void on_actionSelectInvert_triggered();
    void on_actionSelectNone_triggered();
    void on_actionAnalyze_triggered();
};

#endif // RTP_STREAM_DIALOG_H