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.
18 * @file ContactManager.h
24 #ifndef _PLATFORM_CONTACT_CONTACT_WRAPPER_H_
25 #define _PLATFORM_CONTACT_CONTACT_WRAPPER_H_
29 #include <contacts-svc.h>
30 #include <API/Contact/IContact.h>
31 #include <API/Contact/IAddressBook.h>
40 explicit ContactWrapper(TizenApis::Api::Contact::IAddressBook::AddressBookType type);
41 virtual ~ContactWrapper();
43 TizenApis::Api::Contact::ContactPtr getAbstractContact() const;
44 void setAbstractContact(const TizenApis::Api::Contact::ContactPtr &contact, bool is_convert_vCard);
46 CTSstruct* getPlatformContact() const;
47 //WARNING: calling this function will cause to store pointer inside private field
48 //Structure will be freed by this class when is not needed anymore.
49 //User should not modify nor free passed pointer.
50 void setPlatformContact(CTSstruct* contact);
53 bool convertToPlatformObject(bool is_convert_vCard);
54 bool convertToAbstractObject();
56 TizenApis::Api::Contact::ContactPtr m_abstractContact;
57 CTSstruct* m_platformContact;
60 void freePlatformObject();
61 void freeAbstractObject();
63 bool convertToPlatformBaseData();
64 bool convertToPlatformAddressObject();
65 bool convertToPlatformEmailObject();
66 bool convertToPlatformPhoneObject();
67 bool convertToPlatformNicknameObject();
68 bool convertToPlatformPhoneticnameObject();
69 bool convertToPlatformGroupObject();
70 bool convertToPlatformUrlObject();
71 bool convertToPlatformOrganizationObject();
72 bool convertToPlatformAnniversaryObject();
73 bool convertToPlatformbirthdayObject();
75 bool convertToAbstractBaseData();
76 bool convertToAbstractAddressObject();
77 bool convertToAbstractEmailObject();
78 bool convertToAbstractPhoneObject();
79 bool convertToAbstractNicknameObject();
80 bool convertToAbstractPhoneticnameObject();
81 bool convertToAbstractGroupObject();
82 bool convertToAbstractUrlObject();
83 bool convertToAbstractOrganizationObject();
84 bool convertToAbstractAnniversaryObject();
85 bool convertToAbstractBirthdayObject();
87 int getCustomTypeInContactsSvc(const std::string &typeName) const;
88 //for debug purpose only
89 void printPlatformObject();
90 //for debug purpose only
91 void printAbstractObject();
93 std::string convertUriToPath(std::string str) const;
94 std::string convertPathToUri(std::string str) const;
97 typedef DPL::SharedPtr<ContactWrapper> ContactWrapperPtr;
103 #endif // _PLATFORM_CONTACT_CONTACT_WRAPPER_H_