Planeshift
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

psMouseBinds Class Reference

psMouseBinds holds set of psMouseAction More...

#include <psmousebinds.h>

List of all members.

Public Member Functions

void Bind (const csString &action, csMouseEventData &event)
 Binds a mouse event to an action.
void Bind (const csString &action, csString &event, csString &ctrl)
void Bind (const csString &action, int button, int modifier)
bool CheckBind (const csString &action, int button, int modifiers)
 Checks if a specific bind matches the given button and modifiers.
bool GetBind (const csString &action, csMouseEventData &event)
 Gets the mouse event that triggers the specified action.
bool GetBind (const csString &action, csString &button)
bool GetInt (const csString &option, csString &value)
 Gets the integer value of the specified option.
bool GetInt (const csString &option, int &value)
bool GetOnOff (const csString &option, csString &value)
 Gets the boolean value of the specified option.
bool GetOnOff (const csString &option, bool &value)
bool LoadFromFile (iObjectRegistry *object_reg, const csString &filename)
 Loads the mouse actions from a file.
 psMouseBinds ()
void RemoveInt (const csString &option)
 Removes an int option.
void RemoveOnOff (const csString &option)
 Removes an OnOff option.
bool SaveToFile (iObjectRegistry *object_reg, const csString &filename)
 Saves the mouse actions to a file.
void SetInt (const csString &option, csString &value)
 Sets the integer setting of the specified option.
void SetInt (const csString &option, int value)
void SetOnOff (const csString &option, csString &value)
 Sets the boolean setting of the specified option.
void SetOnOff (const csString &option, bool value)
void Unbind (const csString &action)
 Removes an action.
void UnbindAll ()
 Removes all actions/options.

Static Public Member Functions

static csString MouseButtonToString (uint button, uint32 modifiers)
static bool StringToMouseButton (const csString &str, uint &button, uint32 &modifiers)

Protected Member Functions

psMouseBindFindAction (const csString &action)
 Finds the action in the list.
psMouseIntFindInt (const csString &option)
 Finds the int option in the list.
psMouseOnOffFindOnOff (const csString &option)
 Finds the OnOff option in the list.

Protected Attributes

csPDelArray< psMouseBindbinds
 list of the binds
csPDelArray< psMouseOnOffboolOptions
csPDelArray< psMouseIntintOptions

Detailed Description

psMouseBinds holds set of psMouseAction

Definition at line 64 of file psmousebinds.h.


Constructor & Destructor Documentation

psMouseBinds::psMouseBinds ( ) [inline]

Definition at line 67 of file psmousebinds.h.


Member Function Documentation

void psMouseBinds::Bind ( const csString &  action,
csMouseEventData &  event 
)

Binds a mouse event to an action.

Parameters:
actionthe action that will be bound
eventthe mouse event that will trigger the action
void psMouseBinds::Bind ( const csString &  action,
csString &  event,
csString &  ctrl 
)
void psMouseBinds::Bind ( const csString &  action,
int  button,
int  modifier 
)
bool psMouseBinds::CheckBind ( const csString &  action,
int  button,
int  modifiers 
)

Checks if a specific bind matches the given button and modifiers.

Parameters:
actionthe action to query.
buttonthe button that you want to check against.
modifiersthe modifiers that you want to check against.
Returns:
true if the action matches the given button and modifiers.
psMouseBind* psMouseBinds::FindAction ( const csString &  action) [protected]

Finds the action in the list.

Parameters:
actionthe action to search for
Returns:
NULL iterator if action isn't found
psMouseInt* psMouseBinds::FindInt ( const csString &  option) [protected]

Finds the int option in the list.

Parameters:
optionthe option to search for
Returns:
NULL iterator if option isn't found
psMouseOnOff* psMouseBinds::FindOnOff ( const csString &  option) [protected]

Finds the OnOff option in the list.

Parameters:
optionthe option to search for
Returns:
NULL iterator if option isn't found
bool psMouseBinds::GetBind ( const csString &  action,
csMouseEventData &  event 
)

Gets the mouse event that triggers the specified action.

Parameters:
actionthe action to query
eventa variable that will hold the event
Returns:
true if the action was found
bool psMouseBinds::GetBind ( const csString &  action,
csString &  button 
)
bool psMouseBinds::GetInt ( const csString &  option,
int value 
)
bool psMouseBinds::GetInt ( const csString &  option,
csString &  value 
)

Gets the integer value of the specified option.

Parameters:
optionthe option to query
valuea variable that will hold the option value
Returns:
true if the option was found
bool psMouseBinds::GetOnOff ( const csString &  option,
csString &  value 
)

Gets the boolean value of the specified option.

Parameters:
optionthe option to query
valuea variable that will hold the option value
Returns:
true if the option was found
bool psMouseBinds::GetOnOff ( const csString &  option,
bool &  value 
)
bool psMouseBinds::LoadFromFile ( iObjectRegistry *  object_reg,
const csString &  filename 
)

Loads the mouse actions from a file.

Parameters:
object_regThe object registry
filenamethe vfs filename and path
Returns:
true on success
static csString psMouseBinds::MouseButtonToString ( uint  button,
uint32  modifiers 
) [static]
void psMouseBinds::RemoveInt ( const csString &  option)

Removes an int option.

Parameters:
optionthe option to remove
void psMouseBinds::RemoveOnOff ( const csString &  option)

Removes an OnOff option.

Parameters:
optionthe option to remove
bool psMouseBinds::SaveToFile ( iObjectRegistry *  object_reg,
const csString &  filename 
)

Saves the mouse actions to a file.

Parameters:
object_regThe object registry
filenamethe vfs filename and path
Returns:
true on success
void psMouseBinds::SetInt ( const csString &  option,
int  value 
)
void psMouseBinds::SetInt ( const csString &  option,
csString &  value 
)

Sets the integer setting of the specified option.

Parameters:
optionthe name of the option to set
valuethe value to set the option to
void psMouseBinds::SetOnOff ( const csString &  option,
csString &  value 
)

Sets the boolean setting of the specified option.

Parameters:
optionthe name of the option to set
valuethe value to set the option to
void psMouseBinds::SetOnOff ( const csString &  option,
bool  value 
)
static bool psMouseBinds::StringToMouseButton ( const csString &  str,
uint &  button,
uint32 &  modifiers 
) [static]
void psMouseBinds::Unbind ( const csString &  action)

Removes an action.

Parameters:
actionthe action to remove
void psMouseBinds::UnbindAll ( )

Removes all actions/options.


Member Data Documentation

csPDelArray<psMouseBind> psMouseBinds::binds [protected]

list of the binds

Definition at line 225 of file psmousebinds.h.

csPDelArray<psMouseOnOff> psMouseBinds::boolOptions [protected]

Definition at line 226 of file psmousebinds.h.

csPDelArray<psMouseInt> psMouseBinds::intOptions [protected]

Definition at line 227 of file psmousebinds.h.


The documentation for this class was generated from the following file: