// Asura_Xbox360_Profile_GUIMenu.h
// Thomas Young - 13.10.08
// Copyright (C) 2008 Rebellion, All Rights Reserved.

// F I L E   W R A P P E R ///////////////////////////////////////////////////

#ifndef _ASURA_XBOX360_PROFILE_GUIMENU_H_
#define _ASURA_XBOX360_PROFILE_GUIMENU_H_

// I N C L U D E S ///////////////////////////////////////////////////////////

#include "Core/Asura.h"

#include "Core/Asura_Xbox360_Profile_System.h"

// T Y P E D E F S ///////////////////////////////////////////////////////////

typedef void ( *Asura_Xbox360_Profile_GUIMenu_Function )( void );

// E N U M E R A T I O N S ///////////////////////////////////////////////////

enum ASURA_XBOX360_PROFILE_GUIMENU_CALLBACK
{
	ASURA_XBOX360_PROFILE_GUIMENU_CALLBACK_PAUSE			= 0,
	ASURA_XBOX360_PROFILE_GUIMENU_CALLBACK_UNPAUSE			,
	ASURA_XBOX360_PROFILE_GUIMENU_CALLBACK_RETURN_TO_START	,

	ASURA_XBOX360_PROFILE_GUIMENU_NUM_CALLBACKS
};

// C L A S S   D E C L A R A T I O N S ///////////////////////////////////////

class Asura_Xbox360_Profile_GUIMenu
{
	public:
	
		static void Initialise				( const char* const szMenuPage = 0 );
		static void Update					( );
		static void Shutdown				( );

		static bool LoadResources			( );

		#ifdef ASURA_ASSERT
		static void ValidateResources		( );
		#endif

		static bool ConsoleCmd_Button		( int iButton, bool bInterrogate, bool bHelp );

		static void RegisterCallback		( const ASURA_XBOX360_PROFILE_GUIMENU_CALLBACK eCallbackType, Asura_Xbox360_Profile_GUIMenu_Function pfnFunction );

	private:

		static bool StateHasChanged			( const Asura_Xbox360_Profile_State			eSystemState
											, const Asura_Xbox360_Profile_Query_State	eQueryState 
											, const Asura_Xbox360_Profile_Error_State	eErrorState );
		
		static void HideAllWidgets			( );
		static void SetWidgetVisible		( const Asura_Hash_ID uWidget, const bool bVisible );
		static void SetWidgetText			( const Asura_Hash_ID uContainer, const Asura_Hash_ID uTextID );
		static void SetWidgetPosition		( const Asura_Hash_ID uContainer, const float fX1, const float fY1, const float fX2, const float fY2 );

		static void UpdateButtonNavLinks	( );

		static void ConfigurePageForQuery		( const Asura_Xbox360_Profile_Query_State eState );
		static void SetPageTextForError		( const Asura_Xbox360_Profile_Error_State eState );

		static void SetButonsForQuery		( const Asura_Xbox360_Profile_Query_State eState );

		static inline void Callback			( const ASURA_XBOX360_PROFILE_GUIMENU_CALLBACK eCallbackType );

		static Asura_Hash_ID GetWidgetGUIMenuID ( const Asura_Hash_ID uWidget );

		static Asura_Xbox360_Profile_State				s_eSystemState;
		static Asura_Xbox360_Profile_Error_State		s_eErrorState;
		static Asura_Xbox360_Profile_Query_State		s_eQueryState;

		static Asura_Xbox360_Profile_GUIMenu_Function	s_apfnCallbacks[ ASURA_XBOX360_PROFILE_GUIMENU_NUM_CALLBACKS ];

		static bool										s_bPaused;
		static bool										s_bReturnToStart;
};

#endif // _ASURA_XBOX360_PROFILE_GUIMENU_H_

//eof
