summaryrefslogtreecommitdiff
path: root/utilities/test-application/testapp-utility.c
blob: 527df2cb2b38fc7ca5c0bbd9a01ef2bf986d2a8c (plain)
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
/*
*  email-service
*
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/



/* common header */
#include <stdarg.h>
#include <string.h>

/* open header */
#include <glib.h>
#include <glib/gprintf.h>

/* internal header */
#include "testapp-utility.h"

/* internal data struct */

void testapp_print (char *fmt, ...)
{
	va_list args = {0};
	va_start(args, fmt);
	vfprintf (stdout, fmt, args);
	va_end (args);
	fflush (stdout);
}

void testapp_show_menu (eEMF_MENU menu)
{
	switch (menu) {
		case EMF_MAIN_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("    Email test application \n");
			testapp_print ("==========================================\n");
			testapp_print ("1. Account Test\n");
			testapp_print ("2. Message Test\n");
			testapp_print ("3. Mailbox Test\n");
			testapp_print ("5. Rule Test\n");
			testapp_print ("6. Thread Test\n");
			testapp_print ("7. Others\n");
			testapp_print ("0. Exit \n");
			testapp_print ("------------------------------------------\n");
			break;
			
		case EMF_ACCOUNT_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("    ACCOUNT MENU \n");
			testapp_print ("==========================================\n");
			testapp_print (" 1.  Create Account\n");
			testapp_print (" 2.  Update Account\n");
			testapp_print (" 3.  Delete Account\n");
			testapp_print (" 4.  Get Account\n");
			testapp_print (" 5.  Get Account List\n");
			testapp_print (" 7.  Validate Account\n");
			testapp_print (" 8.  Cancel validate Account\n");
			testapp_print (" 9.  Backup All Accounts\n");
			testapp_print (" 10. Restore accounts\n");
			testapp_print (" 11. Get password length of account\n");
			testapp_print (" 12. Query server info\n");
			testapp_print (" 13. Clear all notifications\n");
			testapp_print (" 0.  Go to Main Menu\n");
			testapp_print ("------------------------------------------\n");
			break;
			
		case EMF_MAIL_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("    MAIL MENU\n");
			testapp_print ("==========================================\n");
			testapp_print ("1.  Get mails\n");
			testapp_print ("2.  Send a mail \n");
			testapp_print ("4.  Add Attachment\n");
			testapp_print ("9.  Mail Count \n");
			testapp_print ("10. Modify mail flag \n");
			testapp_print ("11. Modify mail extra flag modify\n");
			testapp_print ("14. Delete a mail \n");
			testapp_print ("16. Download mail body\n");
			testapp_print ("17. Download an attachment\n");
			testapp_print ("20. Delete all mail\n");
			testapp_print ("21. Move Mail \n");
			testapp_print ("23. Resend Mail \n");
			testapp_print ("24. Find mails\n");				
			testapp_print ("26. Count mails On Sending\n");
			testapp_print ("27. Move all mails to mailbox\n");
			testapp_print ("28. Count mails with Draft Flag\n");
			testapp_print ("29. Get latest unread mail Id\n");
			testapp_print ("38. Get total email disk usage \n");	
			testapp_print ("40. Verify Email Address Format\n");
			testapp_print ("41. Get Max Mail Count\n");
			testapp_print ("42. Storage test : (Input : to fields)\n");
			testapp_print ("43. Send mail Cancel\n");
			testapp_print ("44. Cancel Download Body\n");
 			testapp_print ("48. Get thread information\n");
			testapp_print ("49. Get sender list\n");
			testapp_print ("51. Get mail list ex\n");
			testapp_print ("52. Get address info list\n");
			testapp_print ("55. Set a field of flags\n");
			testapp_print ("56. Add mail\n");
			testapp_print ("57. Update mail\n");
			testapp_print ("58. Search on server\n");
			testapp_print ("59. Add mail to search result table\n");
			testapp_print ("0.  Go to Main Menu\n");
			testapp_print ("------------------------------------------\n");
			break;
			
		case EMF_MAILBOX_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("   MAILBOX MENU\n");
			testapp_print ("==========================================\n");
			testapp_print (" 1. Add mailbox\n");
			testapp_print (" 2. Delete mailbox\n");
			testapp_print (" 3. Update mailbox\n");
			testapp_print (" 4. Get IMAP mailbox List\n");
			testapp_print (" 6. Get Child List for given mailbox \n");
			testapp_print (" 7. Get mailbox by mailbox type\n");
			testapp_print (" 8. Set mail slot size\n");
			testapp_print (" 9. Get mailbox list\n");
			testapp_print ("10. Sync mailbox\n");
			testapp_print ("0. Go to Main Menu\n");
			testapp_print ("------------------------------------------\n");
			break;
			
		case EMF_RULE_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("   RULE MENU\n");
			testapp_print ("==========================================\n");
			testapp_print ("1. Add Rule\n");
			testapp_print ("2. Delete Rule\n");
			testapp_print ("3. Update Rule\n");
			testapp_print ("5. Get Rule\n");
			testapp_print ("6. Get Rule List\n");
			testapp_print ("0. Go to Main Menu\n");
			testapp_print ("------------------------------------------\n");
			break;
			
		case EMF_THREAD_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("   TRHEAD MENU\n");
			testapp_print ("==========================================\n");
			testapp_print ("1. Move Thread\n");
			testapp_print ("2. Delete Thread\n");
			testapp_print ("3. Set Seen Flag of Thread\n");
			testapp_print ("0. Go to Main Menu\n");
			testapp_print ("------------------------------------------\n");
			break;
			
		case EMF_OTHERS_MENU:
			testapp_print ("==========================================\n");
			testapp_print ("   OTHERS\n");
			testapp_print ("==========================================\n");
			testapp_print ("1.  Get Network Status\n");
			testapp_print ("2.  Get Pending Job\n");
			testapp_print ("3.  Cancel Job\n");
			testapp_print ("5.  Set DNET Proper Profile Type\n");
			testapp_print ("6.  Get DNET Proper Profile Type\n");
			testapp_print ("7.  Send mail cancel job\n");
			testapp_print ("11. Print receiving event queue via debug msg\n");
			testapp_print ("12. Create DB full\n");
			testapp_print ("13. Encoding Test\n");
			testapp_print ("14. DTT Test\n");
			testapp_print ("0.  Go to Main Menu\n");
			testapp_print ("------------------------------------------\n");
			break;
			
		default:
			break;
	}
}
void testapp_show_prompt (eEMF_MENU menu)
{
	switch (menu) {
		case EMF_MAIN_MENU:
			testapp_print ("[MAIN]# ");
			break;
			
		case EMF_ACCOUNT_MENU:
			testapp_print ("[ACCOUNT]# ");
			break;
			
		case EMF_MAIL_MENU:
			testapp_print ("[MAIL]# ");
			break;
			
		case EMF_MAILBOX_MENU:
			testapp_print ("[MAILBOX]# ");
			break;
			
		case EMF_RULE_MENU:
			testapp_print ("[RULE]# ");
			break;
			
		case EMF_THREAD_MENU:
			testapp_print ("[THREAD]# ");
			break;
			
		case EMF_OTHERS_MENU:
			testapp_print ("[OTHERS]# ");
			break;
			
		default:
			break;
	}
}