update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / ui / qt / utils / proto_node.h
blobd6cf37978eefe07bab1c910a9847e19245c5ee8d
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef PROTO_NODE_H_
11 #define PROTO_NODE_H_
13 #include <config.h>
15 #include <epan/proto.h>
17 #include <QObject>
18 #include <QVector>
20 class ProtoNode
22 public:
24 class ChildIterator {
25 public:
26 typedef struct _proto_node * NodePtr;
28 ChildIterator(NodePtr n = Q_NULLPTR);
30 bool hasNext();
31 ChildIterator next();
32 ProtoNode element();
34 protected:
35 NodePtr node;
38 explicit ProtoNode(proto_node * node = NULL, ProtoNode *parent = nullptr);
39 ~ProtoNode();
41 bool isValid() const;
42 bool isChild() const;
43 bool isExpanded() const;
45 proto_node *protoNode() const;
46 ProtoNode *child(int row);
47 int childrenCount() const;
48 int row();
49 ProtoNode *parentNode();
51 QString labelText() const;
53 ChildIterator children() const;
55 private:
56 proto_node * node_;
57 QVector<ProtoNode*>m_children;
58 ProtoNode *parent_;
59 static bool isHidden(proto_node * node);
63 #endif // PROTO_NODE_H_