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 ContactManager.h
18 * @author Lukasz Marek(l.marek@samsung.com)
22 #ifndef WRTDEVICEAPIS_CONTACT_CONTACT_WRAPPER_H_
23 #define WRTDEVICEAPIS_CONTACT_CONTACT_WRAPPER_H_
27 #include <contacts-svc.h>
28 #include <Contact/Contact.h>
29 #include <Contact/IAddressBook.h>
31 namespace WrtDeviceApis {
37 explicit ContactWrapper(Api::IAddressBookObject::BookType type);
38 virtual ~ContactWrapper();
39 Api::ContactPtr getAbstractContact() const;
40 void setAbstractContact(const Api::ContactPtr &contact);
41 CTSstruct* getPlatformContact() const;
42 //WARNING: calling this function will cause to store pointer inside private field
43 //Structure will be freed by this class when is not needed anymore.
44 //User should not modify nor free passed pointer.
45 void setPlatformContact(CTSstruct* contact);
48 bool convertToPlatformObject();
49 bool convertToAbstractObject();
51 Api::ContactPtr m_abstractContact;
52 CTSstruct* m_platformContact;
55 void freePlatformObject();
56 void freeAbstractObject();
57 bool convertToPlatformBaseData();
58 bool convertToPlatformAddressObject();
59 bool convertToPlatformEmailObject();
60 bool convertToPlatformPhoneObject();
61 bool convertToPlatformNicknameObject();
62 bool convertToPlatformPhoneticnameObject();
63 bool convertToPlatformGroupObject();
64 bool convertToAbstractBaseData();
65 bool convertToAbstractAddressObject();
66 bool convertToAbstractEmailObject();
67 bool convertToAbstractPhoneObject();
68 bool convertToAbstractNicknameObject();
69 bool convertToAbstractPhoneticnameObject();
70 bool convertToAbstractGroupObject();
71 int getCustomTypeInContactsSvc(const std::string &typeName) const;
72 //for debug purpose only
73 void printPlatformObject();
74 //for debug purpose only
75 void printAbstractObject();
78 typedef DPL::SharedPtr<ContactWrapper> ContactWrapperPtr;
83 #endif // WRTDEVICEAPIS_CONTACT_CONTACT_WRAPPER_H_