comparison src/aci2/bmi/mmiEditor.h @ 120:3c2acfa1a72f

src/aci2/bmi: file renames to make filename case consistent
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 07 Oct 2016 03:46:05 +0000
parents src/aci2/bmi/MmiEditor.h@93999a60b835
children
comparison
equal deleted inserted replaced
119:b92a33c204b6 120:3c2acfa1a72f
1 #ifndef _DEF_MMI_EDITOR_H_
2 #define _DEF_MMI_EDITOR_H_
3
4 /*******************************************************************************
5
6 CONDAT (UK)
7
8 ********************************************************************************
9
10 This software product is the property of Condat (UK) Ltd and may not be
11 disclosed to any third party without the express permission of the owner.
12
13 ********************************************************************************
14
15 $Project name: Basic MMI
16 $Project code: BMI (6349)
17 $Module: MMI
18 $File: MmiEditor.h
19 $Revision: 1.0
20
21 $Author: Condat(UK)
22 $Date: 25/10/00
23
24 ********************************************************************************
25
26 Description:
27
28 This provides the root mofule for the basic MMI
29
30 ********************************************************************************
31 $History: MmiMmi.h
32
33 25/10/00 Original Condat(UK) BMI version.
34
35 $End
36
37 *******************************************************************************/
38
39
40
41
42 /*******************************************************************************
43
44 Type definitions
45
46 *******************************************************************************/
47 /*
48 * Definitions from common editor function
49 */
50 #define INFO_TIMEOUT 1
51 #define INFO_KCD_LEFT 2
52 #define INFO_KCD_RIGHT 3
53 #define INFO_KCD_HUP 4
54 #define INFO_KCD_UP 5
55 #define INFO_KCD_DOWN 6
56 #define INFO_KCD_0_9 7
57 #define INFO_KCD_ALTERNATELEFT 8
58 #define INFO_EMERGENCY 99
59
60 #define DIGITS_MODE 0
61 #define ALPHA_MODE 1
62 #define READ_ONLY_MODE 2
63 #define T9_MODE 3
64 #define CALC_MODE 4
65 #define PIN_SECURITY 5
66 #define FORMAT_MODE 6 // SH - formatted input mode for WAP
67
68 #define PROMPT_LENGTH 16
69
70 #ifndef FOREVER
71 #define TIMER_EXIT 0x0BB8 /* Default SMS timer period - 3 secs. */
72 #define SHORT_SECS 0x01F4 /* Information dialogue display times. */
73 #define THREE_SECS 0x0BB8 /* 3000 milliseconds. */
74 #define FIVE_SECS 0x1388 /* 5000 milliseconds. */
75 #define TEN_SECS 0x2710 /* 10000 milliseconds. */
76 #define TWO_MIN 0x1D4C0 /* 2 min */
77 #define FOREVER 0xFFFF /* Infinite time period. */
78 #endif /* FOREVER */
79
80 /*
81 * Parameter Decription:
82 * ----------------
83 * mode -> sets mode to digits or alpha;
84 * (ALPHA_MODE | DIGITS_MODE | READ_ONLY_MODE | T9_MODE)
85 * Callback -> Routine to be called, if the user presses left- or right- or clear-key or a timeout occurs
86 * (parameter = INFO_KCD_LEFT, INFO_KCD_ALTERNATELEFT, INFO_KCD_RIGHT, INFO_KCD_HUP,
87 * INFO_TIMEOUT)
88 * timeout -> after this timeout the Callback will be executed
89 * (optional, set to FOREVER if unused)
90 * (timeout is refreshed on every key-press)
91 * Identifier -> passed back to the creator as a parameter of Callback (optional)
92 * hide -> hide the entered string (currently not supported),
93 * TextId -> If you want to use a label...
94 * (optional, set to 0 if unused)
95 * TextString -> if no TextId is provided this will be used as alternative label
96 * (optional, set to NULL if unused)
97 * min_enter -> minimum number of chars to be entered in buffer,
98 * min_enter= 0x00 means no min. limit
99 * min_enter = editor_attr.size-1 means fixed lenght
100 * LeftSoftKey -> SoftKey to be shown if number of entered chars >= min_enter
101 * AlternateLeftSoftKey -> SoftKey to be shown if number of entered chars < min_enter
102 * RightSoftKey -> SoftKey to be shown unconditionally
103 * (in order to hide/disable a Softkey set it to TxtNull)
104 * NOTE: The buffer to be edited shall provide sufficient space to hold the terminating zero character.
105 * NOTE: We assume that the buffer to be edited is provided by the caller and valid throughout the lifetime of the editor.
106 * Thus we do NOT copy the buffer into local temporary space.
107 * NOTE: If digits-mode and hide are concurrently enabled, entering of '+' is not possible
108 * NOTE: In read-only mode the cursor is set to the top of the buffer and all normal keys are ignored.
109 * However Softkeys and long-clear are functional.
110 * NOTE: There's an exception from the normal behaviour if (mode == DIGITS) and (size == 2).
111 * In this case called "single digit key request" the editor is left immediately on any normal key
112 * by calling <Callback> with parameter INFO_KCD_LEFT.
113 */
114
115 /*
116 * External types
117 */
118
119 typedef enum
120 {
121 E_EDITOR_INIT,
122 E_EDITOR_DEINIT,
123 E_EDITOR_UPDATE,
124 E_EDITOR_CURSOR_END /*SPR 1392*/
125 } e_editor_events;
126
127
128 typedef void (*T_EDIT_CB) (T_MFW_HND, USHORT, USHORT);
129
130 typedef struct
131 {
132 T_MFW_EDT_ATTR editor_attr;
133 BOOL hide;
134 USHORT LeftSoftKey;
135 USHORT AlternateLeftSoftKey;
136 USHORT RightSoftKey;
137 USHORT Identifier;
138 UBYTE mode;
139 USHORT TextId;
140 char *TextString;
141 UBYTE min_enter;
142 ULONG timeout;
143 T_EDIT_CB Callback;
144 UBYTE destroyEditor;
145 char *FormatString; // SH - Formatting string for formatted input
146 int formatIndex; // SH - Position in formatting string
147 int fieldIndex; // SH - position within a delimited field
148 } T_EDITOR_DATA;
149
150 //Zone data for drawing windows
151 #define ZONE_FULL_HEIGHT 0x000F
152 #define ZONE_TOPHALF_HEIGHT 0x000C
153 #define ZONE_MIDDLE_HEIGHT 0x0006
154 #define ZONE_BOTTOMHALF_HEIGHT 0x0003
155 #define ZONE_FULL_WIDTH 0x00F0
156 #define ZONE_LEFTHALF_WIDTH 0x00C0
157 #define ZONE_MIDDLE_WIDTH 0x0060
158 #define ZONE_RIGHTHALF_WIDTH 0x0030
159
160 #define ZONE_ICONS 0x0100
161 #define ZONE_TITLE 0x0200
162 #define ZONE_CASE_ABC 0x0400
163 #define ZONE_SOFTKEYS 0x1000
164
165 #define ZONE_FULLSCREEN (ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH)
166 #define ZONE_FULLICONS (ZONE_ICONS|ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH)
167 #define ZONE_FULLTITLE (ZONE_TITLE|ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH)
168 #define ZONE_FULLSOFTKEYS (ZONE_SOFTKEYS|ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH)
169
170 #define ZONE_FULL_SK_TITLE (ZONE_TITLE|ZONE_SOFTKEYS|ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH)
171 #define ZONE_FULL_SK_TITLE_ALPHA (ZONE_TITLE|ZONE_SOFTKEYS|ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH | ZONE_CASE_ABC)
172 #define ZONE_WAP_EDITOR (ZONE_TITLE|ZONE_SOFTKEYS|ZONE_FULL_HEIGHT | ZONE_FULL_WIDTH)
173
174 //Specific editor sizes
175 #define ZONE_SMALL_EDITOR (0xFF00) /* editor for small (one line) editors */
176 #define ZONE_BORDER_EDITOR (0xFE00) /* editors with a border to the left/right - sim toolkit */
177 #define ZONE_BOTTOM_LINE (0xFD00) /* editors for the bottom line */
178 #define ZONE_BOTTOM_LINE_FIND (0xFC00) /* editors on the bottom line after "Find:" */
179
180
181 /* PROTOTYPES */
182 extern T_MFW_HND editor_start (T_MFW_HND parent, T_EDITOR_DATA * editor_data);
183
184 extern T_MFW_HND editor_start_common(T_MFW_HND win, char * buffer, U16 len,
185 T_EDITOR_DATA * editor_info, T_EDIT_CB editor_cb);
186
187
188 int showeZiTextIcon(MfwMnu* m, MfwMnuItem* i);
189
190 int Easy_Activate(MfwMnu* m, MfwMnuItem* i);
191
192 int Easy_DeActivate(MfwMnu* m, MfwMnuItem* i);
193
194 //API - 01/10/02 - Concatenation Switch Function Definition
195 int Concatenate_DeActivate(MfwMnu* m, MfwMnuItem* i);
196 int Concatenate_Activate(MfwMnu* m, MfwMnuItem* i);
197 int Concatenate_Status(MfwMnu* m, MfwMnuItem* i);
198
199 extern void editor_destroy (T_MFW_HND window);
200 extern void editor_attr_init(MfwEdtAttr* attr, int zone_id, U8 mode, U8 *controls, char *text, U16 size, int colour);
201 extern void editor_data_init( T_EDITOR_DATA* editor_info, T_EDIT_CB callback,USHORT lsk, USHORT rsk, USHORT txtId, USHORT min_num_char, UBYTE mode, ULONG timeout);
202
203 #endif /* _DEF_MMI_EDITOR */