FreeCalypso > hg > tcs211-l1-reconst
comparison g23m/condat/ms/src/bmi/MmiBookUtils.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 #ifndef _MMIBOOKUTILS_H_ | |
2 #define _MMIBO0KUTILS_H_ 1 | |
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: PhoneBook | |
18 $File: MmiBookUtils.h | |
19 $Revision: 1.0 | |
20 | |
21 $Author: Condat(UK) | |
22 $Date: 25/10/00 | |
23 | |
24 ******************************************************************************** | |
25 | |
26 Description: | |
27 | |
28 This module provides utility functions for the phone book. | |
29 | |
30 | |
31 ******************************************************************************** | |
32 | |
33 $History: MmiBookUtils.h | |
34 | |
35 25/10/00 Original Condat(UK) BMI version. | |
36 | |
37 $End | |
38 | |
39 *******************************************************************************/ | |
40 | |
41 | |
42 /* Include the phonebook types package, it will probably be | |
43 required to get the basic types which are shared by the | |
44 phonebook modules. | |
45 */ | |
46 #include "MmiBookShared.h" | |
47 #include "mfw_phb.h" | |
48 /* SPR#1428 - SH - New Editor changes */ | |
49 #ifndef NEW_EDITOR | |
50 #include "MmiEditor.h" //for editor size definitions | |
51 #endif | |
52 /* bookCurrentWindow | |
53 | |
54 This returns the window handle associated with the current | |
55 MFW element | |
56 */ | |
57 tBookMfwHnd bookCurrentWindow( void ); | |
58 | |
59 | |
60 /* bookDefaultCallBack | |
61 | |
62 This is a simple call back function which is invoked when | |
63 a not implemented dialog is displayed. We don't want anyone | |
64 outside of this module using it so define it as static, | |
65 this will still be callable from the info dialogs as it | |
66 will use the reference we set up. | |
67 */ | |
68 static tBookStatus bookDefaultCallBack( tBookMfwHnd win, UBYTE identifier, UBYTE reason ); | |
69 | |
70 | |
71 /* bookWindowData | |
72 | |
73 This routine is designed to be invoked from within a menu | |
74 handler or call back function and will return a pointer to | |
75 the user data associated with the current MFW element. | |
76 | |
77 The return value is a pointer to void, therefore the caller | |
78 is responsible for casting this to the correct type prior | |
79 to use. | |
80 */ | |
81 void *bookWindowData( void ); | |
82 | |
83 | |
84 /* bookMenuSelectedNumber | |
85 | |
86 This will return the currently selected entry in the phone | |
87 book, when the routine is being called from a menu handler | |
88 */ | |
89 char *bookMenuSelectedNumber( void ); | |
90 | |
91 | |
92 /* bookNotImplemented | |
93 | |
94 This will present an information dialog indicating the current | |
95 feature is still under development. This routine will use the | |
96 current MFW element to detect the handle of the parent window | |
97 if the incoming window handle is NULL. | |
98 */ | |
99 tBookStatus bookNotImplemented( tBookMfwHnd ParentWindowHandle ); | |
100 tBookStatus bookMenuNotImplemented( tBookMfwMenu *Menu, tBookMfwMenuItem *Item ); | |
101 | |
102 | |
103 | |
104 | |
105 /* Utility function to determine if the phone book is | |
106 still in the loading state | |
107 */ | |
108 int bookPhoneBookLoading( void ); | |
109 | |
110 | |
111 | |
112 /* Utility functions just to throw a string onto the screen | |
113 primarily for debug purposes, the modal version will wait | |
114 for a user input before removing the message, the non-modal | |
115 will clear after three seconds | |
116 */ | |
117 tBookStatus bookInfoDialog( char *String1, char *String2 ); | |
118 tBookStatus bookInfoDialogModal( char *String, char *String2 ); | |
119 | |
120 | |
121 /* SPR#1428 - SH - New Editor: No longer required */ | |
122 #ifndef NEW_EDITOR | |
123 /* Set editing attributes | |
124 This constructs a edit attribute block from the provided | |
125 parameters | |
126 */ | |
127 // GW - Changed colour from 8 bits (foreground) to 2x32bits fgd and bgd | |
128 void bookSetEditAttributes( | |
129 int editZone, | |
130 U32 colindex, | |
131 U8 font, U8 mode, U8 *controls, | |
132 char *text, U16 size, | |
133 MfwEdtAttr* attr); | |
134 #endif | |
135 | |
136 /* Memory allocation and freeing functions | |
137 | |
138 These routines provided guarded access to the malloc and free | |
139 routines used in the MMI application. The wrapper functions | |
140 provided here allow debugging and tracking information to be | |
141 easily derived, it also allows the memory allocation and | |
142 deallocation to be changed if required. | |
143 | |
144 Note that the free routine takes a pointer to the pointer | |
145 to the memory being freed. This allows the actual pointer | |
146 value to be set to NULL as part of the free operation, this | |
147 helps protect against reusing the pointer after the memory | |
148 has been deallocated. | |
149 | |
150 Sample usage: | |
151 | |
152 tStructure *ptr; | |
153 | |
154 if ( ( ptr = (tStructure *) bookMemAlloc( sizeof(tStructure) ) ) != NULL ) | |
155 { | |
156 // use the allocated memory | |
157 // | |
158 ... | |
159 | |
160 // free the memory | |
161 // | |
162 bookMemFree( &ptr ); | |
163 } | |
164 */ | |
165 void *bookMemAlloc( long int NumBytes ); | |
166 void bookMemFree( void **Pointer ); | |
167 | |
168 | |
169 | |
170 /* Name handling utility functions | |
171 */ | |
172 UBYTE bookFindName( UBYTE number, tMmiPhbData *current ); | |
173 //UBYTE changeName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus ); | |
174 //UBYTE deleteName( UBYTE book, UBYTE index, T_MFW_PHB_STATUS *currentStatus ); | |
175 //UBYTE addName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus ); | |
176 | |
177 /* File handling functions | |
178 */ | |
179 void changeInFile( T_phbk *phbk ); | |
180 void deleteFromFile( T_phbk *phbk, UBYTE book ); | |
181 void storeInFile( T_phbk *phbk ); | |
182 | |
183 /* SPR#1112 - SH - Internal phonebook use */ | |
184 #ifdef INT_PHONEBOOK | |
185 void bookChangePB(T_MFW_HND win, UBYTE identifier, UBYTE reason); | |
186 UBYTE bookCopy( T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *destStatus, T_MFW_PHB_STATUS *srcStatus, UBYTE move); | |
187 void bookCopySingle(T_MFW_HND win, UBYTE identifier, UBYTE reason); | |
188 void bookCopyMultiple(T_MFW_HND win, UBYTE move, UBYTE reason); | |
189 #endif | |
190 | |
191 UBYTE bookGetCurrentStatus( T_MFW_PHB_STATUS *currentStatus ); | |
192 int bookEvent( MfwEvt e, void *para ); | |
193 | |
194 /* Copy name in phonebook structure | |
195 */ | |
196 void bookCopyPhbName( T_MFW_PHB_ENTRY* destEntry, T_MFW_PHB_ENTRY* srcEntry, int maxLen ); | |
197 | |
198 | |
199 /******************************************************************************* | |
200 | |
201 End of File | |
202 | |
203 *******************************************************************************/ | |
204 | |
205 #endif |