extcap: Add regular expression validation support
[metze/wireshark/wip.git] / ui / qt / extcap_argument_multiselect.h
1 /* extcap_argument_multiselect.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef UI_QT_EXTCAP_ARGUMENT_MULTISELECT_H_
23 #define UI_QT_EXTCAP_ARGUMENT_MULTISELECT_H_
24
25 #include <QObject>
26 #include <QWidget>
27 #include <QStandardItem>
28 #include <QTreeView>
29 #include <QAbstractItemModel>
30 #include <QItemSelection>
31
32 #include <extcap_parser.h>
33 #include <extcap_argument.h>
34
35 class ExtArgMultiSelect : public ExtcapArgument
36 {
37     Q_OBJECT
38 public:
39     ExtArgMultiSelect(extcap_arg * argument);
40     virtual ~ExtArgMultiSelect();
41
42     virtual QString value();
43     virtual QString defaultValue();
44     virtual bool isValid();
45
46 protected:
47     virtual QList<QStandardItem *> valueWalker(ExtcapValueList list, QStringList &defaults);
48     void selectItemsWalker(QStandardItem * item, QStringList defaults);
49     virtual QWidget * createEditor(QWidget * parent);
50
51 private Q_SLOTS:
52
53     void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
54
55 private:
56
57     QTreeView * treeView;
58     QAbstractItemModel * viewModel;
59
60 };
61
62 #endif /* UI_QT_EXTCAP_ARGUMENT_MULTISELECT_H_ */
63
64 /*
65  * Editor modelines
66  *
67  * Local Variables:
68  * c-basic-offset: 4
69  * tab-width: 8
70  * indent-tabs-mode: nil
71  * End:
72  *
73  * ex: set shiftwidth=4 tabstop=8 expandtab:
74  * :indentSize=4:tabSize=8:noTabs=true:
75  */