📄 aeetext.h
字号:
#ifndef AEETEXT_H
#define AEETEXT_H
/*=====================================================================
FILE: AEEText.h
SERVICES: AEE Text Control Interface
DESCRIPTION: Base level definitions, typedefs, etc. for AEE Text Control
PUBLIC CLASSES: Not Applicable
INITIALIZATION AND SEQUENCING REQUIREMENTS: Not Applicable
Copyright ?1999-2002 QUALCOMM Incorporated.
All Rights Reserved.
QUALCOMM Proprietary/GTDR
=====================================================================*/
//---------------------------------------------------------------------
// Include Files
//---------------------------------------------------------------------
#include "AEE.h"
#include "AEEMenu.h"
//---------------------------------------------------------------------
// Type Declarations
//---------------------------------------------------------------------
typedef struct _ITextCtl ITextCtl;
#define TP_FRAME 0x00010000
#define TP_MULTILINE 0x00020000
//#define TP_ 0x00040000 // Placeholder: Future Property Here
#define TP_RAPID_MODE 0x00080000 // Supports Rapid Entry and uses as default
#define TP_NODRAW 0x00100000 // Disables all drawing by the control
#define TP_NOUPDATE 0x00200000 // Disables wasteful IDISPLAY_Update calls
#define TP_PASSWORD 0x00400000 // Displays ***, manages correct buffer chars
#define TP_INTEGRALHEIGHT 0x00800000
#define TP_FIXSETRECT 0x80000000 // Actual height more closely represents requested height.
#define TP_FIXOEM 0x40000000 // Fixes control content bugs related to OEM implementation
#define TP_FOCUS_NOSEL 0x20000000 // Act like TextCtl 1, do not alter selection on activation
#define TP_OLD_MT_CHARS 0x10000000 // Sets the AEE_TM_LETTERS to use same symbols as TextCtl 1
#define TP_OVERWRITE 0x01000000 // Sets the AEE_TM_DIALED_DIGITS mode to overwrite wildcard chars
#define TP_FONTMORPH 0x02000000 // Sets the AEE_TM_DIALED_DIGITS mode to morph text from large to small
#define TP_AUTOHYPHEN 0x04000000 // Sets the AEE_TM_DIALED_DIGITS mode to auto hyphen the string
#define TP_T9_MODE (TP_RAPID_MODE)
// Placeholder: Extended Text Properties
//#define TP_EX_
#define MAX_TEXT_MODE_SIZE 15 // Maximum text mode name size
// Pre-Defined Text Modes - For use with ITEXTCTL_SetMode
#define AEE_TM_NONE 0x0000
#define AEE_TM_CURRENT 0x0001
#define AEE_TM_SYMBOLS 0x0002
#define AEE_TM_LETTERS 0x0003
#define AEE_TM_RAPID 0x0004
#define AEE_TM_NUMBERS 0x0005
#define AEE_TM_KANJI 0x0006 // Japanese Input
#define AEE_TM_HANKAKU_KANA 0x0007 // Japanese Input
#define AEE_TM_HANGUL 0x0008 // Korean Input
#define AEE_TM_PINYIN 0x0009 // Chinese Input
#define AEE_TM_STROKE 0x000A // Chinese Input
#define AEE_TM_EZTEXT 0x000B // Zi's Predictive Entry
#define AEE_TM_T9 0x000C // Tegic's Predictive Entry
#define AEE_TM_ARABIC 0x000D // Arabic standard mode
#define AEE_TM_ARABIC_R 0x000E // Arabic rapid mode
#define AEE_TM_HEBREW 0x000F // Hebrew standard mode
#define AEE_TM_HEBREW_R 0x0010 // Hebrew rapid mode
#define AEE_TM_CROATIAN 0x0011 // Croatian standard mode
#define AEE_TM_CROATIAN_R 0x0012 // Croatian rapid mode
#define AEE_TM_CZECH 0x0013 // Czech standard mode
#define AEE_TM_CZECH_R 0x0014 // Czech rapid mode
#define AEE_TM_HUNGARIAN 0x0015 // Hungarian standard mode
#define AEE_TM_HUNGARIAN_R 0x0016 // Hungarian rapid mode
#define AEE_TM_ROMANIAN 0x0017 // Romanian standard mode
#define AEE_TM_ROMANIAN_R 0x0018 // Romanian rapid mode
#define AEE_TM_RUSSIAN 0x0019 // Russian standard mode
#define AEE_TM_RUSSIAN_R 0x001A // Russian rapid mode
#define AEE_TM_SERBIAN 0x001B // Serbian standard mode
#define AEE_TM_SERBIAN_R 0x001C // Serbian rapid mode
#define AEE_TM_SLOVAK 0x001D // Slovak standard mode
#define AEE_TM_SLOVAK_R 0x001E // Slovak rapid mode
#define AEE_TM_SLOVENIAN 0x001F // Slovenian standard mode
#define AEE_TM_SLOVENIAN_R 0x0020 // Slovenian rapid mode
#define AEE_TM_TURKISH 0x0021 // Turkish standard mode
#define AEE_TM_TURKISH_R 0x0022 // Turkish rapid mode
#define AEE_TM_UKRAINIAN 0x0023 // Ukrainian standard mode
#define AEE_TM_UKRAINIAN_R 0x0024 // Ukrainian rapid mode
#define AEE_TM_DANISH 0x0024 // Danish standard mode
#define AEE_TM_DANISH_R 0x0026 // Danish rapid mode
#define AEE_TM_DUTCH 0x0027 // Dutch standard mode
#define AEE_TM_DUTCH_R 0x0028 // Dutch rapid mode
#define AEE_TM_FINNISH 0x0029 // Finnish standard mode
#define AEE_TM_FINNISH_R 0x002A // Finnish rapid mode
#define AEE_TM_FRENCH_EU 0x002B // European French standard mode
#define AEE_TM_FRENCH_EU_R 0x002C // European French rapid mode
#define AEE_TM_GERMAN 0x002D // German standard mode
#define AEE_TM_GERMAN_R 0x002E // German rapid mode
#define AEE_TM_GREEK 0x002F // Greek standard mode
#define AEE_TM_GREEK_R 0x0030 // Greek rapid mode
#define AEE_TM_ITALIAN 0x0031 // Italian standard mode
#define AEE_TM_ITALIAN_R 0x0032 // Italian rapid mode
#define AEE_TM_NORWEGIAN 0x0033 // Norwegian standard mode
#define AEE_TM_NORWEGIAN_R 0x0034 // Norwegian rapid mode
#define AEE_TM_POLISH 0x0035 // Polish standard mode
#define AEE_TM_POLISH_R 0x0036 // Polish rapid mode
#define AEE_TM_PORTUGUESE_EU 0x0037 // European Portuguese standard mode
#define AEE_TM_PORTUGUESE_EU_R 0x0038 // European Portuguese rapid mode
#define AEE_TM_SPANISH_EU 0x0039 // European Spanish standard mode
#define AEE_TM_SPANISH_EU_R 0x003A // European Spanish rapid mode
#define AEE_TM_SWEDISH 0x003B // Swedish standard mode
#define AEE_TM_SWEDISH_R 0x003C // Swedish rapid mode
#define AEE_TM_INDONESIAN 0x003D // Indonesian standard mode
#define AEE_TM_INDONESIAN_R 0x003E // Indonesian rapid mode
#define AEE_TM_MALAY 0x003F // Malay standard mode
#define AEE_TM_MALAY_R 0x0040 // Malay rapid mode
#define AEE_TM_TAGALOG 0x0041 // Tagalog standard mode
#define AEE_TM_TAGALOG_R 0x0042 // Tagalog rapid mode
#define AEE_TM_THAI 0x0043 // Thai standard mode
#define AEE_TM_THAI_R 0x0044 // Thai rapid mode
#define AEE_TM_VIETNAMESE 0x0045 // Vietnamese standard mode
#define AEE_TM_VIETNAMESE_R 0x0046 // Vietnamese rapid mode
#define AEE_TM_FRENCH_CA 0x0047 // Canadian French standard mode
#define AEE_TM_FRENCH_CA_R 0x0048 // Canadian French rapid mode
#define AEE_TM_PORTUGUESE_BR 0x0049 // Brasilian Portuguese standard mode
#define AEE_TM_PORTUGUESE_BR_R 0x004A // Brasilian Portuguese rapid mode
#define AEE_TM_SPANISH_LA 0x004B // Latin America Spanish standard mode
#define AEE_TM_SPANISH_LA_R 0x004C // Latin America Spanish rapid mode
#define AEE_TM_DIALED_DIGITS 0x004D // Dialed Digits mode
#define AEE_TM_ENGLISH_UK_R 0x004E // UK English rapid mode
#define AEE_TM_ENGLISH_US 0x004F // US English standard mode
#define AEE_TM_ENGLISH_US_R 0x0050 // US English rapid mode
#define AEE_TM_ENGLISH_UK 0x0051 // UK English standard mode
#define AEE_TM_HINDI 0x0052 // Hindi standard mode
#define AEE_TM_HINDI_R 0x0053 // Hindi rapid mode
#define AEE_TM_MAX AEE_TM_HINDI_R
#define AEE_TM_USER AEE_TM_MAX + 1
#define AEE_TM_FIRST_OEM AEE_TM_USER // OEM added modes should start at this value
#define AEE_TM_RESERVED 0x7000 // 0x7000 and up are reserved for BREW
#define AEE_TM_RESERVE_LAST AEE_TM_RESERVED
typedef int AEETextInputMode;
typedef struct _AEETextInputModeInfo
{
AEETextInputMode tmMode;
AECHAR modeString[MAX_TEXT_MODE_SIZE];
} AEETextInputModeInfo;
// Defines for cursor position
#define TC_CURSOREND 0x7FFFFFFF
#define TC_CURSORSTART 0
// Defines for selection region
#define TC_SEL_START 0x0000
#define TC_SEL_END 0xFFFF
// Macros for selection region
#define TC_SEL_GET_START(dw) (uint16)((dw)&0xFFFF)
#define TC_SEL_GET_END(dw) (uint16)(((dw)>>16)&0xFFFF)
#define TC_MAKE_SEL(s,e) (((uint32)((e)&0xFFFF)<<16) | (((uint32)(s))&0xFFFF))
//---------------------------------------------------------------------
// Global Constant Declarations
//---------------------------------------------------------------------
//---------------------------------------------------------------------
// Global Data Declarations
//---------------------------------------------------------------------
//=====================================================================
// FUNCTION DECLARATIONS AND INLINE FUNCTION DEFINITIONS
//=====================================================================
//---------------------------------------------------------------------
// ITextCtl Interface
//---------------------------------------------------------------------
QINTERFACE(ITextCtl)
{
DECLARE_IBASE(ITextCtl)
DECLARE_ICONTROL(ITextCtl)
boolean (*SetTitle)(ITextCtl * pITextCtl, const char * pszResFile, uint16 wResID, AECHAR * pText);
boolean (*SetText)(ITextCtl * pITextCtl, const AECHAR * psz, int cch);
boolean (*GetText)(ITextCtl * pITextCtl, AECHAR * pBuffer, int nMaxChars);
AECHAR * (*GetTextPtr)(ITextCtl * pITextCtl);
void (*EnableCommand)(ITextCtl * pITextCtl, boolean bEnable, uint16 nCmdId);
void (*SetMaxSize)(ITextCtl * pITextCtl, uint16 nMaxSize);
void (*SetSoftKeyMenu)(ITextCtl * pITextCtl, IMenuCtl * pm);
AEETextInputMode (*SetInputMode)(ITextCtl * po, AEETextInputMode m);
int32 (*GetCursorPos)(ITextCtl *po);
void (*SetCursorPos)(ITextCtl *po, int32 nOffset);
AEETextInputMode (*GetInputMode)(ITextCtl *po, AEETextInputModeInfo * pmInfo);
void (*EnumModeInit)(ITextCtl *po);
AEETextInputMode (*EnumNextMode)(ITextCtl *po, AEETextInputModeInfo * pmInfo);
// Text Control 2 API, BREW 3.1.3 and higher
void (*SetSelection)(ITextCtl *po, uint32 dwSel);
uint32 (*GetSelection)(ITextCtl *po);
void (*SetPropertiesEx)(ITextCtl *po, uint32 dwPropsEx);
uint32 (*GetPropertiesEx)(ITextCtl *po);
};
//---------------------------------------------------------------------
// Access Macros
//---------------------------------------------------------------------
#define ITEXTCTL_AddRef(p) GET_PVTBL((p),ITextCtl)->AddRef((p))
#define ITEXTCTL_Release(p) GET_PVTBL((p),ITextCtl)->Release((p))
#define ITEXTCTL_HandleEvent(p,ec,wp,dw) GET_PVTBL((p),ITextCtl)->HandleEvent((p),(ec),(wp),(dw))
#define ITEXTCTL_Redraw(p) GET_PVTBL((p),ITextCtl)->Redraw((p))
#define ITEXTCTL_SetActive(p,b) GET_PVTBL((p),ITextCtl)->SetActive((p),(b))
#define ITEXTCTL_IsActive(p) GET_PVTBL((p),ITextCtl)->IsActive((p))
#define ITEXTCTL_SetRect(p,prc) GET_PVTBL((p),ITextCtl)->SetRect((p),(prc))
#define ITEXTCTL_GetRect(p,prc) GET_PVTBL((p),ITextCtl)->GetRect((p),(prc))
#define ITEXTCTL_SetProperties(p,props) GET_PVTBL((p),ITextCtl)->SetProperties((p),(props))
#define ITEXTCTL_GetProperties(p) GET_PVTBL((p),ITextCtl)->GetProperties((p))
#define ITEXTCTL_Reset(p) GET_PVTBL((p),ITextCtl)->Reset((p))
#define ITEXTCTL_SetTitle(p,pr,rid,pt) GET_PVTBL((p),ITextCtl)->SetTitle((p),(pr),(rid),(pt))
#define ITEXTCTL_SetText(p,psz,cch) GET_PVTBL((p),ITextCtl)->SetText((p),(psz),(cch))
#define ITEXTCTL_GetText(p,pbuf,max) GET_PVTBL((p),ITextCtl)->GetText((p),(pbuf),(max))
#define ITEXTCTL_GetTextPtr(p) GET_PVTBL((p),ITextCtl)->GetTextPtr((p))
#define ITEXTCTL_EnableCommand(p,ben,id) GET_PVTBL((p),ITextCtl)->EnableCommand((p),(ben),(id))
#define ITEXTCTL_SetMaxSize(p,s) GET_PVTBL((p),ITextCtl)->SetMaxSize((p),(s))
#define ITEXTCTL_SetSoftKeyMenu(p,pm) GET_PVTBL((p),ITextCtl)->SetSoftKeyMenu((p),(pm))
#define ITEXTCTL_SetInputMode(p,m) GET_PVTBL((p),ITextCtl)->SetInputMode((p),(m))
#define ITEXTCTL_GetCursorPos(p) GET_PVTBL((p),ITextCtl)->GetCursorPos((p))
#define ITEXTCTL_SetCursorPos(p,n) GET_PVTBL((p),ITextCtl)->SetCursorPos((p),(n))
#define ITEXTCTL_GetInputMode(p,m) GET_PVTBL((p),ITextCtl)->GetInputMode((p),(m))
#define ITEXTCTL_EnumModeInit(p) GET_PVTBL((p),ITextCtl)->EnumModeInit((p))
#define ITEXTCTL_EnumNextMode(p,i) GET_PVTBL((p),ITextCtl)->EnumNextMode((p),(i))
// Text Control 2 API, BREW 3.1.3 and higher
#define ITEXTCTL_SetSelection(p,n) GET_PVTBL((p),ITextCtl)->SetSelection((p),(n))
#define ITEXTCTL_GetSelection(p) GET_PVTBL((p),ITextCtl)->GetSelection((p))
#define ITEXTCTL_SetPropertiesEx(p,props) GET_PVTBL((p),ITextCtl)->SetProperties((p),(props))
#define ITEXTCTL_GetPropertiesEx(p) GET_PVTBL((p),ITextCtl)->GetProperties((p))
#endif // AEETEXT_H
/*============================================================================
DATA STRUCTURE DOCUMENTATION
==============================================================================
AEETextInputMode
Description:
This enumerated type specifies the text-entry modes that can be used to enter text
into a text control. The function ITEXTCTL_SetInputMode() is used to select the
input mode that is used for a particular text control instance.
Definition:
typedef enum
{
AEE_TM_NONE,
AEE_TM_CURRENT,
AEE_TM_SYMBOLS,
AEE_TM_LETTERS,
AEE_TM_RAPID,
AEE_TM_NUMBERS,
AEE_TM_KANJI,
AEE_TM_HANKAKU_KANA,
AEE_TM_HANGUL,
AEE_TM_PINYIN,
AEE_TM_STROKE,
AEE_TM_EZTEXT,
AEE_TM_T9,
AEE_TM_ARABIC,
AEE_TM_ARABIC_R,
AEE_TM_HEBREW,
AEE_TM_HEBREW_R,
AEE_TM_CROATIAN,
AEE_TM_CROATIAN_R,
AEE_TM_CZECH,
AEE_TM_CZECH_R,
AEE_TM_HUNGARIAN,
AEE_TM_HUNGARIAN_R,
AEE_TM_ROMANIAN,
AEE_TM_ROMANIAN_R,
AEE_TM_RUSSIAN,
AEE_TM_RUSSIAN_R,
AEE_TM_SERBIAN,
AEE_TM_SERBIAN_R,
AEE_TM_SLOVAK,
AEE_TM_SLOVAK_R,
AEE_TM_SLOVENIAN,
AEE_TM_SLOVENIAN_R,
AEE_TM_TURKISH,
AEE_TM_TURKISH_R,
AEE_TM_UKRAINIAN,
AEE_TM_UKRAINIAN_R,
AEE_TM_DANISH,
AEE_TM_DANISH_R,
AEE_TM_DUTCH,
AEE_TM_DUTCH_R,
AEE_TM_FINNISH,
AEE_TM_FINNISH_R,
AEE_TM_FRENCH_EU,
AEE_TM_FRENCH_EU_R,
AEE_TM_GERMAN,
AEE_TM_GERMAN_R,
AEE_TM_GREEK,
AEE_TM_GREEK_R,
AEE_TM_ITALIAN,
AEE_TM_ITALIAN_R,
AEE_TM_NORWEGIAN,
AEE_TM_NORWEGIAN_R,
AEE_TM_POLISH,
AEE_TM_POLISH_R,
AEE_TM_PORTUGUESE_EU,
AEE_TM_PORTUGUESE_EU_R,
AEE_TM_SPANISH_EU,
AEE_TM_SPANISH_EU_R,
AEE_TM_SWEDISH,
AEE_TM_SWEDISH_R,
AEE_TM_INDONESIAN,
AEE_TM_INDONESIAN_R,
AEE_TM_MALAY,
AEE_TM_MALAY_R,
AEE_TM_TAGALOG,
AEE_TM_TAGALOG_R,
AEE_TM_THAI,
AEE_TM_THAI_R,
AEE_TM_VIETNAMESE,
AEE_TM_VIETNAMESE_R,
AEE_TM_FRENCH_CA,
AEE_TM_FRENCH_CA_R,
AEE_TM_PORTUGUESE_BR,
AEE_TM_PORTUGUESE_BR_R,
AEE_TM_SPANISH_LA,
AEE_TM_SPANISH_LA_R,
AEE_TM_DIALED_DIGITS,
AEE_TM_ENGLISH_UK_R,
AEE_TM_ENGLISH_US,
AEE_TM_ENGLISH_US_R
AEE_TM_ENGLISH_UK,
} AEETextInputMode;
Members:
AEE_TM_NONE: No input mode is currently specified. The default mode is Multitap.
AEE_TM_CURRENT: Designates the currently active input mode.
AEE_TM_SYMBOLS: Key presses will enter the special symbol (if any) associated with
each key.
AEE_TM_LETTERS: Key presses will enter the letter of the alphabet associated with
each key.
AEE_TM_RAPID: Rapid (T9) mode will be used.
AEE_TM_NUMBERS: Key presses will enter the number associated with each key.
AEE_TM_KANJI: Key presses will enter Japanese Kanji characters.
AEE_TM_HANKAKU_KANA: Key presses will enter Japanese Kana characters.
AEE_TM_HANGUL: Key presses will enter Korean Hangul characters.
AEE_TM_PINYIN: Key presses will enter Chinese characters (Pin-Yin method).
AEE_TM_STROKE: Key presses will enter Chinese characters (Stroke method).
AEE_TM_EZTEXT: Zi EzText(R) mode will be used.
AEE_TM_T9: Tegic T9(R) mode will be used.
AEE_TM_ARABIC: Key presses will enter Arabic characters as like multitap
AEE_TM_ARABIC_R: Key presses will enter Arabic characters as like rapid text entry
AEE_TM_HEBREW: Key presses will enter Hebrew characters as like multitap
AEE_TM_HEBREW_R: Key presses will enter Hebrew characters as like rapid text entry
AEE_TM_CROATIAN: Key presses will enter Croatian characters as like multitap
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -