aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/game/client/iviewport.h
blob: 5e26f3a560fbaef943cb64b3b7e73f67e412a2c1 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $Workfile:     $
// $Date:         $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#if !defined( IVIEWPORT_H )
#define IVIEWPORT_H
#ifdef _WIN32
#pragma once
#endif

#include <vgui/VGUI.h>

#include "viewport_panel_names.h"

class KeyValues;

abstract_class IViewPortPanel
{
	
public:
	virtual	~IViewPortPanel() {};

	virtual const char *GetName( void ) = 0;// return identifer name
	virtual void SetData(KeyValues *data) = 0; // set ViewPortPanel data
	virtual void Reset( void ) = 0;		// clears internal state, deactivates it
	virtual void Update( void ) = 0;	// updates all (size, position, content, etc)
	virtual bool NeedsUpdate( void ) = 0; // query panel if content needs to be updated
	virtual bool HasInputElements( void ) = 0;	// true if panel contains elments which accepts input

	virtual void ShowPanel( bool state ) = 0; // activate VGUI Frame
		
	// VGUI functions:
	virtual vgui::VPANEL GetVPanel( void ) = 0; // returns VGUI panel handle
	virtual bool IsVisible() = 0;  // true if panel is visible
	virtual void SetParent( vgui::VPANEL parent ) = 0;
};

abstract_class IViewPort
{
public:
	virtual void UpdateAllPanels( void ) = 0;
	virtual void ShowPanel( const char *pName, bool state ) = 0;	
	virtual void ShowPanel( IViewPortPanel* pPanel, bool state ) = 0;	
	virtual void ShowBackGround(bool bShow) = 0;
	virtual IViewPortPanel* FindPanelByName(const char *szPanelName) = 0;
	virtual IViewPortPanel* GetActivePanel( void ) = 0;
	virtual void PostMessageToPanel( const char *pName, KeyValues *pKeyValues ) = 0;
};

extern IViewPort *gViewPortInterface;


#endif // IVIEWPORT_H