-
-
Notifications
You must be signed in to change notification settings - Fork 406
/
CWebViewInterface.h
66 lines (51 loc) · 2.54 KB
/
CWebViewInterface.h
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
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* (Shared logic for modifications)
* LICENSE: See LICENSE in the top level directory
* FILE: sdk/core/CWebViewInterface.h
* PURPOSE: WebView interface class
*
*****************************************************************************/
#pragma once
#include "CWebCoreInterface.h"
class CWebBrowserEventsInterface;
class CWebViewInterface
{
public:
virtual void Initialise() = 0;
virtual void SetWebBrowserEvents(CWebBrowserEventsInterface* pInterface) = 0;
virtual bool LoadURL(const SString& strURL, bool bFilterEnabled = true, const SString& strPostData = SString(), bool bURLEncoded = true) = 0;
virtual bool IsLoading() = 0;
virtual void SetBeingDestroyed(bool state) = 0;
virtual SString GetURL() = 0;
virtual const SString& GetTitle() = 0;
virtual void SetRenderingPaused(bool bPaused) = 0;
virtual const bool GetRenderingPaused() const = 0;
virtual void Focus(bool state = true) = 0;
virtual IDirect3DTexture9* GetTexture() = 0;
virtual bool HasInputFocus() = 0;
virtual void ExecuteJavascript(const SString& strJavascriptCode) = 0;
virtual bool SetProperty(const SString& strKey, const SString& strValue) = 0;
virtual bool GetProperty(const SString& strKey, SString& outProperty) = 0;
virtual void InjectMouseMove(int iPosX, int iPosY) = 0;
virtual void InjectMouseDown(eWebBrowserMouseButton mouseButton, int count) = 0;
virtual void InjectMouseUp(eWebBrowserMouseButton mouseButton) = 0;
virtual void InjectMouseWheel(int iScrollVert, int iScrollHorz) = 0;
virtual bool IsLocal() = 0;
virtual float GetAudioVolume() = 0;
virtual bool SetAudioVolume(float fVolume) = 0;
virtual void GetSourceCode(const std::function<void(const std::string& code)>& callback) = 0;
virtual void Resize(const CVector2D& size) = 0;
virtual CVector2D GetSize() = 0;
// Ajax Handlers
using ajax_callback_t = const std::function<const SString(std::vector<SString>& vecGet, std::vector<SString>& vecPost)>;
virtual bool RegisterAjaxHandler(const SString& strURL) = 0;
virtual bool UnregisterAjaxHandler(const SString& strURL) = 0;
virtual bool ToggleDevTools(bool visible) = 0;
virtual bool CanGoBack() = 0;
virtual bool CanGoForward() = 0;
virtual bool GoBack() = 0;
virtual bool GoForward() = 0;
virtual void Refresh(bool bIgnoreCache) = 0;
};