forked from simulationcraft/simc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebView.hpp
76 lines (50 loc) · 1.66 KB
/
WebView.hpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// ==========================================================================
// Dedmonwakeen's Raid DPS/TPS Simulator.
// Send questions to [email protected]
// ==========================================================================
#pragma once
#include "WebEngineConfig.hpp"
class SC_SearchBox;
class SC_MainWindow;
// ============================================================================
// SC_WebView
// ============================================================================
class SC_WebView : public SC_WebEngineView
{
Q_OBJECT
SC_SearchBox* searchBox;
QString previousSearch;
bool allow_mouse_navigation;
bool allow_keyboard_navigation;
bool allow_searching;
public:
SC_MainWindow* mainWindow;
int progress;
QString html_str;
QString url_to_show;
QByteArray out_html;
SC_WebView( SC_MainWindow* mw, QWidget* parent = nullptr, QString h = {} );
void store_html( const QString& s );
void loadHtml();
void enableMouseNavigation();
void disableMouseNavigation();
void enableKeyboardNavigation();
void disableKeyboardNavigation();
private:
void update_progress( int p );
protected:
void mouseReleaseEvent( QMouseEvent* e ) override;
void keyReleaseEvent( QKeyEvent* e ) override;
void resizeEvent( QResizeEvent* e ) override;
void focusInEvent( QFocusEvent* e ) override;
private slots:
void loadProgressSlot( int p );
void loadFinishedSlot( bool /* ok */ );
void urlChangedSlot( const QUrl& url );
public slots:
void hideSearchBox();
void findSomeText( const QString& text, SC_WebEnginePage::FindFlags options );
void findSomeText( const QString& text );
void findPrev();
void findNext();
};