| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
extcap_argument_multiselect.h
Go to the documentation of this file.
1
10#ifndef UI_QT_EXTCAP_ARGUMENT_MULTISELECT_H_
11#define UI_QT_EXTCAP_ARGUMENT_MULTISELECT_H_
12
13#include <QObject>
14#include <QWidget>
15#include <QStandardItem>
16#include <QTreeView>
17#include <QAbstractItemModel>
18#include <QItemSelection>
19#include <QLineEdit>
20#include <QPushButton>
21#include <QAction>
22#include <QTableView>
23#include <QToolBar>
24#include <QDialog>
25#include <QMap>
26#include <QSortFilterProxyModel>
27
28#include <extcap_parser.h>
29#include <extcap_argument.h>
30
31#include "extcap_options_dialog.h"
32
33 class TreeSortFilterProxyModel : public QSortFilterProxyModel
34{
35 public:
36 bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override;
37
38 using QSortFilterProxyModel::QSortFilterProxyModel;
39};
40
41 class ExtArgMultiSelect : public ExtcapArgument
42{
43 Q_OBJECT
44 public:
45 ExtArgMultiSelect(extcap_arg * argument, QObject *parent = Q_NULLPTR);
46 virtual ~ExtArgMultiSelect();
47
48 virtual QString value();
49 virtual bool isValid();
50 virtual QString defaultValue();
51 virtual bool isSetDefaultValueSupported();
52
53 public Q_SLOTS:
54 virtual void setDefaultValue();
55
56 protected:
57 virtual QList<QStandardItem *> valueWalker(ExtcapValueList list, QStringList &defaults);
58 void checkItemsWalker(QStandardItem * item, QStringList defaults);
59 virtual QWidget * createEditor(QWidget * parent);
60 virtual QStringList checkedValues();
61 QStandardItemModel* viewModel;
62 /* This stores the displays associated with a value */
63 QMap<QString, QString> displayNames;
64
65 private:
66 QTreeView * treeView;
67};
68
69
70 class ExtArgTable : public ExtArgMultiSelect
71{
72 Q_OBJECT
73
74 public:
75 ExtArgTable(extcap_arg* argument, QObject* parent = Q_NULLPTR);
76 virtual ~ExtArgTable();
77
78 virtual QString value();
79
80 public Q_SLOTS:
81 virtual void setDefaultValue();
82
83 protected:
84 virtual QWidget* createEditor(QWidget* parent);
85 void addKnown();
86 void addCustom();
87 void removeSelected();
88 void addChecked(QStringList checked, QStringList options);
89 virtual void showExtcapOptionsDialogForOptionValue(QStandardItem* item, QString& option_value);
90 virtual void extcap_options_finished(QStandardItem* item);
91
92 private:
93 ExtcapOptionsDialog* extcap_options_dialog;
94 QDialog* addDialog;
95
96 QStandardItemModel* tableViewModel;
97 QTableView* tableView;
98
99 QVBoxLayout* paneLayout;
100 QToolBar* toolbar;
101};
102
103 class ExtArgTableAddDialog : public QDialog
104{
105 Q_OBJECT
106
107 public:
108 ExtArgTableAddDialog(QWidget* parent, QWidget* selector);
109};
110
111#endif /* UI_QT_EXTCAP_ARGUMENT_MULTISELECT_H_ */
ExtArgMultiSelect
Definition extcap_argument_multiselect.h:42
ExtArgTableAddDialog
Definition extcap_argument_multiselect.h:104
ExtArgTable
Definition extcap_argument_multiselect.h:71
ExtcapArgument
Definition extcap_argument.h:71
ExtcapOptionsDialog
Definition extcap_options_dialog.h:33
TreeSortFilterProxyModel
Definition extcap_argument_multiselect.h:34
extcap_argument.h
extcap_options_dialog.h
extcap_parser.h
_extcap_arg
Definition extcap_parser.h:106