comparison src/ui/mfw/mfw_edt.h @ 3:67bfe9f274f6

src/ui: import of src/ui3 from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:33:10 +0000
parents
children 92abb46dc1ba
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_edt.h $|
4 | $Author:: Es $ CONDAT GmbH $Revision:: 7 $|
5 | CREATED: 21.09.98 $Modtime:: 23.03.00 8:23 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8
9 MODULE : MFW_EDT
10
11 PURPOSE : EDIT types & constants
12
13 EXPORT :
14
15 TO DO :
16
17 $History:: mfw_edt.h $
18 *
19 * * ***************** Version 8 *****************
20 * User: MC Date: 03/10/02 Time: 14:40
21 * Updated in $/GSM/Condat/MS/SRC/MFW
22 * Replaced most of the file with version on 3.3.3 line (MC, SPR 1242)
23 *
24 * ***************** Version 7 *****************
25 * User: Es Date: 23.03.00 Time: 14:40
26 * Updated in $/GSM/Condat/MS/SRC/MFW
27 * added edtUnhide()
28 *
29 * ***************** Version 6 *****************
30 * User: Es Date: 18.02.00 Time: 15:45
31 * Updated in $/GSM/Condat/MS/SRC/MFW
32 * added edit controls: ecTop, ecBottom
33 *
34 * ***************** Version 5 *****************
35 * User: Es Date: 6.07.99 Time: 12:03
36 * Updated in $/GSM/DEV/MS/SRC/MFW
37 *
38 * ***************** Version 4 *****************
39 * User: Es Date: 17.02.99 Time: 20:00
40 * Updated in $/GSM/DEV/MS/SRC/MFW
41 *
42 * ***************** Version 3 *****************
43 * User: Es Date: 14.01.99 Time: 17:19
44 * Updated in $/GSM/DEV/MS/SRC/MFW
45 *
46 * ***************** Version 2 *****************
47 * User: Es Date: 23.12.98 Time: 16:19
48 * Updated in $/GSM/DEV/MS/SRC/MFW
49 */
50
51 #ifndef _DEF_MFW_EDT_H_
52 #define _DEF_MFW_EDT_H_
53
54 #define edtCurNone 0x00 /* no cursor, read only */
55 #define edtCurBar1 0x01 /* vertical bar thin */
56 #define edtCurMask 0x07 /* mask for cursor type */
57 #define edtModOverWr 0x08 /* overwrite mode */
58 #define edtModWordSkip 0x10 /* GW 12/09/01 skip over words (for predictive text) */
59 #define edtModAllowPredText 0x20 /* SPR957 - SH - whether predicted text is available in this editor */
60
61 #define MAX_PRED_TEXT 15
62
63 //GW Added bgd colour - and changed type to U32 (for future compatibility)
64 typedef struct MfwEdtAttrTag /* EDITOR ATTRIBUTES */
65 {
66 MfwRect win; /* editor position and size */
67 U32 edtCol; /* index to fgd/bgd colour definition*/
68 U8 font; /* character font */
69 U8 mode; /* edit modes & cursor type */
70 U8 *controls; /* edit control keys */
71 char *text; /* edit buffer */
72 U16 size; /* buffer size */
73 char predText[MAX_PRED_TEXT]; /* GW 06/09/01 Added predicted word buffer */
74
75 /* NM, 13.03, fast-edit
76 old: to handle between the two modes (digit/alpha) was done by BMI
77 new: handle by MFW
78 */
79 U8 alphaMode; /* true(alpha)/false(digit) */
80 } MfwEdtAttr;
81
82 typedef struct MfwEdtTag /* EDITOR CONTROL BLOCK */
83 {
84 MfwEvt mask; /* selection of events */
85 MfwEvt flags; /* current event */
86 MfwCb handler; /* event handler */
87 MfwEdtAttr *attr; /* editor attributes */
88 U16 cp; /* cursor position */
89 U16 curOffs; /* start of view in text */
90 /* SPR920 - NH (SH) - these properties are now kept by the editor */
91 int fontHeight; /* height of current font */
92 int display; /* really show the things */
93 U8 curMode; /* edit mode & cursor type */
94 S16 curCX, curCY; /* screen cursor position */
95 S16 curCSize; /* size of screen cursor */
96 /* end SPR920 */
97 } MfwEdt;
98
99 typedef enum /* EDITOR CONTROL KEYS */
100 {
101 ecNone, /* no valid edit control */
102 ecLeft, /* cursor left */
103 ecRight, /* cursor right */
104 ecUp, /* cursor up */
105 ecDown, /* cursor down */
106 ecTop, /* cursor to top of text */
107 ecBottom, /* cursor to end of text */
108 ecBack, /* backspace */
109 ecDel, /* delete */
110 ecEnter, /* return key */
111 ecEscape /* escape key */
112 } MfwEdtEC;
113
114 /* EDITOR FLAGS */
115 #define MfwEdtVisible 1 /* editor is visible */
116
117
118 /* PROTOTYPES */
119 MfwRes edtInit (void);
120 MfwRes edtExit (void);
121 MfwHnd edtCreate (MfwHnd w, MfwEdtAttr *a, MfwEvt e, MfwCb f);
122 MfwRes edtDelete (MfwHnd e);
123 MfwRes edtReset (MfwHnd w);
124 MfwRes edtShow (MfwHnd e);
125 MfwRes edtHide (MfwHnd e);
126 MfwRes edtUnhide (MfwHnd e);
127 MfwRes edtClear (MfwHnd e);
128 MfwRes edtUpdate (MfwEdt *e);
129 MfwRes edtChar (MfwHnd e, int c);
130
131 MfwRes edtRefresh (MfwHnd e); /* SPR945 - SH*/
132
133 //Global procedures - Adding/ removing words in the editor.
134 MfwRes edtInsertString (MfwHnd e, char* insWord); //Insert a string at the cursor
135 MfwRes edtCopyString (MfwHnd e, char* removeWord); //Copy a word from the cursor pos
136 MfwRes edtRemoveString (MfwHnd e, char* removeWord); //Delete a word from the cursor pos.
137
138 char getCursorChar(MfwHnd e, int offset );
139 void moveRight (char *b, int s, int d);
140 void moveLeft (char * str, int ofs);
141
142 /* Unicode editor procedures.
143 * SPR957 - SH - moved some prototypes here from mfw_edt.c */
144
145 MfwRes edtUpdateUnicode (MfwEdt *e);
146 MfwRes edtCharUnicode (MfwHnd e, int c);
147 void moveLeftUnicode(U16 *unicodeStr, int nChars);
148 void moveRightUnicode(U16 *unicodeStr, int nChars);/*MC*/
149 U16 strlenUnicode(U16* str);/*MC*/
150 int edtInsertUnicode (MfwEdt *e, int c, U16 *b, int s);
151 MfwRes edtInsertUnicodeString (MfwHnd e, char* insWordChar);
152 void convertToUnicode(U16 *outputString, char *inputString); /* SPR957 - SH - added */
153
154
155 #endif
156