aboutsummaryrefslogtreecommitdiff
path: root/sp/src/public/html/ihtmlchrome.h
blob: b4b74355c0ed52eb06f98b200c80bb7e83884fd4 (plain) (blame)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//=============================================================================//

#ifndef IHTMLCHROME_H
#define IHTMLCHROME_H

#ifdef _WIN32
#pragma once
#endif

#include "htmlmessages.h"
#include "tier1/utlbuffer.h"

// prototypes for all the protobuf messages, so we don't need to include all of protobuf
class CMsgBrowserReady;
class CMsgNeedsPaint;
class CMsgStartRequest;
class CMsgURLChanged;
class CMsgFinishedRequest;
class CMsgShowPopup;
class CMsgHidePopup;
class CMsgOpenNewTab;
class CMsgPopupHTMLWindow;
class CMsgSetHTMLTitle;
class CMsgLoadingResource;
class CMsgStatusText;
class CMsgSetCursor;
class CMsgFileLoadDialog;
class CMsgShowToolTip;
class CMsgUpdateToolTip;
class CMsgHideToolTip;
class CMsgSearchResults;
class CMsgClose;
class CMsgHorizontalScrollBarSizeResponse;
class CMsgVerticalScrollBarSizeResponse;
class CMsgGetZoomResponse;
class CMsgLinkAtPositionResponse;
class CMsgZoomToElementAtPositionResponse;
class CMsgJSAlert;
class CMsgJSConfirm;
class CMsgCanGoBackAndForward;
class CMsgOpenSteamURL;
class CMsgSizePopup;
class CMsgScalePageToValueResponse;
class CMsgRequestFullScreen;
class CMsgExitFullScreen;
class CMsgGetCookiesForURLResponse;
class CMsgNodeHasFocus;
class CMsgSavePageToJPEGResponse;
class CMsgFocusedNodeTextResponse;

//-----------------------------------------------------------------------------
// Purpose: a single IPC packet for the html thread (in and out)
//-----------------------------------------------------------------------------
struct HTMLCommandBuffer_t
{
	EHTMLCommands m_eCmd;
	int m_iBrowser;
	CUtlBuffer m_Buffer;
#ifdef DBGFLAG_VALIDATE
	virtual void Validate( CValidator &validator, const tchar *pchName )
	{
		VALIDATE_SCOPE();
		ValidateObj( m_Buffer );
	}
#endif
};


//-----------------------------------------------------------------------------
// Purpose: callback interfaces for messages from the html thread
//-----------------------------------------------------------------------------
class IHTMLResponses
{
public:
	virtual ~IHTMLResponses() {} 

	virtual void BrowserSetIndex( int idx ) = 0;
	virtual int  BrowserGetIndex() = 0;
	virtual void BrowserReady( const CMsgBrowserReady *pCmd ) = 0;
	virtual void BrowserNeedsPaint( const CMsgNeedsPaint *pCmd ) = 0;
	virtual void BrowserStartRequest( const CMsgStartRequest *pCmd ) = 0;
	virtual void BrowserURLChanged( const CMsgURLChanged *pCmd ) = 0;
	virtual void BrowserFinishedRequest( const CMsgFinishedRequest *pCmd ) = 0;
	virtual void BrowserShowPopup( const CMsgShowPopup *pCmd ) = 0;
	virtual void BrowserHidePopup( const CMsgHidePopup *pCmd ) = 0;
	virtual void BrowserOpenNewTab( const CMsgOpenNewTab *pCmd ) = 0;
	virtual void BrowserPopupHTMLWindow( const CMsgPopupHTMLWindow *pCmd ) = 0;
	virtual void BrowserSetHTMLTitle( const CMsgSetHTMLTitle *pCmd ) = 0;
	virtual void BrowserLoadingResource( const CMsgLoadingResource *pCmd ) = 0;
	virtual void BrowserStatusText( const CMsgStatusText *pCmd ) = 0;
	virtual void BrowserSetCursor( const CMsgSetCursor *pCmd ) = 0;
	virtual void BrowserFileLoadDialog( const CMsgFileLoadDialog *pCmd ) = 0;
	virtual void BrowserShowToolTip( const CMsgShowToolTip *pCmd ) = 0;
	virtual void BrowserUpdateToolTip( const CMsgUpdateToolTip *pCmd ) = 0;
	virtual void BrowserHideToolTip( const CMsgHideToolTip *pCmd ) = 0;
	virtual void BrowserSearchResults( const CMsgSearchResults *pCmd ) = 0;
	virtual void BrowserClose( const CMsgClose *pCmd ) = 0;
	virtual void BrowserHorizontalScrollBarSizeResponse( const CMsgHorizontalScrollBarSizeResponse *pCmd ) = 0;
	virtual void BrowserVerticalScrollBarSizeResponse( const CMsgVerticalScrollBarSizeResponse *pCmd ) = 0;
	virtual void BrowserGetZoomResponse( const CMsgGetZoomResponse *pCmd ) = 0;
	virtual void BrowserLinkAtPositionResponse( const CMsgLinkAtPositionResponse *pCmd ) = 0;
	virtual void BrowserZoomToElementAtPositionResponse( const CMsgZoomToElementAtPositionResponse *pCmd ) = 0;
	virtual void BrowserJSAlert( const CMsgJSAlert *pCmd ) = 0;
	virtual void BrowserJSConfirm( const CMsgJSConfirm *pCmd ) = 0;
	virtual void BrowserCanGoBackandForward( const CMsgCanGoBackAndForward *pCmd ) = 0;
	virtual void BrowserOpenSteamURL( const CMsgOpenSteamURL *pCmd ) = 0;
	virtual void BrowserSizePopup( const CMsgSizePopup *pCmd ) = 0;
	virtual void BrowserScalePageToValueResponse( const CMsgScalePageToValueResponse *pCmd ) = 0;
	virtual void BrowserRequestFullScreen( const CMsgRequestFullScreen *pCmd ) = 0;
	virtual void BrowserExitFullScreen( const CMsgExitFullScreen *pCmd ) = 0;
	virtual void BrowserGetCookiesForURLResponse( const CMsgGetCookiesForURLResponse *pCmd ) = 0;
	virtual void BrowserNodeGotFocus( const CMsgNodeHasFocus *pCmd ) = 0;
	virtual void BrowserSavePageToJPEGResponse( const CMsgSavePageToJPEGResponse *pCmd ) = 0;
	virtual void BrowserFocusedNodeValueResponse( const CMsgFocusedNodeTextResponse *pCmd ) = 0;
};

#endif // IHTMLCHROME_H