Add ServiceResponseTimeDialog.
[metze/wireshark/wip.git] / ui / qt / filter_action.h
1 /* filter_action.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 /* Derived from gtk/filter_utils.h */
23
24 #ifndef FILTER_ACTION_H
25 #define FILTER_ACTION_H
26
27 #include "ui/utf8_entities.h"
28
29 #include <QAction>
30
31 class FilterAction : public QAction
32 {
33     Q_OBJECT
34 public:
35     /* Filter actions */
36     enum Action {
37         ActionApply,
38         ActionPrepare,
39         ActionFind,
40         ActionConversation,
41         ActionColorize,
42         ActionWebLookup,
43         ActionCopy
44     };
45
46     /* Action type - says what to do with the filter */
47     enum ActionType {
48         ActionTypePlain,
49         ActionTypeNot,
50         ActionTypeAnd,
51         ActionTypeOr,
52         ActionTypeAndNot,
53         ActionTypeOrNot
54     };
55
56     /* Action direction */
57     enum ActionDirection {
58         ActionDirectionAToFromB,
59         ActionDirectionAToB,
60         ActionDirectionAFromB,
61         ActionDirectionAToFromAny,
62         ActionDirectionAToAny,
63         ActionDirectionAFromAny,
64         ActionDirectionAnyToFromB,
65         ActionDirectionAnyToB,
66         ActionDirectionAnyFromB
67     };
68
69     explicit FilterAction(QObject *parent, Action action, ActionType type, ActionDirection direction);
70     explicit FilterAction(QObject *parent, Action action, ActionType type);
71     explicit FilterAction(QObject *parent, Action action);
72
73     Action action() { return action_; }
74     static const QList<Action> actions();
75     static const QString actionName(Action action);
76
77     ActionType actionType() { return type_; }
78     static const QList<ActionType> actionTypes(Action filter_action = ActionApply);
79     static const QString actionTypeName(ActionType type);
80
81     ActionDirection actionDirection() { return direction_; }
82     static const QList<ActionDirection> actionDirections();
83     static const QString actionDirectionName(ActionDirection direction);
84
85 signals:
86
87 public slots:
88
89 private:
90     Action action_;
91     ActionType type_;
92     ActionDirection direction_;
93
94 };
95
96 #endif // FILTER_ACTION_H
97
98 /*
99  * Editor modelines
100  *
101  * Local Variables:
102  * c-basic-offset: 4
103  * tab-width: 8
104  * indent-tabs-mode: nil
105  * End:
106  *
107  * ex: set shiftwidth=4 tabstop=8 expandtab:
108  * :indentSize=4:tabSize=8:noTabs=true:
109  */