msgviewercui.h
12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* MsgViewerCui.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
*
*
* Author:
* -------
* -------
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
#ifndef CUI_MSGVIEWERCUI_H
#define CUI_MSGVIEWERCUI_H
#ifdef __UM_SUPPORT__
#include "UmSrvDefs.h"
#include "MsgViewerCuiGProt.h"
/* This file is used by MMI task, Please use MMI type if possible */
#define CUI_MSG_VIEWER_MAX_INSTANCE 1
#define CUI_MSG_VIEWER_CHECK_INST_VALID(inst) \
{ \
MMI_ASSERT(NULL != inst); \
MMI_ASSERT(GRP_ID_INVALID != inst->group_id); \
}
typedef enum
{
CUI_MSG_VIEWER_STATUS_INVALID,
CUI_MSG_VIEWER_STATUS_INIT,
CUI_MSG_VIEWER_STATUS_READY,
CUI_MSG_VIEWER_STATUS_NO_MSG_LIST,
CUI_MSG_VIEWER_STATUS_DEINIT
} cui_msg_viewer_status_enum;
typedef struct
{
mmi_id parent_grp_id;
mmi_id group_id;
mmi_id scrn_id;
cui_msg_viewer_type_enum type;
cui_msg_viewer_status_enum status;
U32 curr_msg_id;
srv_um_msg_enum curr_msg_type;
void *msg_list;
} cui_msg_viewer_inst_struct;
typedef struct
{
mmi_id base_scrn_id;
cui_msg_viewer_inst_struct inst_table[CUI_MSG_VIEWER_MAX_INSTANCE];
} cui_msg_viewer_cntx_struct;
extern cui_msg_viewer_cntx_struct g_cui_msg_viewer;
extern cui_msg_viewer_cntx_struct *g_cui_msg_viewer_p;
/*****************************************************************************
* Adaptor *
****************************************************************************/
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_adp_get_viewer_ptr
* DESCRIPTION
* Get the message application viewer pointer.
* PARAMETERS
* msg_type [IN] The message type.
* RETURNS
* The Launched viewr pointer
* RETURN VALUES
* Message viewer unction pointer
*****************************************************************************/
extern cui_msg_viewer_launch_ptr cui_msg_viewer_adp_get_viewer_ptr(srv_um_msg_enum msg_type);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_adp_launch_viewer_ptr
* DESCRIPTION
* Launch the message application viewer pointer.
* PARAMETERS
* msg_id [IN] The message id.
* msg_type [IN] The message type.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_adp_launch_viewer_ptr(srv_um_msg_enum msg_type,
mmi_id parent_grp_id,
U32 msg_id,
void *user_data,
cui_msg_viewer_type_enum type);
/*****************************************************************************
* Kernel *
****************************************************************************/
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_create_instance
* DESCRIPTION
* Create a instance for message viewer cui. It is only allocate a usable
* memory to this instance.
* PARAMETERS
* void
* RETURNS
* The instance pointer of message viewr cui.
* RETURN VALUES
* Pointer of memory
*****************************************************************************/
extern cui_msg_viewer_inst_struct *cui_msg_viewer_create_instance(void);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_rel_instance
* DESCRIPTION
* Release a instance for message viewer cui. It will free the memory from
* cui side.
* PARAMETERS
* inst: [IN] Message viewer cui instance pointer.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_rel_instance(cui_msg_viewer_inst_struct *inst);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_get_instance
* DESCRIPTION
* Get a instance for message viewer cui. It will return the pointer of found
* instance.
* PARAMETERS
* grp_id: [IN] Group id of this instance. (should be unique)
* RETURNS
* The instance pointer of message viewr cui.
* RETURN VALUES
* Pointer of memory
*****************************************************************************/
extern cui_msg_viewer_inst_struct *cui_msg_viewer_get_instance(mmi_id grp_id);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_schedule
* DESCRIPTION
* The scheduler of message viewer cui. Currently, it has 4 different states.
* INIT, READY, NO_MSG_LIST, DEINIT.
* INIT : It will create a group from FW and start to entry
* message viewr marker.
* READY : All data is ready. It will start to entry a marker and
* launch the corresponding message viewer.
* NO_MSG_LIST : If supporting the iterator viewer, it may not have the
* message list. In this state, it will wait the message
* list set from caller.
* DEINIT : It will deinit the marker and free the memory of message
* viewer instance.
* PARAMETERS
* inst: [IN] The instance of message viewer cui.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_schedule(cui_msg_viewer_inst_struct *inst);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_grp_proc
* DESCRIPTION
* The proc handler of screen group. Currently, it does not have any handler
* inside.
* PARAMETERS
* evt: [IN] Event sent from FW.
* RETURNS
* The handler result of this event.
* RETURN VALUES
* MMI_RET_OK.(always currently)
*****************************************************************************/
extern mmi_ret cui_msg_viewer_grp_proc(mmi_event_struct *evt);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_schedule_init
* DESCRIPTION
* Initial function of instance. It will create a screen group and start to
* entry a message viewer marker.
* PARAMETERS
* inst: [IN] Instance of message viewer cui.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_schedule_init(cui_msg_viewer_inst_struct *inst);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_schedule_init_entry
* DESCRIPTION
* The entry function with argument of initial state. It is the extra
* function for FW usage.
* PARAMETERS
* arg: [IN] The argument sent from FW. The user data is also
* inside.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_schedule_init_entry(mmi_scrn_essential_struct *arg);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_schedule_ready
* DESCRIPTION
* Ready function of instance. It will launch the cooresponding message. For
* iterator viewer, it should also check the message list is taken.
* PARAMETERS
* inst: [IN] Instance of message viewer cui.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_schedule_ready(cui_msg_viewer_inst_struct *inst);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_schedule_deinit
* DESCRIPTION
* Deinitial function of instance. It will close the screen gruop and free
* the memory of instance.
* PARAMETERS
* inst: [IN] Instance of message viewer cui.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_schedule_deinit(cui_msg_viewer_inst_struct *inst);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_entry
* DESCRIPTION
* Entry function of message viewer marker. If go back to this screen, it
* means it should close the message viewer. Hence, it will send a event to
* the caller to inform them that they should close it.
* PARAMETERS
* arg: [IN] The argument sent from FW. The user_data is also
* inside.
* RETURNS
* void
* RETURN VALUES
* void
*****************************************************************************/
extern void cui_msg_viewer_entry(mmi_scrn_essential_struct *arg);
/*****************************************************************************
* FUNCTION
* cui_msg_viewer_leave_proc
* DESCRIPTION
* Leave proc function of message viewer marker. If it receives the deinit
* event, it should delete its own instance.
* PARAMETERS
* evt: [IN] Framework event
* RETURNS
* The handling result
* RETURN VALUES
* MMI_RET: success
* Others: Fail
*****************************************************************************/
extern mmi_ret cui_msg_viewer_leave_proc(mmi_event_struct *evt);
#endif
#endif /* CUI_MSGVIEWERCUI_H */