|
///////////////////////////////////////////////////////////////
//
// Action.h
//
// Created: 12/07/2003
// Copyright (c) 2003 Ralph Hare (ralph.hare@ysgyfarnog.co.uk)
// All rights reserved.
//
// The code and information is provided "as-is" without
// warranty of any kind, either expressed or implied.
//
///////////////////////////////////////////////////////////////
#ifndef __ACTION_H_21079340_5F58_4393_8A85_D25E8FC7E73D_
#define __ACTION_H_21079340_5F58_4393_8A85_D25E8FC7E73D_
/**
* Structure to pass to each Action method describing
* the context of the action
**/
struct ActionPacket
{
HWND hWnd; /// < the window where the action was performed
POINT pt; /// < the first point of the action
ActionPacket( HWND hWnd_, const POINT &pt_ ) :
hWnd( hWnd_ ),
pt( pt_ )
{
}
};
/**
* Pure virtual base class describing the possible actions
* as a result of a mouse gesture. Each function must have the
* following signature:
*
* void FUNCTION( const ActionPacket & )
*
* @see GestureManager
**/
struct ActionBase
{
/// < Goto the previous page in the document history
virtual void GotoPrevious( const ActionPacket & ) = 0;
/// < Goto the next page in the document history
virtual void GotoNext( const ActionPacket & ) = 0;
/// < Goto IE's home page
virtual void GoHome( const ActionPacket & ) = 0;
/// < Scroll to the top of the active document
virtual void GotoTop( const ActionPacket & ) = 0;
/// < Scroll to the bottom of the active document
virtual void GotoBottom( const ActionPacket & ) = 0;
/// < Close the active web browser instance
virtual void Close( const ActionPacket & ) = 0;
/// < Open a new web browser instance in the foreground
virtual void OpenNewForeWindow( const ActionPacket & ) = 0;
/// < Open a new web browser instance in the background
virtual void OpenNewBackWindow( const ActionPacket & ) = 0;
/// < Refresh the active document
virtual void Refresh( const ActionPacket & ) = 0;
/// < Reload the active document
virtual void Reload( const ActionPacket & ) = 0;
/// < Minimise the active web browser
virtual void Minimise( const ActionPacket & ) = 0;
/// < Restore the active window to normal size
virtual void Restore( const ActionPacket & ) = 0;
/// < Create a new webbrowser open on the currently active page
virtual void Duplicate( const ActionPacket & ) = 0;
/// < Scroll through all the open web browser instances on this desktop
virtual void ScrollWindows( const ActionPacket & ) = 0;
};
typedef void ( ActionBase:: * ACTION )( const ActionPacket & );
namespace Action
{
/**
* Enumeration associating an unique indentifier with each
* gesture action
**/
enum ActionIndex
{
None = -1,
GotoPrevious = 0,
GotoNext,
GotoTop,
GotoBottom,
GoHome,
Close,
OpenNewForeWindow,
OpenNewBackWindow,
Refresh,
Reload,
Minimise,
Restore,
Duplicate,
ScrollWindows,
ACTION_COUNT = 14 /// < <b>MUST</b> be last item in enum
};
/**
* Retrieve a pointer to an array of ACTION's - the ownership of the
* array remains with the callee
**/
const ACTION * GetActionMap();
/**
* Retrieve the description of a given Action
**/
LPCTSTR GetDescription( ActionIndex action );
}
#endif // __ACTION_H_21079340_5F58_4393_8A85_D25E8FC7E73D_
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.