com.mot.iden.t9
Class T9

java.lang.Object
  extended bycom.mot.iden.t9.T9

public class T9
extends java.lang.Object

The T9 object houses all the T9 state information for a native side instance of a T9FieldInfo struct. The T9 object allows the Java environment to make use of the smart text entry capabilities the native T9 engine affords.


MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
? Copyright 2001 Motorola, Inc. All Rights Reserved.


Field Summary
 byte[] auxKorean
          Korean information buffer.
static int CURSOR_CHANGE
          Used in our state change mask when a cursor change event occurs.
static int DECIMAL_MODE
          Used to put T9 in DECIMAL_MODE.
 int dwReserved
          Reserved bits used by native T9 engine.
 int dwStateBits
          Current State bits.
static int EMAIL_MODE
          Used to put T9 into email mode.
static int EVTCTRL
          The event ID used with control events to change the T9 engine's state.
static int EVTCURSOR
          The event ID used to set the cursor position.
static int EVTEXPL
          The event ID used when adding a character to the text buffer at the current cursor position.
static int EVTKEY
          The event ID used to when sending a key event.
static int EVTNONE
          T9 null event, no action performed on this event.
static int EVTSETLANG
          The event ID used to set a new language number.
static int EVTSYMTOKEY
          The event ID used to map a character to the ambiguous key it is identified with.
static int EVTTEXTKEY
          The event ID used when presetting the T9 text buffer with valid T9 words.
static int EVTUDBFENCE
          The event ID used to set the cutover point for mapping UDB words to a key sequence.
static int INTEGER_MODE
          Used to put T9 into integer mode.
 byte[] keyBuf
          Korean key stroke buffer.
static int KOREAN_SELECT_PAGE_CHANGE
          Used in our state change mask when the shift modifier has changed.
static int MAX_CHARACTERS
          The max amount of characters a T9 engine can hold.
 int nBufLen
          Length of current text.
 int nBufLenMax
          Maximum length of current text.
 int nCursor
          Current cursor position.
 int nLdbObjCnt
          Count of LDB objects for current key sequence.
static int NO_CHANGE
          Used in our state change mask to signify no change.
 int nObjNum
          Object number of word at cursor position.
 int nUdbFence
          Selection list start point for UDB words.
 int nUdbObjCnt
          Count of UDB objects for current key sequence.
 int nWordLen
          Length of word at current cursor position.
static int PASSWORD_MODE
          Used to put T9 into password mode.
static int PHONE_MODE
          Used to put T9 into phone mode.
 char[] psAuxBuf
          Shared auxillary key buffer only used in native.
 char[] psTxtBuf
          The main T9 text buffer holding the entered text.
 byte[] pT9Private
          Pointer to persistent memory for use by native T9 engine.
 char[] selectPage
          Korean character selection page.
static int SHIFT_CHANGE
          Used in our state change mask when the shift modifier has changed.
static int T9ARABIC_LANGUAGE
          A bit mask for setting T9 to hebrew.
static int T9CTRLADD
          Used to force the T9 engine to scan for new words to add to the user database.
static int T9CTRLCLRCAP
          Turns off CAPS lock.
static int T9CTRLCLRSHF
          Turns off SHIFT.
static int T9CTRLCLRSYM
          Reverts from Symbol mode to the previous entry mode.
static int T9CTRLSETCAP
          Turns on CAPS lock.
static int T9CTRLSETSHF
          Turns on SHIFT.
static int T9ENGLISH_LANGUAGE
          A bit mask for setting T9 to english.
static int T9EXTSPELL_MODE
          Used to force T9 into retrieving multitap symbols from the host.
static int T9FRENCH_LANGUAGE
          A bit mask for setting T9 to french.
static int T9HEBREW_LANGUAGE
          A bit mask for setting T9 to hebrew.
static int T9KEYRIGHT
          Right key event.
static int T9KOREAN_LANGUAGE
          A bit mask for setting T9 to korean.
static int T9KOREAN_SYLLABLE_MODE
          Used to put T9 into Korean syllable mode.
static int T9NUM_MODE
          Used to put T9 into numeric mode.
static int T9PORTUGUESE_LANGUAGE
          A bit mask for setting T9 to portuguese.
static int T9SPANISH_LANGUAGE
          A bit mask for setting T9 to spanish.
static int T9SPELL_MODE
          Used to put T9 into spell (multitap) mode.
static int T9SYM_MODE
          Used to put T9 into symbol mode.
static int T9WORD_MODE
          Used to put T9 into word mode.
static int URL_MODE
          Used to put T9 into URL mode.
 short wSymbolClass
          Symbol class of current LDB.
 
Constructor Summary
T9()
          Contructs an instance of T9 capable of holding the max amount of characters.
T9(int length)
          Contructs an instance of T9 capable of the specified amount of characters.
T9(int length, java.lang.String text)
          Contructs an instance of T9 capable of the specified amount of characters and preset with the specified text.
 
Method Summary
 void addWordToUDB()
          Add any new words in T9's text buffer to the UDB if UDB write is enabled.
 boolean autoCapsSentenceActive()
          Returns true if auto-caps sentence is on.
 boolean autoCapsWordActive()
          Returns true if auto-caps word is on.
 boolean capsActive()
          Used to determine if CAPS lock is on.
 void clearAutoCapsSentence()
          Turns off auto-caps sentence.
 void clearAutoCapsWord()
          Turns off auto-caps word.
 void clearCaps()
          Turns off CAPS lock.
 void clearShift()
          Turns off Shift mode.
 void deleteText(int start, int length)
          Deletes text up to given length starting at the specified location.
 int getCursorPosition()
          A helper method to return the current cursor position.
 java.lang.String getKoreanSelectPage()
          Get the string stored in the Korean selection page.
 int getKoreanSelectPageLength()
          Get the amount of characters currently in the Korean select page.
 int getKoreanSelectPageMax()
          Get the max amount of characters that can be held in the Korean select page.
 int getLanguage()
          A helper method to return the current language.
 int getMode()
          A helper method to return the current entry mode.
 java.lang.String getString()
          Returns the current text in the T9 engine.
 boolean getUDBWrite()
          Returns true if the UDB is writeable.
 int getWordLength()
          A helper method to return the current word length.
 void handleEvent(int mType, int eventID)
          Handles all T9 events.
 void handleKeyEvent(int eventID)
          Helper method for timer and key events.
 boolean insertActive()
          Used to determine if the T9 engine is currently disambiguating a multitapped character.
 void insertText(java.lang.String s, int index, boolean remove)
          Inserts the specified string to the T9 text buffer at the specified insertion point.
 boolean numActive()
          Used to determine if the current entry mode is Numeric mode.
 void setAutoCapsSentence()
          Turns on auto-caps sentence.
 void setAutoCapsWord()
          Turns on auto-caps word.
 void setCaps()
          Turns on CAPS lock.
 void setCursor(int curPosition)
          Sets the cursor position.
 void setLanguage(int language)
          Sets the current language for word disambiguation.
 void setMode(int mode)
          Set the entry mode.
 void setShift()
          Turns on Shift mode.
 void setT9Listener(T9Listener listener)
          Registers a T9Listener with this object for T9 state changes.
 void setText(java.lang.String str)
          Sets the text in the T9 engine to the specified String.
 void setUDBWrite(boolean write)
          Enables and disables UDB writeability.
 boolean shiftActive()
          Used to determine if SHIFT is on.
 boolean spellActive()
          Used to determine if the current entry mode is Spell (Multitap) mode.
static void T9Terminate(T9 t9)
          Native function to terminate this T9 engine.
 boolean wordActive()
          Used to determine if the current entry mode is Word mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVTNONE

public static final int EVTNONE
T9 null event, no action performed on this event.

See Also:
Constant Field Values

EVTSETLANG

public static final int EVTSETLANG
The event ID used to set a new language number. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EVTKEY

public static final int EVTKEY
The event ID used to when sending a key event. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EVTTEXTKEY

public static final int EVTTEXTKEY
The event ID used when presetting the T9 text buffer with valid T9 words. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EVTEXPL

public static final int EVTEXPL
The event ID used when adding a character to the text buffer at the current cursor position.

See Also:
Constant Field Values

EVTSYMTOKEY

public static final int EVTSYMTOKEY
The event ID used to map a character to the ambiguous key it is identified with. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EVTCTRL

public static final int EVTCTRL
The event ID used with control events to change the T9 engine's state. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EVTUDBFENCE

public static final int EVTUDBFENCE
The event ID used to set the cutover point for mapping UDB words to a key sequence. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EVTCURSOR

public static final int EVTCURSOR
The event ID used to set the cursor position. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

T9ENGLISH_LANGUAGE

public static final int T9ENGLISH_LANGUAGE
A bit mask for setting T9 to english.

See Also:
Constant Field Values

T9FRENCH_LANGUAGE

public static final int T9FRENCH_LANGUAGE
A bit mask for setting T9 to french.

See Also:
Constant Field Values

T9SPANISH_LANGUAGE

public static final int T9SPANISH_LANGUAGE
A bit mask for setting T9 to spanish.

See Also:
Constant Field Values

T9PORTUGUESE_LANGUAGE

public static final int T9PORTUGUESE_LANGUAGE
A bit mask for setting T9 to portuguese.

See Also:
Constant Field Values

T9KOREAN_LANGUAGE

public static final int T9KOREAN_LANGUAGE
A bit mask for setting T9 to korean.

See Also:
Constant Field Values

T9HEBREW_LANGUAGE

public static final int T9HEBREW_LANGUAGE
A bit mask for setting T9 to hebrew.

See Also:
Constant Field Values

T9ARABIC_LANGUAGE

public static final int T9ARABIC_LANGUAGE
A bit mask for setting T9 to hebrew.

See Also:
Constant Field Values

T9WORD_MODE

public static final int T9WORD_MODE
Used to put T9 into word mode.

See Also:
Constant Field Values

T9SYM_MODE

public static final int T9SYM_MODE
Used to put T9 into symbol mode.

See Also:
Constant Field Values

T9NUM_MODE

public static final int T9NUM_MODE
Used to put T9 into numeric mode.

See Also:
Constant Field Values

T9EXTSPELL_MODE

public static final int T9EXTSPELL_MODE
Used to force T9 into retrieving multitap symbols from the host.

See Also:
Constant Field Values

T9SPELL_MODE

public static final int T9SPELL_MODE
Used to put T9 into spell (multitap) mode. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

EMAIL_MODE

public static final int EMAIL_MODE
Used to put T9 into email mode.

See Also:
Constant Field Values

PASSWORD_MODE

public static final int PASSWORD_MODE
Used to put T9 into password mode.

See Also:
Constant Field Values

URL_MODE

public static final int URL_MODE
Used to put T9 into URL mode.

See Also:
Constant Field Values

INTEGER_MODE

public static final int INTEGER_MODE
Used to put T9 into integer mode.

See Also:
Constant Field Values

PHONE_MODE

public static final int PHONE_MODE
Used to put T9 into phone mode.

See Also:
Constant Field Values

DECIMAL_MODE

public static final int DECIMAL_MODE
Used to put T9 in DECIMAL_MODE.

See Also:
Constant Field Values

T9KOREAN_SYLLABLE_MODE

public static final int T9KOREAN_SYLLABLE_MODE
Used to put T9 into Korean syllable mode.

See Also:
Constant Field Values

T9CTRLADD

public static final int T9CTRLADD
Used to force the T9 engine to scan for new words to add to the user database. THIS VALUE IS DEPENDENT UPON WHICH T9 API VERSION IS USED!!!

See Also:
Constant Field Values

T9CTRLSETCAP

public static final int T9CTRLSETCAP
Turns on CAPS lock.

See Also:
Constant Field Values

T9CTRLCLRCAP

public static final int T9CTRLCLRCAP
Turns off CAPS lock.

See Also:
Constant Field Values

T9CTRLSETSHF

public static final int T9CTRLSETSHF
Turns on SHIFT.

See Also:
Constant Field Values

T9CTRLCLRSHF

public static final int T9CTRLCLRSHF
Turns off SHIFT.

See Also:
Constant Field Values

T9CTRLCLRSYM

public static final int T9CTRLCLRSYM
Reverts from Symbol mode to the previous entry mode.

See Also:
Constant Field Values

T9KEYRIGHT

public static final int T9KEYRIGHT
Right key event.

See Also:
Constant Field Values

NO_CHANGE

public static final int NO_CHANGE
Used in our state change mask to signify no change.

See Also:
Constant Field Values

SHIFT_CHANGE

public static final int SHIFT_CHANGE
Used in our state change mask when the shift modifier has changed.

See Also:
Constant Field Values

KOREAN_SELECT_PAGE_CHANGE

public static final int KOREAN_SELECT_PAGE_CHANGE
Used in our state change mask when the shift modifier has changed.

See Also:
Constant Field Values

CURSOR_CHANGE

public static final int CURSOR_CHANGE
Used in our state change mask when a cursor change event occurs.

See Also:
Constant Field Values

MAX_CHARACTERS

public static final int MAX_CHARACTERS
The max amount of characters a T9 engine can hold.

See Also:
Constant Field Values

selectPage

public char[] selectPage
Korean character selection page.


psTxtBuf

public char[] psTxtBuf
The main T9 text buffer holding the entered text.


psAuxBuf

public char[] psAuxBuf
Shared auxillary key buffer only used in native.


nBufLenMax

public int nBufLenMax
Maximum length of current text.


nBufLen

public int nBufLen
Length of current text.


nCursor

public int nCursor
Current cursor position.


nWordLen

public int nWordLen
Length of word at current cursor position.


nObjNum

public int nObjNum
Object number of word at cursor position.


wSymbolClass

public short wSymbolClass
Symbol class of current LDB.


nLdbObjCnt

public int nLdbObjCnt
Count of LDB objects for current key sequence.


nUdbObjCnt

public int nUdbObjCnt
Count of UDB objects for current key sequence.


nUdbFence

public int nUdbFence
Selection list start point for UDB words.


dwStateBits

public int dwStateBits
Current State bits.


pT9Private

public byte[] pT9Private
Pointer to persistent memory for use by native T9 engine.


dwReserved

public int dwReserved
Reserved bits used by native T9 engine.


auxKorean

public byte[] auxKorean
Korean information buffer.


keyBuf

public byte[] keyBuf
Korean key stroke buffer.

Constructor Detail

T9

public T9()
   throws T9Exception
Contructs an instance of T9 capable of holding the max amount of characters.

Throws:
T9Exception - if the T9 engine could not be started or on Gemini product

T9

public T9(int length)
   throws T9Exception
Contructs an instance of T9 capable of the specified amount of characters.

Parameters:
length - the maximum amount of characters capable of being held
Throws:
T9Exception - if the T9 engine could not be started or on Gemini product.

T9

public T9(int length,
          java.lang.String text)
   throws T9Exception
Contructs an instance of T9 capable of the specified amount of characters and preset with the specified text.

Parameters:
length - the maximum amount of characters capable of being held
text - the text to preset the T9 engine with
Throws:
T9Exception - if the T9 engine could not be started or on Gemini product.
Method Detail

handleEvent

public void handleEvent(int mType,
                        int eventID)
                 throws T9Exception
Handles all T9 events.

Parameters:
mType - the event type
eventID - logical key ID value, symbol value, logical control ID value, number of expired timer or parameter for various control events
Throws:
T9Exception - if the T9 engine could not handle the event or on Gemini product.

handleKeyEvent

public void handleKeyEvent(int eventID)
                    throws T9Exception
Helper method for timer and key events.

Parameters:
eventID - key ID value or timerout event ID value
Throws:
T9Exception - if the T9 engine could not handle the event or on Gemini product.

T9Terminate

public static final void T9Terminate(T9 t9)
                              throws T9Exception
Native function to terminate this T9 engine.

Parameters:
t9 - the instance to be terminated
Throws:
T9Exception - if the T9 engine could not properly terminate or on Gemini product.

getCursorPosition

public int getCursorPosition()
A helper method to return the current cursor position.

Returns:
an int specifying the current cursor position, 0 on Gemini product.

getWordLength

public int getWordLength()
A helper method to return the current word length.

Returns:
an int specifying the currently selected word length, 0 on Gemini product.

getMode

public int getMode()
A helper method to return the current entry mode.

Returns:
an int specifying the current entry mode, 0 on Gemini product.

getLanguage

public int getLanguage()
A helper method to return the current language.

Returns:
an int specifying the current language. 0 on gemini product.

setT9Listener

public void setT9Listener(T9Listener listener)
Registers a T9Listener with this object for T9 state changes.

Parameters:
listener - the listener registering for state changes, do nothing on Gemini product.

setCursor

public void setCursor(int curPosition)
Sets the cursor position.

Parameters:
curPosition - the cursor position to set, do nothing on Gemini product.

setLanguage

public void setLanguage(int language)
                 throws T9Exception
Sets the current language for word disambiguation.

Parameters:
language - the ID of the desired language
Throws:
T9Exception - if the specified language cannot be set or on Gemini product

setMode

public void setMode(int mode)
             throws T9Exception
Set the entry mode.

Parameters:
mode - the mode to be set
Throws:
T9Exception - if the entry mode cannot be set or on Gemini product

setCaps

public void setCaps()
             throws T9Exception
Turns on CAPS lock.

Throws:
T9Exception - if CAPS lock cannot be turned on or on Gemini product.

clearCaps

public void clearCaps()
               throws T9Exception
Turns off CAPS lock.

Throws:
T9Exception - if CAPS lock cannot be turned off or on Gemini product.

insertActive

public boolean insertActive()
Used to determine if the T9 engine is currently disambiguating a multitapped character.

Returns:
true if currently disambiguating a multitapped character, false for otherwise or on Gemini product.

capsActive

public boolean capsActive()
Used to determine if CAPS lock is on.

Returns:
true if CAPS lock is on, false otherwise or on Gemini product.

shiftActive

public boolean shiftActive()
Used to determine if SHIFT is on.

Returns:
true if SHIFT is on, false otherwise or on Gemini product.

wordActive

public boolean wordActive()
Used to determine if the current entry mode is Word mode.

Returns:
true if the current entry mode is Word mode, false otherwise or on Gemini product.

spellActive

public boolean spellActive()
Used to determine if the current entry mode is Spell (Multitap) mode.

Returns:
true if the current entry mode is Spell mode, false otherwise or Gemini product.

numActive

public boolean numActive()
Used to determine if the current entry mode is Numeric mode.

Returns:
true if the current entry mode is Numeric mode, false otherwise or on Gemini product.

getString

public java.lang.String getString()
Returns the current text in the T9 engine.

Returns:
the current text in the T9 engine as a String, null will return on Gemini product.

getKoreanSelectPage

public java.lang.String getKoreanSelectPage()
Get the string stored in the Korean selection page.

Returns:
a string containing the characters in the Korean selection page or null if the page is empty or on Gemini product.

getKoreanSelectPageMax

public int getKoreanSelectPageMax()
Get the max amount of characters that can be held in the Korean select page.

Returns:
maximum amount of characters in the Korean select page. 0 on Gemini product.

getKoreanSelectPageLength

public int getKoreanSelectPageLength()
Get the amount of characters currently in the Korean select page.

Returns:
amount of characters in Korean select page. 0 on Gemini product.

setShift

public void setShift()
              throws T9Exception
Turns on Shift mode.

Throws:
T9Exception - if Shift mode cannot be turned on or on Gemini product

clearShift

public void clearShift()
                throws T9Exception
Turns off Shift mode.

Throws:
T9Exception - if Shift mode cannot be turned on or on Gemini product.

setAutoCapsSentence

public void setAutoCapsSentence()
Turns on auto-caps sentence. Nothing happens on Gemini product.


setAutoCapsWord

public void setAutoCapsWord()
Turns on auto-caps word. Nothing happens on Gemini product.


clearAutoCapsSentence

public void clearAutoCapsSentence()
Turns off auto-caps sentence. Nothing happens on Gemini product.


clearAutoCapsWord

public void clearAutoCapsWord()
Turns off auto-caps word. Nothing happens on Gemini product.


autoCapsSentenceActive

public boolean autoCapsSentenceActive()
Returns true if auto-caps sentence is on.

Returns:
true if auto-caps sentence is on

autoCapsWordActive

public boolean autoCapsWordActive()
Returns true if auto-caps word is on.

Returns:
true if auto-caps word is on, always false on Gemini product.

setUDBWrite

public void setUDBWrite(boolean write)
Enables and disables UDB writeability. Nothing happens on Gemini product.


getUDBWrite

public boolean getUDBWrite()
Returns true if the UDB is writeable.

Returns:
true if the UDB is writeable, false otherwise or on Gemini product.

addWordToUDB

public void addWordToUDB()
                  throws T9Exception
Add any new words in T9's text buffer to the UDB if UDB write is enabled.

Throws:
T9Exception

setText

public void setText(java.lang.String str)
             throws T9Exception
Sets the text in the T9 engine to the specified String.

Parameters:
str - the String to preset the engine with
Throws:
T9Exception - if the String cannot be set or on Gemini product

insertText

public void insertText(java.lang.String s,
                       int index,
                       boolean remove)
                throws T9Exception
Inserts the specified string to the T9 text buffer at the specified insertion point. If desired any resulting overflow text can be removed from the buffer, otherwise the new text will be truncated.

Parameters:
s - the string to be inserted
index - insertion location
remove - if true, overflow text is removed
Throws:
T9Exception

deleteText

public void deleteText(int start,
                       int length)
Deletes text up to given length starting at the specified location. Nothing happens on Gemini product.

Parameters:
start - deletion start location
length - amount of text to be removed