2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file ContactObjectA2PConverter.h
18 * @author Kisub Song (kisubs.song@samsung.com)
20 * @brief Converter (TizenApis::Api::Contact::ContactPtr -> CTSstruct*)
23 #ifndef _PLATFORM_CONTACT_CONTACT_OBJECT_A2P_CONVERTER_H_
24 #define _PLATFORM_CONTACT_CONTACT_OBJECT_A2P_CONVERTER_H_
27 #include <contacts-svc.h>
28 #include <dpl/shared_ptr.h>
29 #include <API/Contact/IContact.h>
35 class ContactObjectA2PConverter
38 ContactObjectA2PConverter(const TizenApis::Api::Contact::ContactPtr &abstractContact,
40 ContactObjectA2PConverter(const TizenApis::Api::Contact::ContactPtr &abstractContact,
42 CTSstruct* platformContact);
43 virtual ~ContactObjectA2PConverter();
45 CTSstruct* getPlatformContact();
48 void convertToPlatformObject();
50 void importBaseInfoValue();
51 void importBaseInfoValueToExistingValue(CTSvalue *ctsValue);
52 void importBaseInfoValueToNewValue(CTSvalue *ctsValue);
54 void importNameValue();
55 void importNameValueToExistingValue(CTSvalue *ctsValue,
56 TizenApis::Api::Contact::ContactNamePtr &contactName);
57 void importNameValueToNewValue(CTSvalue *ctsValue,
58 TizenApis::Api::Contact::ContactNamePtr &contactName);
60 void importCompanyValue();
61 void importCompanyValueToExistingValue(CTSvalue *ctsValue,
62 TizenApis::Api::Contact::ContactOrganizationPtr &contactOrganization);
63 void importCompanyValueToNewValue(CTSvalue *ctsValue,
64 TizenApis::Api::Contact::ContactOrganizationPtr &contactOrganization);
66 void importNoteValue();
67 void importNoteValueToExistingValue(CTSvalue *ctsValue);
68 void importNoteValueToNewValue(CTSvalue *ctsValue);
70 void importNumberList();
72 void importEmailList();
74 void importGrouprelList();
76 void importEventList();
77 GSList * importEventListBirthday(GSList *gsList);
78 GSList * importEventListAnniversary(GSList *gsList);
80 void importPostalList();
82 void importWebAddrList();
84 void importNicknameList();
86 TizenApis::Api::Contact::ContactPtr m_abstractContact;
87 CTSstruct* m_platformContact;
89 bool m_convertFinished;
90 bool m_platformContactOwnership;
92 typedef DPL::SharedPtr<ContactObjectA2PConverter> ContactObjectA2PConverterPtr;
98 #endif // _PLATFORM_CONTACT_CONTACT_ABSTRACT_OBJECT_WRAPPER_H_