1f797e29f4f37a07efdab5d12adee2f05e20dd09
[framework/web/wrt-plugins-tizen.git] / src / Contact / Contact.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        Contact.h
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief
23  */
24
25 #ifndef _PLATFORM_CONTACT_CONTACT_H_
26 #define _PLATFORM_CONTACT_CONTACT_H_
27
28 #include <string>
29 #include <vector>
30 #include <contacts.h>
31 #include "IContact.h"
32
33 namespace DeviceAPI {
34 namespace Contact {
35
36 class Contact : public IContact
37 {
38 public:
39         Contact();
40         virtual ~Contact();
41
42         virtual std::string convertToString(const std::string &format);
43
44         virtual void setContactFromString(const std::string &vObjectStr);
45
46         contacts_record_h getPlatformContactObject() const { return m_platformContactObject; };
47
48         void setNotesJSObj(bool value, JSObjectRef initObj);
49         bool notesJSObjIsSet() const;
50         JSObjectRef getNotesJSObj();
51         JSValueRef getNotesJSValue();
52
53         void setGroupIdsJSObj(bool value, JSObjectRef initObj);
54         bool groupIdsJSObjIsSet() const;
55         JSObjectRef getGroupIdsJSObj();
56         JSValueRef getGroupIdsJSValue();
57
58         void setContext(JSContextRef contextRef);
59         JSContextRef getContext();
60
61 private:
62         contacts_record_h m_platformContactObject;
63         contacts_list_h m_platformContactObjectList;
64
65         bool m_notesJSObjIsSet;
66         JSObjectRef m_notesObj;
67         JSValueRef m_notesJSValue;
68
69         bool m_groupIdsJSObjIsSet;
70         JSObjectRef m_groupIdsObj;
71         JSValueRef m_groupIdsJSValue;
72
73         JSContextRef m_context;
74 };
75
76 } // Contact
77 } // DeviceAPI
78
79 #endif // _PLATFORM_CONTACT_CONTACT_H_