HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DM_ModifierKeys Class Reference

Definition of a modifier key context. More...

#include <DM_ModifierKeys.h>

Public Member Functions

int findMatch (const UI_Event *event) const
 
bool match (const UI_Event *event, int modifier_id) const
 
void append (int modifier_id)
 
void append (int modifier_id, short modifier_key_flags)
 
void append (const DM_ModifierKeys &src_context)
 
void update ()
 Call after appending any modifier(s). More...
 
void clear ()
 
exint entries () const
 
bool resolveDescription (int modifier_id, UT_WorkBuffer &buffer) const
 

Static Public Member Functions

static int registerModifier (const char *modifier_token)
 
static int addModifier (const char *modifier_token, UT_Array< UT_StringHolder > const &key_assigments)
 
static void removeModifier (const char *modifier_token)
 Remove a modifier previously added with addModifier. More...
 

Detailed Description

Definition of a modifier key context.

A modifier key context consists of a list of modifier key states, each mapping to an integer identifier. A UI_Event can then be mapped to the appropriate identifier by its myAltFlags member.

Definition at line 33 of file DM_ModifierKeys.h.

Member Function Documentation

static int DM_ModifierKeys::addModifier ( const char *  modifier_token,
UT_Array< UT_StringHolder > const &  key_assigments 
)
static

Add and register a new modifier definition along with its assigment keys. Returns a new modifier id or -1 if the operation failed.

void DM_ModifierKeys::append ( int  modifier_id)

Append a modifier. The order these modifiers are appended is what determines their relative priorities. When modifier_key_flags is supplied, that value overrides any loaded from the configuration files.

TODO: Specify whether the modifier can be combined with other modifiers or must stand alone.

void DM_ModifierKeys::append ( int  modifier_id,
short  modifier_key_flags 
)
void DM_ModifierKeys::append ( const DM_ModifierKeys src_context)
void DM_ModifierKeys::clear ( )
inline

Definition at line 58 of file DM_ModifierKeys.h.

exint DM_ModifierKeys::entries ( ) const
inline

Definition at line 60 of file DM_ModifierKeys.h.

int DM_ModifierKeys::findMatch ( const UI_Event event) const

Returns the identifier for the modifier matching the event, if any. In the event of no matching modifier, a value of -1 is returned.

bool DM_ModifierKeys::match ( const UI_Event event,
int  modifier_id 
) const

Returns whether the event matches the specified modifier identifier. An event with multiple modifier keys set can match multiple modifier identifiers when the matched modifiers are proper subsets.

static int DM_ModifierKeys::registerModifier ( const char *  modifier_token)
static

Register a new modifier token and return the corresponding identifier to use in instances of this class.

static void DM_ModifierKeys::removeModifier ( const char *  modifier_token)
static

Remove a modifier previously added with addModifier.

bool DM_ModifierKeys::resolveDescription ( int  modifier_id,
UT_WorkBuffer buffer 
) const

Query the description string for the specified modifier. Returns false if the modifier is not found or is in conflict with a higher priority modifier.

void DM_ModifierKeys::update ( )

Call after appending any modifier(s).


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