CharInput.h File Reference


Detailed Description

C-based text input system with C++ wrappers.

#include <ma.h>
#include "ListenerSet.h"
#include "Environment.h"

Namespaces

namespace  MAUtil

Classes

class  MAUtil::CharInputListener
class  MAUtil::CharInput
 A C++ wrapper for the text input system. More...

Defines

#define CI_MODE_CHAR_MODE_LOWERCASE   0
#define CI_MODE_CHAR_MODE_UPPERCASE   1
#define CI_MODE_CHAR_MODE_NUMBERS   2

Typedefs

typedef void(* CharInputCallback )(void)
typedef void(* StartTimerCallback )(CharInputCallback, int time)
typedef void(* StopTimerCallback )(void)
typedef void(* CharCallback )(char c, void *userData)

Functions

void CharInput_Reset (void)
void CharInput_Pressed (int keyCode)
void CharInput_Released (int keyCode)
void CharInput_RegisterTimerCallback (StartTimerCallback startCallback, StopTimerCallback stopCallback)
const char * CharInput_getCurrentCharList (void)
void CharInput_setUpperCaseMapElement (int index, const char *str)
void CharInput_setLowerCaseMapElement (int index, const char *str)
void CharInput_setNumMapElement (int index, char num)
int CharInput_getCurrentCharListIndex (void)
void CharInput_RegisterCharacterChangedCallback (CharCallback callback, void *userData)
void CharInput_RegisterCharacterDeployedCallback (CharCallback callback, void *userData)
void CharInput_ForceDeployment (void)
void CharInput_setMode (int charMode)
int CharInput_getMode (void)
void CharInput_setQwerty (int on)
int CharInput_getQwerty (void)


Define Documentation

#define CI_MODE_CHAR_MODE_LOWERCASE   0
 

Definitions for the different input modes.

#define CI_MODE_CHAR_MODE_UPPERCASE   1
 

#define CI_MODE_CHAR_MODE_NUMBERS   2
 


Typedef Documentation

typedef void(* CharInputCallback)(void)
 

The user must implement a StartTimerCallback and a StopTimerCallback. These are used so that the system can create a timer. When the timer has reached its timeout it must call the CharInputCallback passed to the StartTimerCallback.

typedef void(* StartTimerCallback)(CharInputCallback, int time)
 

The StartTimerCallback is used for starting the timer, the timer should call the argument CharInputCallback after time 'time'.

typedef void(* StopTimerCallback)(void)
 

The StopTimerCallback is used for stopping the timer.

typedef void(* CharCallback)(char c, void *userData)
 

This is a callback used to notify the user about character input updates.


Function Documentation

void CharInput_Reset void   ) 
 

Reset system.

void CharInput_Pressed int  keyCode  ) 
 

Notify the charinput system that a key has been pressed with the keycode 'keyCode'.

void CharInput_Released int  keyCode  ) 
 

Notify the charinput system that a key has been released with the keycode 'keyCode'.

void CharInput_RegisterTimerCallback StartTimerCallback  startCallback,
StopTimerCallback  stopCallback
 

This function is used to register the timer callbacks, these are used to be able to start and stop a system specific timer. The user should start a timer when the 'startCallback' is called and stop that timer if 'stopCallback' is called.

const char* CharInput_getCurrentCharList void   ) 
 

Use this to retrieve information about what chars can be currently selected.

void CharInput_setUpperCaseMapElement int  index,
const char *  str
 

str is just a null-terminated string containing the characters corresponding to that index.

void CharInput_setLowerCaseMapElement int  index,
const char *  str
 

void CharInput_setNumMapElement int  index,
char  num
 

num is the character for the number mode (i.e. the one you get if you do a long-press or

int CharInput_getCurrentCharListIndex void   ) 
 

Use this to get where in the list the current char is.

void CharInput_RegisterCharacterChangedCallback CharCallback  callback,
void *  userData
 

Use this function to register a callback that is called everytime a character change has happened.

void CharInput_RegisterCharacterDeployedCallback CharCallback  callback,
void *  userData
 

Use this function to register a callback that is called everytime a character has been deployed.

void CharInput_ForceDeployment void   ) 
 

force the currently selected character to be deployed.

void CharInput_setMode int  charMode  ) 
 

Set character input mode using one of the defines: CI_MODE_CHAR_MODE_LOWERCASE, CI_MODE_CHAR_MODE_UPPERCASE, CI_MODE_CHAR_MODE_NUMBERS.

int CharInput_getMode void   ) 
 

Get the character input mode.

void CharInput_setQwerty int  on  ) 
 

In standard mode, only the 0-9, # and * keys are used. This is suitable for devices with such keypads.

In qwerty mode, all keys are used. This is suitable for devices with qwerty keyboards.

int CharInput_getQwerty void   ) 
 

Get the qwerty mode.


Generated on Sat Feb 13 00:15:38 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO