//
// Tools_HelperObject_Object.h
//
// Created by Richard Rice - 31/08/2006
// 
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __TOOLS_HELPEROBJECT_OBJECT__
#define __TOOLS_HELPEROBJECT_OBJECT__

#include "HelperObject/Tools_HelperObject.h"
#include "Objects/Tools_Object.h"

//Not one of my better names...
//This is the tools object for the helper objects

class Tools_HelperObject_Object : public Tools_Object
{
public :
	Tools_HelperObject_Object(Tools_HelperObject* pxHelper);
	~Tools_HelperObject_Object();

	//create a new tools_helper and tools object for it
	static void Create();

	//Used by the object system to create/delete the objects
	static void CreateToolsObjects();
	static void DeleteToolsObjects();

	//sets visibility of objects when moving to or from object modes
	static void UpdateVisibility(bool bObjectControlsEnabled);

protected :
	//virtual function overrides
	virtual const char* GetName(){return m_pxHelper->m_xName.GetString();}
	virtual const char* GetTypeDescription(){return "Tools Helper";}
	virtual void OnSelection();
	virtual void OnDeselection();
	virtual void Destroy();
	virtual void Update();
	virtual void UpdateWhileSelected();
	virtual void Render();

	virtual bool GetParameter(Asura_Hash_ID uParamID,class Tools_Parameter* pxParam) const;
	virtual bool SetParameter(Asura_Hash_ID uParamID,const class Tools_Parameter* pxParam);

	virtual bool ShouldPersistBetweenModes() const {return true;}

	static const char* GetNamePrefix() { return "TH_"; }
	virtual const char* GetMyNamePrefix() const { return Tools_HelperObject_Object::GetNamePrefix(); }

	void SetModified();

private :
	void CreateOverlay();
	void DeleteOverlay();

	//overlay callback functions
	#define OVERLAY_VOID_CALLBACK(__FnName)\
	static void __FnName(int iThis){((Tools_HelperObject_Object*)iThis)->__FnName();}\
	void __FnName();

	OVERLAY_VOID_CALLBACK(EditComment)
	OVERLAY_VOID_CALLBACK(EditVolume)
	OVERLAY_VOID_CALLBACK(SelectFile)
	OVERLAY_VOID_CALLBACK(Rename)

	#undef OVERLAY_VOID_CALLBACK



	Tools_HelperObject* m_pxHelper;
	u_int m_uVolumeEditID;
	bool m_bChanged;

public :
	static Asura_Vector_2 s_xOverlayPosition;
};


#endif //__TOOLS_HELPEROBJECT_OBJECT__