Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
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  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 /* Derived from gtk/filter_utils.h */
11 
12 #ifndef FILTER_ACTION_H
13 #define FILTER_ACTION_H
14 
15 #include <wsutil/utf8_entities.h>
16 
17 #include <QAction>
18 
19 class FilterAction : public QAction
20 {
21  Q_OBJECT
22 public:
23  /* Filter actions */
24  enum Action {
25  ActionApply,
26  ActionColorize,
27  ActionCopy,
28  ActionFind,
29  ActionPrepare,
30  ActionWebLookup
31  };
32 
33  /* Action type - says what to do with the filter */
34  enum ActionType {
35  ActionTypePlain,
36  ActionTypeNot,
37  ActionTypeAnd,
38  ActionTypeOr,
39  ActionTypeAndNot,
40  ActionTypeOrNot
41  };
42 
43  /* Action direction */
44  enum ActionDirection {
45  ActionDirectionAToFromB,
46  ActionDirectionAToB,
47  ActionDirectionAFromB,
48  ActionDirectionAToFromAny,
49  ActionDirectionAToAny,
50  ActionDirectionAFromAny,
51  ActionDirectionAnyToFromB,
52  ActionDirectionAnyToB,
53  ActionDirectionAnyFromB
54  };
55 
56  explicit FilterAction(QObject *parent, Action action, ActionType type, ActionDirection direction);
57  explicit FilterAction(QObject *parent, Action action, ActionType type);
58  explicit FilterAction(QObject *parent, Action action);
59 
60  Action action() { return action_; }
61  static const QList<Action> actions();
62  static const QString actionName(Action action);
63 
64  ActionType actionType() { return type_; }
65  static const QList<ActionType> actionTypes(Action filter_action = ActionApply);
66  static const QString actionTypeName(ActionType type);
67 
68  ActionDirection actionDirection() { return direction_; }
69  static const QList<ActionDirection> actionDirections();
70  static const QString actionDirectionName(ActionDirection direction);
71 
72 signals:
73 
74 public slots:
75 
76 private:
77  Action action_;
78  ActionType type_;
79  ActionDirection direction_;
80 
81 };
82 
83 #endif // FILTER_ACTION_H
84 
85 /*
86  * Editor modelines
87  *
88  * Local Variables:
89  * c-basic-offset: 4
90  * tab-width: 8
91  * indent-tabs-mode: nil
92  * End:
93  *
94  * ex: set shiftwidth=4 tabstop=8 expandtab:
95  * :indentSize=4:tabSize=8:noTabs=true:
96  */
Definition: filter_action.h:19