⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mfw_edt.h

📁 是一个手机功能的模拟程序
💻 H
字号:
/*
+--------------------------------------------------------------------+
| PROJECT: MMI-Framework (8417)         $Workfile:: mfw_edt.h       $|
| $Author: jhxu $ CONDAT GmbH           $Revision: 1.3 $|
| CREATED: 21.09.98                     $Modtime:: 23.03.00 8:23    $|
| STATE  : code                                                      |
+--------------------------------------------------------------------+

   MODULE  : MFW_EDT

   PURPOSE : EDIT types & constants

   EXPORT  :

   TO DO   :

   $History:: mfw_edt.h                                             $
   
       *    *     * **************  Version 10.1*****************
 *   zgz,2002.9.5
 * Add function edtInsertAnyString() for inserting any format string to our editor

    *    *     * **************  Version 10.0 *****************
 * zgz,2002.8.26
 * encapsulate the title display  to one module inputIndicate_update(), it's parameter changed.

    *    *     * ************  Version 09.1 *****************
 * zgz,2002.7.11
 * 
 * add function inputIndicate_update()


 *     * *****************  Version 09 *****************
 * zgz,2002.7.2
 * added edtSymbol(), edtSetText()
 * 

    * *****************  Version 08 *****************
 * zgz,2002.06.24
 * added edtCharf()
 * 

 * *****************  Version 7  *****************
 * User: Es           Date: 23.03.00   Time: 14:40
 * Updated in $/GSM/Condat/MS/SRC/MFW
 * added edtUnhide()
 * 
 * *****************  Version 6  *****************
 * User: Es           Date: 18.02.00   Time: 15:45
 * Updated in $/GSM/Condat/MS/SRC/MFW
 * added edit controls: ecTop, ecBottom
 * 
 * *****************  Version 5  *****************
 * User: Es           Date: 6.07.99    Time: 12:03
 * Updated in $/GSM/DEV/MS/SRC/MFW
 * 
 * *****************  Version 4  *****************
 * User: Es           Date: 17.02.99   Time: 20:00
 * Updated in $/GSM/DEV/MS/SRC/MFW
 * 
 * *****************  Version 3  *****************
 * User: Es           Date: 14.01.99   Time: 17:19
 * Updated in $/GSM/DEV/MS/SRC/MFW
 * 
 * *****************  Version 2  *****************
 * User: Es           Date: 23.12.98   Time: 16:19
 * Updated in $/GSM/DEV/MS/SRC/MFW
*/

#ifndef _DEF_MFW_EDT_H_
#define _DEF_MFW_EDT_H_

#define edtCurNone      0x00            /* no cursor, read only     */
#define edtCurBar1      0x01            /* vertical bar thin        */
#define edtCurMask      0x07            /* mask for cursor type     */
#define edtModOverWr    0x08            /* overwrite mode           */
#define edtModWordSkip  0x10            /* GW 12/09/01 skip over words (for predictive text)  */

#define MAX_PRED_TEXT   15


//zgz, 2002. 7.25  add the title display mode

#define TITLE_NONE 0x00  	// no title to display
#define TITLE_ALL 0x01		// display the input_method_indicate, text, the spare number that can be input
#define TITLE_ONLYTEXT 0x02		// only display the text in the title area
//#define edtFrame_Line 0x04		// add frame in the editor area
#define TITLE_TOP 0x08		// title displayed on the first line of window.  

/* 2004/05/12 sunsj define */
//define LCD attr
#if  (MAIN_LCD_SIZE==3)
#define SCREEN_WIDTH	128	/* LCD width */
#define SCREEN_HIGH		128    /* LCD width */
#elif ( MAIN_LCD_SIZE==4 )
#define SCREEN_WIDTH	128//120	/* 2003/12/22 sunsj modify LCD width */
#define SCREEN_HIGH		160//160    /* 2003/12/22 sunsj modify LCD width */
#elif ( MAIN_LCD_SIZE==2)
#define SCREEN_WIDTH	102//120	/* 2003/12/22 sunsj modify LCD width */
#define SCREEN_HIGH		80//160    /* 2003/12/22 sunsj modify LCD width */
#endif

typedef struct MfwEdtAttrTag            /* EDITOR ATTRIBUTES        */
{
    MfwRect win;                        /* editor position and size */
    UINT32 fgColor;                         /* foreground color         */
    U8 font;                            /* character font           */
    U8 mode;                            /* edit modes & cursor type */
    U8 *controls;                       /* edit control keys        */
    char *text;                         /* edit buffer              */
	char predText[MAX_PRED_TEXT];		/* GW 06/09/01 Added predicted word buffer    */
    U16 size;                           /* buffer size              */
    U16 e_size;                        /*add for sms,the english size is not the twice of chinese*///yq 2003.1.9
 	U8 titleMode;			//zgz,2002.0628  if the flag is set , the title will be displayed on the top line
 	int title_id;			//zgz,2002.0628  it point to a string
 	char *textnum;
} MfwEdtAttr;

typedef struct MfwEdtTag                /* EDITOR CONTROL BLOCK     */
{
    MfwEvt mask;                        /* selection of events      */
    MfwEvt flags;                       /* current event            */
    MfwCb handler;                      /* event handler            */
    MfwEdtAttr *attr;                   /* editor attributes        */
    U16 cp;                             /* cursor position          */
    U16 cp_curr_x;               /*flag indicate we need or not set the cursor to bottom*/
    U16 cp_curr_y;               /*cursor current y coordinate*/
    U16 cp_curr_width;        /*cursor current width*/
    U16 cp_last_x;               /*cursor last x coordinate*/
    U16 cp_last_y;               /*cursor last x coordinate*/
    U16 curOffs;                        /* start of view in text    */
} MfwEdt;

typedef enum                            /* EDITOR CONTROL KEYS      */
{
    ecNone = -20,                             /* no valid edit control    */
    ecLeft,                             /* cursor left              */
    ecRight,                            /* cursor right             */
    ecUp,                               /* cursor up                */
    ecDown,                             /* cursor down              */
    ecTop,                              /* cursor to top of text    */
    ecBottom,                           /* cursor to end of text    */
    ecBack,                             /* backspace                */
    ecDel,                              /* delete                   */
    ecEnter,                            /* return key               */
    ecEscape                            /* escape key               */
} MfwEdtEC;

                                        /* EDITOR FLAGS             */
#define MfwEdtVisible       1           /* editor is visible        */

                                        /* PROTOTYPES               */
MfwRes edtInit (void);
MfwRes edtExit (void);
MfwHnd edtCreate (MfwHnd w, MfwEdtAttr *a, MfwEvt e, MfwCb f);
MfwRes edtDelete (MfwHnd e);
MfwRes edtReset (MfwHnd w);
MfwRes edtShow (MfwHnd e);
MfwRes edtHide (MfwHnd e);
MfwRes edtUnhide (MfwHnd e);
MfwRes edtClear (MfwHnd e);
MfwRes edtUpdate (MfwEdt *e,int all);
MfwRes edtChar (MfwHnd e, int c);
MfwRes edtCharf (MfwHnd e, int c, int disp);
MfwRes edtSymbol (MfwHnd e, int c);   //zgz, 2002.06.27 interface of uniform symbol input
int getSymbolNumSpare(MfwEdt *e);  //zgz, 2002.06.26


/*
zgz, 2002.06.26 
edtSetText(),
Just only initialize the editor buffer.
*/
MfwRes edtSetText (MfwHnd e,  char * s);
MfwRes inputIndicate_update(MfwEdt * e); //zgz,2002.7.5 Mobile Innovation

//Global procedures - Adding/ removing words in the editor.
MfwRes edtInsertString (MfwHnd e, char* insWord);		//Insert a string at the cursor
MfwRes edtCopyString (MfwHnd e, char* removeWord);		//Copy a word from the cursor pos
MfwRes edtRemoveString (MfwHnd e, char* removeWord);	//Delete a word from the cursor pos.

char getCursorChar(MfwHnd e, int offset );

//Unicode editor procedures.
MfwRes edtUpdateUnicode (MfwEdt *e,int all);
MfwRes edtCharUnicode (MfwHnd e, int c);

//Global procedures - Adding/ removing words in the editor.
MfwRes edtInsertUnicodeString (MfwHnd e, char* insWordChar);
MfwRes edtInsertAnyString (MfwHnd e, char* insWord);  //zgz add, 2002.9.5


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -