Update change log and spec for wrt-plugins-tizen_0.2.71
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Contact / ContactObjectA2PConverter.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @file        ContactObjectA2PConverter.h
18  * @author      Kisub Song (kisubs.song@samsung.com)
19  * @version     0.1
20  * @brief       Converter (TizenApis::Api::Contact::ContactPtr -> CTSstruct*)
21  */
22
23 #ifndef _PLATFORM_CONTACT_CONTACT_OBJECT_A2P_CONVERTER_H_
24 #define _PLATFORM_CONTACT_CONTACT_OBJECT_A2P_CONVERTER_H_
25
26 #include <string>
27 #include <contacts-svc.h>
28 #include <dpl/shared_ptr.h>
29 #include <API/Contact/IContact.h>
30
31 namespace TizenApis {
32 namespace Platform {
33 namespace Contact {
34
35 class ContactObjectA2PConverter
36 {
37 public:
38         ContactObjectA2PConverter(const TizenApis::Api::Contact::ContactPtr &abstractContact,
39                               bool forScratch);
40         ContactObjectA2PConverter(const TizenApis::Api::Contact::ContactPtr &abstractContact,
41                                   bool forScratch,
42                                   CTSstruct* platformContact);
43         virtual ~ContactObjectA2PConverter();
44
45         CTSstruct* getPlatformContact();
46
47 protected:
48         void convertToPlatformObject();
49
50         void importBaseInfoValue();
51         void importBaseInfoValueToExistingValue(CTSvalue *ctsValue);
52         void importBaseInfoValueToNewValue(CTSvalue *ctsValue);
53
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);
59
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);
65
66         void importNoteValue();
67         void importNoteValueToExistingValue(CTSvalue *ctsValue);
68         void importNoteValueToNewValue(CTSvalue *ctsValue);
69
70         void importNumberList();
71
72         void importEmailList();
73
74         void importGrouprelList();
75
76         void importEventList();
77         GSList * importEventListBirthday(GSList *gsList);
78         GSList * importEventListAnniversary(GSList *gsList);
79
80         void importPostalList();
81
82         void importWebAddrList();
83
84         void importNicknameList();
85
86         TizenApis::Api::Contact::ContactPtr m_abstractContact;
87         CTSstruct*                          m_platformContact;
88         bool                                m_forScratch;
89         bool                                m_convertFinished;
90         bool                                m_platformContactOwnership;
91 };
92 typedef DPL::SharedPtr<ContactObjectA2PConverter> ContactObjectA2PConverterPtr;
93
94 } // Contact
95 } // Platform
96 } // TizenApis
97
98 #endif // _PLATFORM_CONTACT_CONTACT_ABSTRACT_OBJECT_WRAPPER_H_