4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JuHak Park <juhaki.park@samsung.com>,
7 * JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8 * SunBong Ha <sunbong.ha@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
29 * For any sort of issue you concern as to this software,
30 * you may use following point of contact.
31 * All resources contributed on this software
32 * are orinigally written by S-Core Inc., a member of Samsung Group.
34 * SeongWon Shim <seongwon.shim@samsung.com>
38 * @OMA_DS_Engine_Controller_Task.h
40 * @brief This file is the header file of registration function for using Engine Controller
43 #ifndef ENGINE_CONTROLLER_TASK_H_
44 #define ENGINE_CONTROLLER_TASK_H_
47 #include "agent-framework/EngineController/engine_controller.h"
48 #include "agent-framework/EngineController/task_spec.h"
49 #include "agent-framework/EngineController/queuing_rule_spec.h"
52 #define SYNC_MODE_MANUAL 0
53 #define SYNC_MODE_PERIODIC 1
54 #define SYNC_MODE_SAN 2
55 #define SYNC_MODE_AUTOCONFIG 3
57 typedef struct request_msg_info_s request_msg_info_t;
58 struct request_msg_info_s {
60 unsigned int request_id;
63 /*TODO have to be removed after removing vconf*/
64 #define EC_MSG_TYPE_SYNC_TASK_ADD_ACCOUNT 2
65 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_ACCOUNT "add_account"
66 #define EC_MSG_TYPE_SYNC_TASK_EDIT_ACCOUNT 3
67 #define EC_MSG_TYPE_NAME_SYNC_TASK_EDIT_ACCOUNT "edit_account"
68 #define EC_MSG_TYPE_SYNC_TASK_AUTOCONFIGURE 6
69 #define EC_MSG_TYPE_NAME_SYNC_TASK_AUTOCONFIGURE "auto_configure"
73 #define EC_MSG_TYPE_SYNC_TASK_REQUEST 1
74 #define EC_MSG_TYPE_NAME_SYNC_TASK_REQUEST "sync_request"
75 #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE 15 /*2*/
76 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE "add_profile"
77 #define EC_MSG_TYPE_SYNC_TASK_EDIT_PROFILE 16 /*3*/
78 #define EC_MSG_TYPE_NAME_SYNC_TASK_EDIT_PROFILE "edit_profile"
79 #define EC_MSG_TYPE_SYNC_TASK_DELETE_PROFILE 4
80 #define EC_MSG_TYPE_NAME_SYNC_TASK_DELETE_PROFILE "delete_profile"
81 #define EC_MSG_TYPE_SAN_TASK_REQUEST 5
82 #define EC_MSG_TYPE_NAME_SAN_TASK_REQUEST "SAN_request"
83 #define EC_MSG_TYPE_SYNC_TASK_AUTO_CONFIGURE 17 /*6*/
84 #define EC_MSG_TYPE_NAME_SYNC_TASK_AUTO_CONFIGURE "auto_configure"
85 #define EC_MSG_TYPE_SYNC_TASK_SYNCSTATUS 7
86 #define EC_MSG_TYPE_NAME_SYNC_TASK_SYNCSTATUS "sync_status"
87 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_NAME 8
88 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_NAME "get_profile_name"
89 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_SERVER_INFO 9
90 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_SERVER_INFO "get_profile_server_info"
91 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_SYNC_MODE 10
92 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_SYNC_MODE "get_profile_sync_mode"
93 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY 11
94 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY "get_profile_sync_category"
95 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_LAST_SESSION 12
96 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_LAST_SESSION "get_profile_last_session"
97 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_STATISTICS 13
98 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_STATISTICS "get_profile_statistics"
99 #define EC_MSG_TYPE_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES 14
100 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES "reset_synchronizing_profiles"
102 #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE_CP 19
103 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE_CP "add_profile_cp"
105 #define EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE 20
106 #define EC_MSG_TYPE_NAME_SYNC_TASK_REFRESH_FROM_SERVICE "refresh_from_service"
109 /*FIXME cancel request to NA */
111 #define EC_MSG_TYPE_SYNC_TASK_CANCEL_SYNC_REQUEST 18
112 #define EC_MSG_TYPE_NAME_SYNC_TASK_CANCEL_SYNC_REQUEST "cancel_sync_request"
116 * @par Description: API to create add account task
120 * @par Typical use case:
121 * @par Method of function operation:
122 * @par Important notes:
126 * @return task_spec_t structure on success
139 /*TODO have to be removed after removing vconf*/
140 task_spec_t *make_add_account_task();
143 * @par Description: API to create edit account task
147 * @par Typical use case:
148 * @par Method of function operation:
149 * @par Important notes:
153 * @return task_spec_t structure on success
166 /*TODO have to be removed after removing vconf*/
167 task_spec_t *make_edit_account_task();
170 * @par Description: API to create auto configure task
174 * @par Typical use case:
175 * @par Method of function operation:
176 * @par Important notes:
180 * @return task_spec_t structure on success
193 /*TODO have to be removed after removing vconf*/
194 task_spec_t *make_autoconfigure_task();
197 * @par Description: API to create synchronize task
201 * @par Typical use case:
202 * @par Method of function operation:
203 * @par Important notes:
207 * @return task_spec_t structure on success
220 task_spec_t *make_synchronize_task();
224 * @par Description: API to create synchronize task
228 * @par Typical use case:
229 * @par Method of function operation:
230 * @par Important notes:
234 * @return task_spec_t structure on success
247 task_spec_t *make_add_profile_task();
251 * @par Description: API to create edit profile task
255 * @par Typical use case:
256 * @par Method of function operation:
257 * @par Important notes:
261 * @return task_spec_t structure on success
274 task_spec_t *make_edit_profile_task();
277 * @par Description: API to create delete profiles task
281 * @par Typical use case:
282 * @par Method of function operation:
283 * @par Important notes:
287 * @return task_spec_t structure on success
300 task_spec_t *make_delete_profile_task();
303 * @par Description: API to create auto configure task
307 * @par Typical use case:
308 * @par Method of function operation:
309 * @par Important notes:
313 * @return task_spec_t structure on success
326 task_spec_t *make_auto_configure_task();
329 * @par Description: API to create sync status task
333 * @par Typical use case:
334 * @par Method of function operation:
335 * @par Important notes:
339 * @return task_spec_t structure on success
352 task_spec_t *make_sync_status_task();
356 * @par Description: API to create get profile name task
360 * @par Typical use case:
361 * @par Method of function operation:
362 * @par Important notes:
366 * @return task_spec_t structure on success
379 task_spec_t *make_get_profile_name_task();
382 * @par Description: API to create get profile server information task
386 * @par Typical use case:
387 * @par Method of function operation:
388 * @par Important notes:
392 * @return task_spec_t structure on success
405 task_spec_t *make_get_profile_server_info_task();
408 * @par Description: API to create get profile sync mode task
412 * @par Typical use case:
413 * @par Method of function operation:
414 * @par Important notes:
418 * @return task_spec_t structure on success
431 task_spec_t *make_get_profile_sync_mode_task();
435 * @par Description: API to create get profile sync category task
439 * @par Typical use case:
440 * @par Method of function operation:
441 * @par Important notes:
445 * @return task_spec_t structure on success
458 task_spec_t *make_get_profile_sync_category_task();
462 * @par Description: API to create get profile last session task
466 * @par Typical use case:
467 * @par Method of function operation:
468 * @par Important notes:
472 * @return task_spec_t structure on success
485 task_spec_t *make_get_profile_last_session_task();
488 * @par Description: API to create get profile last statistics task
492 * @par Typical use case:
493 * @par Method of function operation:
494 * @par Important notes:
498 * @return task_spec_t structure on success
511 task_spec_t *make_get_profile_statistics_task();
514 * @par Description: API to create reset synchronizing profiles task
518 * @par Typical use case:
519 * @par Method of function operation:
520 * @par Important notes:
524 * @return task_spec_t structure on success
537 task_spec_t *make_reset_synchronizing_profiles_task();
540 * @par Description: API to create reset synchronizing profiles task
544 * @par Typical use case:
545 * @par Method of function operation:
546 * @par Important notes:
550 * @return task_spec_t structure on success
563 task_spec_t *make_add_profile_cp_task();
567 * @par Description: API to create reset refresh_from_service task
571 * @par Typical use case:
572 * @par Method of function operation:
573 * @par Important notes:
577 * @return task_spec_t structure on success
590 task_spec_t *make_refresh_from_service_task();
594 /*FIXME cancel request to NA */
595 /*task_spec_t *make_cancel_sync_request();*/
599 * @par Description: This API is callback function which runs when add account task is requested
603 * @par Typical use case:
604 * @par Method of function operation:
605 * @par Important notes:
606 * @param[in] unsigned int type, parameter count
607 * @param[in] array of parameters
610 * @return TASK_ERROR_RUN_SUCCESS on success
611 * TASK_ERROR_RUN_FAILED on error
623 /*TODO have to be removed after removing vconf*/
624 task_error_t add_account_task_process(unsigned int param_cnt, param_t **param_array);
627 * @par Description: This API is callback function which runs when edit account task is requested
631 * @par Typical use case:
632 * @par Method of function operation:
633 * @par Important notes:
634 * @param[in] unsigned int type, parameter count
635 * @param[in] array of parameters
638 * @return TASK_ERROR_RUN_SUCCESS on success
639 * TASK_ERROR_RUN_FAILED on error
651 /*TODO have to be removed after removing vconf*/
652 task_error_t edit_account_task_process(unsigned int param_cnt, param_t **param_array);
655 * @par Description: This API is callback function which runs when auto configure task is requested
659 * @par Typical use case:
660 * @par Method of function operation:
661 * @par Important notes:
662 * @param[in] unsigned int type, parameter count
663 * @param[in] array of parameters
666 * @return TASK_ERROR_RUN_SUCCESS on success
667 * TASK_ERROR_RUN_FAILED on error
679 /*TODO have to be removed after removing vconf*/
680 task_error_t autoconfigure_task_process(unsigned int param_cnt, param_t **param_array);
683 * @par Description: This API is callback function which runs when synchronize task is requested
687 * @par Typical use case:
688 * @par Method of function operation:
689 * @par Important notes:
690 * @param[in] unsigned int type, parameter count
691 * @param[in] array of parameters
694 * @return TASK_ERROR_RUN_SUCCESS on success
695 * TASK_ERROR_RUN_FAILED on error
707 task_error_t synchronize_task_process(unsigned int param_cnt, param_t **param_array);
710 * @par Description: This API is callback function which runs when add profile task is requested
714 * @par Typical use case:
715 * @par Method of function operation:
716 * @par Important notes:
717 * @param[in] unsigned int type, parameter count
718 * @param[in] array of parameters
721 * @return TASK_ERROR_RUN_SUCCESS on success
722 * TASK_ERROR_RUN_FAILED on error
734 task_error_t add_profile_task_process(unsigned int param_cnt, param_t **param_array);
737 * @par Description: This API is callback function which runs when edit profile task is requested
741 * @par Typical use case:
742 * @par Method of function operation:
743 * @par Important notes:
744 * @param[in] unsigned int type, parameter count
745 * @param[in] array of parameters
748 * @return TASK_ERROR_RUN_SUCCESS on success
749 * TASK_ERROR_RUN_FAILED on error
761 task_error_t edit_profile_task_process(unsigned int param_cnt, param_t **param_array);
764 * @par Description: This API is callback function which runs when delete profiles task is requested
768 * @par Typical use case:
769 * @par Method of function operation:
770 * @par Important notes:
771 * @param[in] unsigned int type, parameter count
772 * @param[in] array of parameters
775 * @return TASK_ERROR_RUN_SUCCESS on success
776 * TASK_ERROR_RUN_FAILED on error
788 task_error_t delete_profile_task_process(unsigned int param_cnt, param_t **param_array);
791 * @par Description: This API is callback function which runs when auto configure task is requested
795 * @par Typical use case:
796 * @par Method of function operation:
797 * @par Important notes:
798 * @param[in] unsigned int type, parameter count
799 * @param[in] array of parameters
802 * @return TASK_ERROR_RUN_SUCCESS on success
803 * TASK_ERROR_RUN_FAILED on error
815 task_error_t auto_configure_task_process(unsigned int param_cnt, param_t **param_array);
818 * @par Description: This API is callback function which runs when sync status task is requested
822 * @par Typical use case:
823 * @par Method of function operation:
824 * @par Important notes:
825 * @param[in] unsigned int type, parameter count
826 * @param[in] array of parameters
829 * @return TASK_ERROR_RUN_SUCCESS on success
830 * TASK_ERROR_RUN_FAILED on error
842 task_error_t sync_status_task_process(unsigned int param_cnt, param_t **param_array);
845 * @par Description: This API is callback function which runs when get profile name task is requested
849 * @par Typical use case:
850 * @par Method of function operation:
851 * @par Important notes:
852 * @param[in] unsigned int type, parameter count
853 * @param[in] array of parameters
856 * @return TASK_ERROR_RUN_SUCCESS on success
857 * TASK_ERROR_RUN_FAILED on error
869 task_error_t get_profile_name_task_process(unsigned int param_cnt, param_t **param_array);
872 * @par Description: This API is callback function which runs when get profile server information task is requested
876 * @par Typical use case:
877 * @par Method of function operation:
878 * @par Important notes:
879 * @param[in] unsigned int type, parameter count
880 * @param[in] array of parameters
883 * @return TASK_ERROR_RUN_SUCCESS on success
884 * TASK_ERROR_RUN_FAILED on error
896 task_error_t get_profile_server_info_task_process(unsigned int param_cnt, param_t **param_array);
899 * @par Description: This API is callback function which runs when get profile sync mode task is requested
903 * @par Typical use case:
904 * @par Method of function operation:
905 * @par Important notes:
906 * @param[in] unsigned int type, parameter count
907 * @param[in] array of parameters
910 * @return TASK_ERROR_RUN_SUCCESS on success
911 * TASK_ERROR_RUN_FAILED on error
923 task_error_t get_profile_sync_mode_task_process(unsigned int param_cnt, param_t **param_array);
926 * @par Description: This API is callback function which runs when get profile sync category task is requested
930 * @par Typical use case:
931 * @par Method of function operation:
932 * @par Important notes:
933 * @param[in] unsigned int type, parameter count
934 * @param[in] array of parameters
937 * @return TASK_ERROR_RUN_SUCCESS on success
938 * TASK_ERROR_RUN_FAILED on error
950 task_error_t get_profile_sync_category_task_process(unsigned int param_cnt, param_t **param_array);
953 * @par Description: This API is callback function which runs when get profile last session task is requested
957 * @par Typical use case:
958 * @par Method of function operation:
959 * @par Important notes:
960 * @param[in] unsigned int type, parameter count
961 * @param[in] array of parameters
964 * @return TASK_ERROR_RUN_SUCCESS on success
965 * TASK_ERROR_RUN_FAILED on error
977 task_error_t get_profile_last_session_task_process(unsigned int param_cnt, param_t **param_array);
980 * @par Description: This API is callback function which runs when get profile last statistics task is requested
984 * @par Typical use case:
985 * @par Method of function operation:
986 * @par Important notes:
987 * @param[in] unsigned int type, parameter count
988 * @param[in] array of parameters
991 * @return TASK_ERROR_RUN_SUCCESS on success
992 * TASK_ERROR_RUN_FAILED on error
1004 task_error_t get_profile_statistics_task_process(unsigned int param_cnt, param_t **param_array);
1007 * @par Description: This API is callback function which runs when reset synchronizing profiles task is requested
1011 * @par Typical use case:
1012 * @par Method of function operation:
1013 * @par Important notes:
1014 * @param[in] unsigned int type, parameter count
1015 * @param[in] array of parameters
1018 * @return TASK_ERROR_RUN_SUCCESS on success
1019 * TASK_ERROR_RUN_FAILED on error
1031 task_error_t reset_synchronizing_profiles_task_process(unsigned int param_cnt, param_t **param_array);
1033 /*FIXME cancel request to NA */
1034 /*task_error_t cancel_sync_request_task_process(unsigned int param_cnt, param_t **param_array);*/
1037 * @par Description: This API is callback function which runs when add profile for cp task is requested
1041 * @par Typical use case:
1042 * @par Method of function operation:
1043 * @par Important notes:
1044 * @param[in] unsigned int type, parameter count
1045 * @param[in] array of parameters
1048 * @return TASK_ERROR_RUN_SUCCESS on success
1049 * TASK_ERROR_RUN_FAILED on error
1061 task_error_t add_profile_cp_task_process(unsigned int param_cnt, param_t **param_array);
1066 * @par Description: This API is callback function which runs when refresh_from_service task is requested
1070 * @par Typical use case:
1071 * @par Method of function operation:
1072 * @par Important notes:
1073 * @param[in] unsigned int type, parameter count
1074 * @param[in] array of parameters
1077 * @return TASK_ERROR_RUN_SUCCESS on success
1078 * TASK_ERROR_RUN_FAILED on error
1090 task_error_t refresh_from_service_task_process(unsigned int param_cnt, param_t **param_array);
1093 * @par Description: API to insert request_msg_info_t structure into list
1097 * @par Typical use case:
1098 * @par Method of function operation:
1099 * @par Important notes:
1100 * @param[in] sync_type(SYNC_MODE_MANUAL, SYNC_MODE_PERIODIC, SYNC_MODE_SAN, SYNC_MODE_AUTOCONFIG)
1101 * @param[in] request id
1117 void insert_request_msg_info(int sync_type, unsigned int request_id);
1120 * @par Description: API to delete request_msg_info_t structure from list
1124 * @par Typical use case:
1125 * @par Method of function operation:
1126 * @par Important notes:
1127 * @param[in] request id
1143 void delete_request_msg_info(unsigned int request_id);
1146 * @par Description: API to get synchronizing request id and delete request_msg_info_t structure from list
1150 * @par Typical use case:
1151 * @par Method of function operation:
1152 * @par Important notes:
1154 * @param[out] request id
1156 * @return true on success
1170 bool get_synchronizing_request_id(unsigned int *pRequest_id);
1173 * @par Description: API to get manual sync request id and delete request_msg_info_t structure from list
1177 * @par Typical use case:
1178 * @par Method of function operation:
1179 * @par Important notes:
1181 * @param[out] request id
1183 * @return true on success
1197 bool get_manual_sync_request_id(unsigned int *pRequest_id);
1200 * @par Description: API to get periodic sync request id and delete request_msg_info_t structure from list
1204 * @par Typical use case:
1205 * @par Method of function operation:
1206 * @par Important notes:
1208 * @param[out] request id
1210 * @return true on success
1224 bool get_periodic_sync_request_id(unsigned int *pRequest_id);
1227 * @par Description: API to get SAN sync request id and delete request_msg_info_t structure from list
1231 * @par Typical use case:
1232 * @par Method of function operation:
1233 * @par Important notes:
1235 * @param[out] request id
1237 * @return true on success
1251 bool get_san_sync_request_id(unsigned int *pRequest_id);
1254 * @par Description: API to get auto configure sync request id and delete request_msg_info_t structure from list
1258 * @par Typical use case:
1259 * @par Method of function operation:
1260 * @par Important notes:
1262 * @param[out] request id
1264 * @return true on success
1278 bool get_auto_configure_request_id(unsigned int *pRequest_id);
1280 #endif /* ENGINE_CONTROLLER_TASK_H_ */