Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
in_packet_find_bar.h
Go to the documentation of this file.
1
9
10#ifndef IN_PACKET_FIND_BAR_H
11#define IN_PACKET_FIND_BAR_H
12
13#include <QModelIndex>
14#include <QPropertyAnimation>
15#include <QTimer>
16#include <QWidget>
17
18class InPacketSearch;
19class ProtoTree;
20
21namespace Ui {
22class InPacketFindBar;
23}
24
31class InPacketFindBar : public QWidget
32{
33 Q_OBJECT
34 Q_PROPERTY(int barHeight READ barHeight WRITE setBarHeight)
35
36public:
37 explicit InPacketFindBar(ProtoTree *tree, QWidget *parent = nullptr);
38 ~InPacketFindBar();
39
40 static int openInstances() { return open_instances_; }
41
42 void showAnimated();
43 void hideAnimated();
44 void focusSearchField();
45
46 bool isOpen() const { return is_open_; }
47
48 bool isMatch(const QModelIndex &model_index) const;
49 bool isCurrentMatch(const QModelIndex &model_index) const;
50
51 int barHeight() const;
52 void setBarHeight(int h);
53
54signals:
55 void matchesChanged();
56 void openChanged(bool open);
57
58protected:
59 bool eventFilter(QObject *obj, QEvent *event) override;
60 void keyPressEvent(QKeyEvent *event) override;
61
62private slots:
63 void onTextChanged(const QString &text);
64 void performSearch();
65 void executeFind();
66 void closeBar();
67 void onToggleChanged();
68
69private:
70 void advanceSearch(bool backward);
71 void updateFindButtonState();
72 void updateStyleSheet();
73 void recalculateNaturalHeight();
74 void updateCounterLabel();
75
76 ProtoTree *proto_tree_;
77 InPacketSearch *search_;
78 Ui::InPacketFindBar *ui_ = nullptr;
79
80 QTimer *debounce_timer_;
81 QPropertyAnimation *animation_;
82 QString last_search_pattern_;
83
84 bool is_open_;
85 static int open_instances_;
86 int natural_height_;
87};
88
89#endif // IN_PACKET_FIND_BAR_H
Search-within-current-packet logic shared by Find Packet (main window) and InPacketFindBar (single-pa...
Definition in_packet_search.h:24
A tree view for displaying protocol dissection details.
Definition proto_tree.h:30