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>
40 * @brief This file is the header file of interface for common structure
43 #ifndef COMMON_DEFINE_H_
44 #define COMMON_DEFINE_H_
46 #include "Common_Define_Internal.h"
49 * @par Description: API to create DatastoreInfo structure
53 * @par Typical use case:
54 * @par Method of function operation:
55 * @par Important notes:
56 * @param[in] string type, target uri
57 * @param[in] string type, source uri
58 * @param[out] Status structure
60 * @return DatastoreInfo on success
74 DatastoreInfo *create_datastoreinfo(char *target, char *source);
78 * @par Description: API to free list of DatastoreInfo structure
82 * @par Typical use case:
83 * @par Method of function operation:
84 * @par Important notes:
85 * @param[in] list of DatastoreInfo structure
101 void free_datastoreinfos(GList *pDatastoreInfos);
105 * @par Description: API to free DatastoreInfo structure
109 * @par Typical use case:
110 * @par Method of function operation:
111 * @par Important notes:
112 * @param[in] DatastoreInfo structure
128 void free_datastoreinfo(DatastoreInfo *pDatastoreInfo);
131 * @par Description: API to set sync type in DatastoreInfo structure
135 * @par Typical use case:
136 * @par Method of function operation:
137 * @par Important notes:
138 * @param[in] DatastoreInfo structure
139 * @param[in] enum type, sync type
155 void set_datastoreInfo_synctype(DatastoreInfo *datastoreInfo, AlertType syncType);
158 * @par Description: API to set last anchor in DatastoreInfo structure
162 * @par Typical use case:
163 * @par Method of function operation:
164 * @par Important notes:
165 * @param[in] DatastoreInfo structure
166 * @param[in] string type, last anchor
182 void set_datastoreinfo_lastanchor(DatastoreInfo *datastoreInfo, char *lastAnchor);
185 * @par Description: API to set next anchor in DatastoreInfo structure
189 * @par Typical use case:
190 * @par Method of function operation:
191 * @par Important notes:
192 * @param[in] DatastoreInfo structure
193 * @param[in] string type, next anchor
209 void set_datastoreinfo_nextanchor(DatastoreInfo *datastoreInfo, char *nextAnchor);
212 * @par Description: API to set maxobjsize in DatastoreInfo structure
216 * @par Typical use case:
217 * @par Method of function operation:
218 * @par Important notes:
219 * @param[in] DatastoreInfo structure
220 * @param[in] unsigned int, maxobjsize
236 void set_datastoreinfo_maxobjsize(DatastoreInfo *datastoreInfo, unsigned int maxObjSize);
239 * @par Description: API to create ChangedItem structure
243 * @par Typical use case:
244 * @par Method of function operation:
245 * @par Important notes:
246 * @param[in] enum type, change type of item
247 * @param[in] string type, luid of item
250 * @return ChangedItem on success
264 ChangedItem *create_changeditem(ChangeType type, char *luid);
267 * @par Description: API to free ChangedItem structure
271 * @par Typical use case:
272 * @par Method of function operation:
273 * @par Important notes:
274 * @param[in] ChangedItem structure
290 void free_changeditem(ChangedItem *pChangedItem);
294 * @par Description: API to set content type in ChangedItem structure
298 * @par Typical use case:
299 * @par Method of function operation:
300 * @par Important notes:
301 * @param[in] ChangedItem structure
302 * @param[in] string type, content type
318 void set_changeditem_contenttype(ChangedItem *pChangedItem, char *content_type);
321 * @par Description: API to set data in ChangedItem structure
325 * @par Typical use case:
326 * @par Method of function operation:
327 * @par Important notes:
328 * @param[in] ChangedItem structure
329 * @param[in] string type, data
345 void set_changeditem_data(ChangedItem *changedItem, char *data);
348 * @par Description: API to set in ChangedItem structure
352 * @par Typical use case:
353 * @par Method of function operation:
354 * @par Important notes:
355 * @param[in] ChangedItem structure
356 * @param[in] datastore index(0=contacts, 1=calendar, 2= memo)
372 void set_changedItem_indexofdatastore(ChangedItem *changedItem, unsigned int indexOfDatastore);
375 * @par Description: API to create ChangedDatastore structure
379 * @par Typical use case:
380 * @par Method of function operation:
381 * @par Important notes:
382 * @param[in] string type, source uri
383 * @param[in] string type, target uri
384 * @param[in] int type, has numberOfChanges or not
385 * @param[in] unsigned int type, if numberOfChanges is true set count else set zero
388 * @return ChangedDatastore on success
402 ChangedDatastore *create_changeddatastore(char *source, char *target, int hasNumberOfChanges, unsigned int numberOfChanges);
405 * @par Description: API to free list of ChangedDatastore
409 * @par Typical use case:
410 * @par Method of function operation:
411 * @par Important notes:
412 * @param[in] list of ChangedDatastore
428 void free_changeddatastores(GList *pChangedDatastores);
431 * @par Description: API to free ChangedDatastore structure
435 * @par Typical use case:
436 * @par Method of function operation:
437 * @par Important notes:
438 * @param[in] ChangedDatastore structure
454 void free_changeddatastore(ChangedDatastore *pChangedDatastore);
457 * @par Description: API to set changedItem in ChangedDatastore structure
461 * @par Typical use case:
462 * @par Method of function operation:
463 * @par Important notes:
464 * @param[in] ChangedDatastore structure
465 * @param[in] list of ChangedItem structure
481 void set_changeddatastore_changeditem(ChangedDatastore *changedDatastore, GList *changedItem);
484 * @par Description: API to add changedItem in ChangedDatastore structure
488 * @par Typical use case:
489 * @par Method of function operation:
490 * @par Important notes:
491 * @param[in] ChangedDatastore structure
492 * @param[in] ChangedItem structure
508 void add_changeddatastore_changeditem(ChangedDatastore *changedDatastore, ChangedItem *changedItem);
511 * @par Description: API to create AppliedStatus structure
515 * @par Typical use case:
516 * @par Method of function operation:
517 * @par Important notes:
518 * @param[in] string type, luid of item
519 * @param[in] enum type, change type( CHANGE_ADD , CHANGE_REPLACE , CHANGE_DELETE)
520 * @param[in] int type, status code(200....)
523 * @return AppliedStatus on success
537 AppliedStatus *create_appliedstatus(char *luid, ChangeType changeType, int status);
540 * @par Description: API to free list of AppliedStatus structure
544 * @par Typical use case:
545 * @par Method of function operation:
546 * @par Important notes:
547 * @param[in] list of AppliedStatus structure
563 void free_appliedstatuses(GList *pAppliedStatuses);
566 * @par Description: API to free AppliedStatus structure
570 * @par Typical use case:
571 * @par Method of function operation:
572 * @par Important notes:
573 * @param[in] AppliedStatus structure
589 void free_appliedstatus(AppliedStatus *pAppliedStatus);
592 * @par Description: API to create SendingStatus structure
596 * @par Typical use case:
597 * @par Method of function operation:
598 * @par Important notes:
599 * @param[in] source uri
600 * @param[in] target uri
603 * @return SendingStatus on success
617 SendingStatus *create_sendingstatus(char *source, char *target);
620 * @par Description: API to free list of SendingStatus structure
624 * @par Typical use case:
625 * @par Method of function operation:
626 * @par Important notes:
627 * @param[in] list of SendingStatus structure
643 void free_sendingstatuses(GList *pSendingStatuses);
646 * @par Description: API to free SendingStatus structure
650 * @par Typical use case:
651 * @par Method of function operation:
652 * @par Important notes:
653 * @param[in] SendingStatus structure
669 void free_sendingstatus(SendingStatus *pSendingStatus);
672 * @par Description: API to add AppliedStatus in SendingStatus structure
676 * @par Typical use case:
677 * @par Method of function operation:
678 * @par Important notes:
679 * @param[in] SendingStatus structure
680 * @param[in] AppliedStatus structure
696 void add_sendingstatus_appliedstatus(SendingStatus *sendingStatus, AppliedStatus *appliedStatus);
699 * @par Description: API to create Datastore structure
703 * @par Typical use case:
704 * @par Method of function operation:
705 * @par Important notes:
706 * @param[in] string type, target uri
707 * @param[in] string type, source uri
710 * @return Datastore on success
724 Datastore *create_datastore(char *target, char *source);
727 * @par Description: API to set content type infomation in Datastore structure
731 * @par Typical use case:
732 * @par Method of function operation:
733 * @par Important notes:
734 * @param[in] Datastore structure
735 * @param[in] int type, datastore_id(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
736 * @param[in] int type, folder_type_id(9, 8, 10)
752 void set_datastore_contenttype_info(Datastore *datastore, int datastore_id, int folder_type_id);
755 * @par Description: API to set account information in Datastore structure
759 * @par Typical use case:
760 * @par Method of function operation:
761 * @par Important notes:
762 * @param[in] Datastore structure
763 * @param[in] string type, account_id
764 * @param[in] string type, account_pw
780 void set_datastore_account_info(Datastore *datastore, char *account_id, char *account_pw);
783 * @par Description: API to set client sync type in Datastore structure
787 * @par Typical use case:
788 * @par Method of function operation:
789 * @par Important notes:
790 * @param[in] Datastore structure
791 * @param[in] enum type, sync type
807 void set_datastore_client_sync_type(Datastore *datastore, AlertType syncType);
810 * @par Description: API to set server sync type in Datastore structure
814 * @par Typical use case:
815 * @par Method of function operation:
816 * @par Important notes:
817 * @param[in] Datastore structure
818 * @param[in] enum type, sync type
834 void set_datastore_server_sync_type(Datastore *datastore, AlertType syncType);
838 * @par Description: API to set client anchor in Datastore structure
842 * @par Typical use case:
843 * @par Method of function operation:
844 * @par Important notes:
845 * @param[in] Datastore structure
846 * @param[in] string type, last anchor
847 * @param[in] string type, next anchor
863 void set_datastore_client_anchor(Datastore *datastore, char *lastAnchor, char *nextAnchor);
866 * @par Description: API to set client anchor in Datastore structure
870 * @par Typical use case:
871 * @par Method of function operation:
872 * @par Important notes:
873 * @param[in] Datastore structure
874 * @param[in] string type, last anchor
875 * @param[in] string type, next anchor
891 void set_datastore_server_anchor(Datastore *datastore, char *lastAnchor, char *nextAnchor);
894 * @par Description: API to create SyncResult structure
898 * @par Typical use case:
899 * @par Method of function operation:
900 * @par Important notes:
901 * @param[in] Datastore structure
902 * @param[in] string type, last anchor
903 * @param[in] string type, next anchor
906 * @return SyncResult on success
920 SyncResult *create_sync_result();
923 * @par Description: API to duplicate SyncResult structure
927 * @par Typical use case:
928 * @par Method of function operation:
929 * @par Important notes:
930 * @param[in] SyncResult structure
933 * @return SyncResult on success
947 SyncResult *dup_syncresult(SyncResult *orgSyncResult);
950 * @par Description: API to set number of total item in SyncResult structure
954 * @par Typical use case:
955 * @par Method of function operation:
956 * @par Important notes:
957 * @param[in] SyncResult structure
958 * @param[in] number of total item
974 void set_numberofchange(SyncResult *syncResult, unsigned int numberOfChange);
977 * @par Description: API to set number of received item in SyncResult structure
981 * @par Typical use case:
982 * @par Method of function operation:
983 * @par Important notes:
984 * @param[in] SyncResult structure
985 * @param[in] number of received item
1001 void add_receive_count(SyncResult *syncResult, unsigned int received_count);
1004 * @par Description: API to set number of add item in SyncResult structure
1008 * @par Typical use case:
1009 * @par Method of function operation:
1010 * @par Important notes:
1011 * @param[in] SyncResult structure
1012 * @param[in] number of add item
1028 void add_add_count(SyncResult *syncResult, unsigned int add_cnt);
1031 * @par Description: API to set number of replace item in SyncResult structure
1035 * @par Typical use case:
1036 * @par Method of function operation:
1037 * @par Important notes:
1038 * @param[in] SyncResult structure
1039 * @param[in] number of replace item
1055 void add_replace_count(SyncResult *syncResult, unsigned int replace_cnt);
1058 * @par Description: API to set number of delete item in SyncResult structure
1062 * @par Typical use case:
1063 * @par Method of function operation:
1064 * @par Important notes:
1065 * @param[in] SyncResult structure
1066 * @param[in] number of delete item
1082 void add_delete_count(SyncResult *syncResult, unsigned int delete_cnt);
1085 * @par Description: API to free PreSyncReturnObj structure
1089 * @par Typical use case:
1090 * @par Method of function operation:
1091 * @par Important notes:
1092 * @param[in] PreSyncReturnObj structure
1108 void free_presyncreturnobj(PreSyncReturnObj *pPreSyncReturnObj);
1111 * @par Description: API to free SyncObj structure
1115 * @par Typical use case:
1116 * @par Method of function operation:
1117 * @par Important notes:
1118 * @param[in] SyncObj structure
1134 void free_syncobj(SyncObj *pSyncObj);
1137 * @par Description: API to free SyncReturnObj structure
1141 * @par Typical use case:
1142 * @par Method of function operation:
1143 * @par Important notes:
1144 * @param[in] SyncReturnObj structure
1160 void free_syncreturnobj(SyncReturnObj *pSyncReturnObj);
1163 * @par Description: API to free Datastore structure
1167 * @par Typical use case:
1168 * @par Method of function operation:
1169 * @par Important notes:
1170 * @param[in] Datastore structure
1186 void free_datastore(Datastore *pDatastore);
1189 #endif /* COMMON_DEFINE_H_ */