| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
lua_debugger_find_frame.h
Go to the documentation of this file.
1/* lua_debugger_find_frame.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
14
15#ifndef LUA_DEBUGGER_FIND_FRAME_H
16#define LUA_DEBUGGER_FIND_FRAME_H
17
18#include <QPointer>
19
20#include "accordion_frame.h"
21
22 class QEvent;
23 class QKeyEvent;
24 class QPlainTextEdit;
25
26 namespace Ui
27{
28 class LuaDebuggerFindFrame;
29}
30
34 class LuaDebuggerFindFrame : public AccordionFrame
35{
36 Q_OBJECT
37
38 public:
43 explicit LuaDebuggerFindFrame(QWidget *parent = nullptr);
44
48 ~LuaDebuggerFindFrame() override;
49
54 void setTargetEditor(QPlainTextEdit *editor);
55
59 void scheduleFindFieldFocus();
60
61 protected:
68 bool eventFilter(QObject *watched, QEvent *event) override;
69
74 void keyPressEvent(QKeyEvent *event) override;
75
76 private:
78 Ui::LuaDebuggerFindFrame *ui_;
79
81 QPointer<QPlainTextEdit> editor_;
82
86 void focusFindField();
87
92 void findNext(bool backward);
93
98 bool selectionMatchesFind() const;
99
103 void replaceAll();
104
105 private slots:
109 void on_findNextButton_clicked();
110
114 void on_findPreviousButton_clicked();
115
119 void on_replaceButton_clicked();
120
124 void on_replaceAllButton_clicked();
125
129 void on_closeButton_clicked();
130};
131
132#endif // LUA_DEBUGGER_FIND_FRAME_H
accordion_frame.h
AccordionFrame::AccordionFrame
AccordionFrame(QWidget *parent=0)
Create an AccordionFrame with the given parent.
Definition accordion_frame.cpp:22
LuaDebuggerFindFrame::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Handles key presses within the bar (e.g. Enter to find next, Escape to close).
Definition lua_debugger_find_frame.cpp:102
LuaDebuggerFindFrame::setTargetEditor
void setTargetEditor(QPlainTextEdit *editor)
Sets the code editor that find/replace operations act upon.
Definition lua_debugger_find_frame.cpp:69
LuaDebuggerFindFrame::scheduleFindFieldFocus
void scheduleFindFieldFocus()
After animatedShow(), move focus to the find field (call from dialog).
Definition lua_debugger_find_frame.cpp:89
LuaDebuggerFindFrame::LuaDebuggerFindFrame
LuaDebuggerFindFrame(QWidget *parent=nullptr)
Constructs the find/replace bar.
Definition lua_debugger_find_frame.cpp:28
LuaDebuggerFindFrame::eventFilter
bool eventFilter(QObject *watched, QEvent *event) override
Intercepts events on watched objects to handle editor-side keyboard shortcuts.
Definition lua_debugger_find_frame.cpp:53
LuaDebuggerFindFrame::~LuaDebuggerFindFrame
~LuaDebuggerFindFrame() override
Destroys the find/replace bar.
Definition lua_debugger_find_frame.cpp:67