📄 mmitextinput.h
字号:
#ifndef _DEF_MMI_TEXTINPUT_H_
#define _DEF_MMI_TEXTINPUT_H_
/*******************************************************************************
CONDAT (UK)
********************************************************************************
This software product is the property of Condat (UK) Ltd and may not be
disclosed to any third party without the express permission of the owner.
********************************************************************************
$Project name: Basic MMI
$Project code: BMI (6349)
$Module: MmiTextInput
$File: MmiTextInput.h
$Revision: 1.0
$Author: sunsj
$Date: 2003/12/03
********************************************************************************
Description:
********************************************************************************
$History: MMITextInput.h
$End
*******************************************************************************/
#include "zi8api.h"
#include "MmiEditor.h"
#define TEXT_BUFFER_EXTRA_SPACE 7 /* 2003/12/22 sunsj set element limit */
//define for InputScreenType
#define TEXT_DISPLAY_SCREEN 1
#define STROKE_INPUT_SCREEN 2
#define PINYIN_INPUT_SCREEN 3
#define WORD_ASSOCIATION_SCREEN 4
#define SYMBOL_INPUT_SCREEN 5
#define TEXT_FONT_BLACK 0x000000
#define TEXT_FONT_WHITE 0xFFFFFF
#define TEXT_FONT_BACKGROUND 0xE6FFFF
#define TEXT_CANDIDATE_BACKGROUND 0xE6FFFF /* 2003/12/15 sunsj modify */
#define TEXT_CANDIDATE_FOREGROUND 0x000000 /* 2003/12/15 sunsj modify */
/* 2004/01/04 sunsj modify for different lcd size */
#if (MAIN_LCD_SIZE==3)
/* 2003/12/15 sunsj modify for new coordinate*/
/* define display area */
#define ELEMENT_LINE 75//101//shiheng 288 modify
#define CANDIDATES_LINE 93//120//shiheng 288 modify
#define TEXT_EDITOR_LINENUMBER_CANDIDATE 5
#define TEXT_EDITOR_LINENUMBER_NOCANDIDATE 7
#define CANDIDATES_PER_GROUP 7
#define LEFT_INDENTATION 7 /* 2003/12/22 sunsj modify for LCD width */
#elif ( MAIN_LCD_SIZE==4 )
/* 2003/12/15 sunsj modify for new coordinate*/
/* define display area */
#define ELEMENT_LINE 104
#define CANDIDATES_LINE 122
#define TEXT_EDITOR_LINENUMBER_CANDIDATE 5
#define TEXT_EDITOR_LINENUMBER_NOCANDIDATE 7
#define CANDIDATES_PER_GROUP 7
#define LEFT_INDENTATION 7 /* 2003/12/22 sunsj modify for LCD width */
#elif ( MAIN_LCD_SIZE==2 )
/* define display area */
#define ELEMENT_LINE 40
#define CANDIDATES_LINE 52
#define TEXT_EDITOR_LINENUMBER_CANDIDATE 2
#define TEXT_EDITOR_LINENUMBER_NOCANDIDATE 4
#define CANDIDATES_PER_GROUP 7
#define LEFT_INDENTATION 2 /* 2004/02/24 sunsj modify */
#endif
typedef enum
{
TEXT_INPUT_INIT,
TEXT_INPUT_DESTROY,
} text_editor_events;
//define for EditorMode
typedef enum
{
PINYIN_INPUT_MODE,
STROKE_INPUT_MODE,
UPPERCASE_INPUT_MODE,
LOWERCASE_INPUT_MODE,
SHUZI_INPUT_MODE,
LATIN_INPUT_MODE,
} text_input_mode;
typedef struct _Pinyin_EleBUF
{
ZI8SHORT Count;
ZI8WCHAR PinyinEleBUF[10][6];
} Pinyin_EleBUF;
typedef struct _IME_DATA
{
int CandidateCursor; /* the indication of the current candidate highlighted */
unsigned short TextBufferCount; // Total number of characters contained in the wszTextBuffer.
unsigned char candidates; /* last returned number of candidates */
int TextCursor; /* the current test cursor */
PZI8WCHAR pTextBuffer; /* the start of the text buffer */
int TextBufferEditSize; /* */
int TextBufferSize; /* */
unsigned char moreCount; /* keeps track of the more count */
PZI8WCHAR pDisplayElementBuffer;
ZI8UCHAR EditorMode; // To store current editor mode i.e. stroke, PinYin
unsigned char InputScreenType; // This variable is to state the different screen type.
PZI8GETPARAM pGetParam; /* pointer to Zi8GetParam */
Pinyin_EleBUF PinyinElementBUF[6];/* pinyin element buffer */
USHORT PinyinDisplayBuf[6][TEXT_BUFFER_EXTRA_SPACE+1]; /* pinyin display buffer */
USHORT Element_Select; /* the pinyin which user select */
USHORT ElementNumber; /* the whole pinyin number */
ZI8WCHAR Association_Buffer[10];/* association buf */
} IME_DATA, * pIME_DATA;
typedef struct _T_TEXT_INPUT
{
T_MMI_CONTROL mmi_control;
T_MFW_HND parent_win;
T_MFW_HND input_win;
T_MFW_HND input_kbd;
T_MFW_HND input_kbd_long;
T_MFW_HND input_edt;
T_MFW_HND input_tim;
T_MFW_HND input_key_tim;
T_MFW_HND options_win;
T_EDITOR_DATA editor_data;
T_MFW_HND symbol_input;
USHORT Identifier;
UBYTE destroyEditor;
ZI8UCHAR version;
ZI8WCHAR* wszTextBuffer;
ZI8WCHAR DisplayElementBuffer[TEXT_BUFFER_EXTRA_SPACE + 1];
ZI8WCHAR wszElementBuffer[TEXT_BUFFER_EXTRA_SPACE + 1];
ZI8WCHAR wcCandidates[2*CANDIDATES_PER_GROUP+1];
ZI8WCHAR StartOfDisplayIndex;
ZI8WCHAR HighlightedCandidate[2];
ZI8WCHAR CursorPosition[2];
ZI8UCHAR NumberOfKeyPress;
CHAR PerviousKeyPress;
ZI8GETPARAM GetParam;
IME_DATA Ime;
} T_TEXT_INPUT;
T_MFW_HND text_input (T_MFW_HND parent_win, T_EDITOR_DATA* text_input_data);
void text_input_destroy (T_MFW_HND own_window);
MfwHnd TextInputActiveEditor(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -