forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindInPageWidget.h
More file actions
50 lines (38 loc) · 1.26 KB
/
FindInPageWidget.h
File metadata and controls
50 lines (38 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) 2026, Fırat Kızılboğa <firatkizilboga11@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Function.h>
#include <LibGUI/Button.h>
#include <LibGUI/CheckBox.h>
#include <LibGUI/Event.h>
#include <LibGUI/Label.h>
#include <LibGUI/TextBox.h>
#include <LibGUI/Widget.h>
#include <LibWebView/OutOfProcessWebView.h>
namespace Browser {
class FindInPageWidget final
: public GUI::Widget {
C_OBJECT(FindInPageWidget);
public:
virtual ~FindInPageWidget() override = default;
void initialize(WebView::OutOfProcessWebView& web_view);
void show(String const& global_term);
Function<void(String const&)> on_search_text_change;
private:
FindInPageWidget();
virtual void keydown_event(GUI::KeyEvent&) override;
void find_text_changed();
void notify_search_text_changed();
void update_result_label(size_t current_match_index, Optional<size_t> const& total_match_count);
RefPtr<WebView::OutOfProcessWebView> m_web_content_view;
RefPtr<GUI::Button> m_close_button;
RefPtr<GUI::Button> m_previous_button;
RefPtr<GUI::Button> m_next_button;
RefPtr<GUI::TextBox> m_search_textbox;
RefPtr<GUI::CheckBox> m_match_case_checkbox;
RefPtr<GUI::Label> m_result_label;
};
}