
//**************************************************************************/
// Copyright (c) 2008 Autodesk, Inc.
// All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk license
// agreement provided at the time of installation or download, or which
// otherwise accompanies this software in either electronic or hard copy form.
//
//**************************************************************************/
// DESCRIPTION:
// CREATED: October 2008
//**************************************************************************/

#ifndef __MUDBOXSDK_INTERFACE_H__
#define __MUDBOXSDK_INTERFACE_H__
#pragma once


namespace mudbox
{
	class MBDLL_DECL Interface
	{
	public:

		enum LayerUIType
		{
			ltSculptUI,		///< Sculpt Layer UI
			ltPaintUI		///< Paint Layer UI
		};


		void ShowNewPaintLayerDialog( void );

		/// Activates the given system in the Layer UI window.
		void ActivateLayerSystem( 
			LayerUIType eType  ///< [in] The layer system to activate. 
			);
        /// Restores the current brush to the previous one
        bool RestorePreviousBrush( void );

		/// Loads mesh only (.mud or .obj) into the current scene.
		void Load( bool bMerge, QString filename );
	};

	/// \brief This class represents an action which can be triggered by the user
	///
	/// The action with it's current name will appear in the hotkey dialog, where users can change the hotkey for the action.
	/// When the users press the hotkey, the OnActivate function will be called for the object.
	class MBDLL_DECL Action : public Node
	{
		DECLARE_CLASS;

		enum Hotkeys
		{
			keyAlt = 0x00010000,		/// value for the alt key, can be used as a modifier 
			keyShift = 0x00020000,	/// value for the shift key, can be used as a modifier 
			keyCtrl = 0x00040000,	/// value for the ctrl key, can be used as a modifier 
			keyMeta = 0x00080000,
			keyLMB = 0x00000100,	/// value for the left mouse button
			keyMMB	 = 0x00000200,	/// value for the middle mouse button
			keyRMB = 0x00000400,	/// value for the right mouse button
			keyWheel = 0x00000800,/// value for the mouse wheel
			keyLeft = 0x01000012,	/// value for the left cursor button
			keyUp = 0x01000013,		/// value for the up cursor button
			keyRight = 0x01000014,	/// value for the right cursor button
			keyDown = 0x01000015	/// value for the down cursor button
		};

	public:
		Action( void );
		~Action( void );

		/// This function should return the default hotkey for the action, which can be a combination of more than one values. For example: leyCtrl+'J'
		virtual int DefaultHotkey( void ) const;
		/// Returns true if the action is sticky, i.e. can be activated independently from other actions.
		virtual bool IsSticky( void ) const;

		/// This function is called when the action is activated, i.e. when the user pressed the hotkey.
		virtual void OnActivate( 
			bool bRepeat	///< [in] True if the Activation is not the initial, but is a result of a repeated keypress.
			);
		/// Called when the action is deactivated, i.e. the user released the hotkey.
		virtual void OnDeactivate( void );
		/// Called when the cursor is moved by the user while the action is active.
		virtual void OnCursorMove( 
			float fXPosition,	///< [in] Horizontal position of the cursor on the screen, between 0-1 (0 means the very left)
			float fYPosition,	///< [in] Vertical position of the cursor on the screen, between 0-1 (0 means top of the screen)
			float fXChange,	///< [in] Horizontal change of the cursor position.
			float fYChange	///< [in] Vertical change of the cursor position.
			);
		/// Called when the user requested to set options for this action.
		virtual void OnOptions( void );
	};
};

#endif

