Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
conversation_colorize_action.h
1 /* conversation_colorize_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 #ifndef CONVERSATIONCOLORIZEACTION_H
11 #define CONVERSATIONCOLORIZEACTION_H
12 
13 #include <QAction>
14 
16 struct _packet_info;
17 
18 // Actions for "Conversation Filter" and "Colorize with Filter" menu items.
19 
20 class ConversationAction : public QAction
21 {
22  Q_OBJECT
23 public:
24  ConversationAction(QObject *parent, struct conversation_filter_s *conv_filter = NULL);
25 
26  bool isFilterValid(struct _packet_info *pinfo);
27 
28  const QByteArray filter() { return filter_ba_; }
29 
30  void setColorNumber(int color_number) { color_number_ = color_number; }
31  int colorNumber() { return color_number_; }
32 
33 public slots:
34  // Exactly one of these should be connected.
35  void setPacketInfo(struct _packet_info *pinfo);
36  void setFieldFilter(const QByteArray field_filter);
37 
38 private:
39  struct conversation_filter_s *conv_filter_;
40  QByteArray filter_ba_;
41  int color_number_;
42 };
43 
44 class ColorizeAction : public QAction
45 {
46  Q_OBJECT
47 public:
48  ColorizeAction(QObject *parent) : QAction(parent),
49  color_number_(-1)
50  {}
51 
52  const QByteArray filter() { return filter_ba_; }
53 
54  void setColorNumber(int color_number) { color_number_ = color_number; }
55  int colorNumber() { return color_number_; }
56 
57 public slots:
58  void setFieldFilter(const QByteArray field_filter) { filter_ba_ = field_filter; }
59 
60 private:
61  QByteArray filter_ba_;
62  int color_number_;
63 };
64 
65 #endif // CONVERSATIONCOLORIZEACTION_H
66 
67 /*
68  * Editor modelines
69  *
70  * Local Variables:
71  * c-basic-offset: 4
72  * tab-width: 8
73  * indent-tabs-mode: nil
74  * End:
75  *
76  * ex: set shiftwidth=4 tabstop=8 expandtab:
77  * :indentSize=4:tabSize=8:noTabs=true:
78  */
Definition: packet_info.h:44
Definition: conversation_colorize_action.h:44
Definition: conversation_colorize_action.h:20
Definition: dissector_filters.h:51