Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
interface_frame.h
1 /* interface_frame.h
2  * Display of interfaces, including their respective data, and the
3  * capability to filter interfaces by type
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef INTERFACE_FRAME_H
13 #define INTERFACE_FRAME_H
14 
15 #include <config.h>
16 
17 #include <glib.h>
18 
19 #include <ui/qt/models/info_proxy_model.h>
20 #include <ui/qt/models/interface_tree_model.h>
21 #include <ui/qt/models/interface_sort_filter_model.h>
22 
23 #include <QFrame>
24 #include <QHBoxLayout>
25 #include <QAbstractButton>
26 #include <QTimer>
27 #include <QMenu>
28 #include <QPushButton>
29 
30 namespace Ui {
31 class InterfaceFrame;
32 }
33 
34 class InterfaceFrame : public QFrame
35 {
36  Q_OBJECT
37 public:
38  explicit InterfaceFrame(QWidget *parent = 0);
39  ~InterfaceFrame();
40 
41  int interfacesHidden();
42 
43  QMenu * getSelectionMenu();
44  int interfacesPresent();
45  void ensureSelectedInterface();
46 
47 Q_SIGNALS:
48  void showExtcapOptions(QString device_name);
49  void startCapture();
50  void itemSelectionChanged();
51  void typeSelectionChanged();
52 
53 public slots:
54  void updateSelectedInterfaces();
55  void interfaceListChanged();
56  void toggleHiddenInterfaces();
57 #ifdef HAVE_PCAP_REMOTE
58  void toggleRemoteInterfaces();
59 #endif
60  void getPoints(int idx, PointList *pts);
61 
62 protected:
63  void hideEvent(QHideEvent *evt);
64  void showEvent(QShowEvent *evt);
65 
66 private:
67 
68  void resetInterfaceTreeDisplay();
69 
71 
72  InterfaceSortFilterModel proxyModel;
73  InterfaceTreeModel sourceModel;
74  InfoProxyModel infoModel;
75 
76  QMap<int, QString> ifTypeDescription;
77 
78 #ifdef HAVE_LIBPCAP
79  QTimer *stat_timer_;
80 #endif // HAVE_LIBPCAP
81 
82 private slots:
83  void interfaceTreeSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
84 
85  void on_interfaceTree_doubleClicked(const QModelIndex &index);
86 #ifdef HAVE_LIBPCAP
87  void on_interfaceTree_clicked(const QModelIndex &index);
88 #endif
89 
90  void updateStatistics(void);
91  void actionButton_toggled(bool checked);
92  void triggeredIfTypeButton();
93 };
94 
95 #endif // INTERFACE_FRAME_H
96 
97 /*
98  * Editor modelines
99  *
100  * Local Variables:
101  * c-basic-offset: 4
102  * tab-width: 8
103  * indent-tabs-mode: nil
104  * End:
105  *
106  * ex: set shiftwidth=4 tabstop=8 expandtab:
107  * :indentSize=4:tabSize=8:noTabs=true:
108  */
Definition: interface_tree_model.h:54
Definition: ui_interface_frame.h:80
Definition: interface_frame.h:34
Definition: ui_about_dialog.h:291
Definition: interface_sort_filter_model.h:22
Definition: info_proxy_model.h:19