4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
33 #include "email-api-account.h"
34 #include "email-api-mail.h"
37 #include "testapp-utility.h"
38 #include "testapp-thread.h"
40 static gboolean testapp_test_move_thread()
42 int thread_id, move_always_flag;
43 int target_mailbox_id;
45 int result_from_scanf = 0;
47 testapp_print("\n > Enter thread_id: ");
48 result_from_scanf = scanf("%d", &thread_id);
50 testapp_print("\n > Enter target_mailbox_id: ");
51 result_from_scanf = scanf("%d", &target_mailbox_id);
53 testapp_print("\n > Enter move_always_flag: ");
54 result_from_scanf = scanf("%d", &move_always_flag);
56 result = email_move_thread_to_mailbox(thread_id, target_mailbox_id, move_always_flag);
61 static gboolean testapp_test_delete_thread()
63 int thread_id, delete_always_flag;
65 int result_from_scanf = 0;
67 testapp_print("\n > Enter thread_id: ");
68 result_from_scanf = scanf("%d", &thread_id);
70 testapp_print("\n > Enter delete_always_flag: ");
71 result_from_scanf = scanf("%d", &delete_always_flag);
73 result = email_delete_thread(thread_id, delete_always_flag);
78 static gboolean testapp_test_set_seen_flag_of_thread()
80 int thread_id, seen_flag, on_server;
82 int result_from_scanf = 0;
84 testapp_print("\n > Enter thread_id: ");
85 result_from_scanf = scanf("%d", &thread_id);
87 testapp_print("\n > Enter seen_flag: ");
88 result_from_scanf = scanf("%d", &seen_flag);
90 testapp_print("\n > Enter on_server: ");
91 result_from_scanf = scanf("%d", &on_server);
93 result = email_modify_seen_flag_of_thread(thread_id, seen_flag, on_server);
98 static gboolean testapp_test_interpret_command (int menu_number)
100 gboolean go_to_loop = TRUE;
102 switch (menu_number) {
104 testapp_test_move_thread();
108 testapp_test_delete_thread();
112 testapp_test_set_seen_flag_of_thread();
125 void testapp_thread_main()
127 gboolean go_to_loop = TRUE;
129 int result_from_scanf = 0;
132 testapp_show_menu (EMAIL_THREAD_MENU);
133 testapp_show_prompt (EMAIL_THREAD_MENU);
135 result_from_scanf = scanf("%d", &menu_number);
137 go_to_loop = testapp_test_interpret_command (menu_number);