Update change log and spec for wrt-plugins-tizen_0.4.11
[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 setNumbersJSObj(bool value, JSObjectRef initObj);
49         bool numbersJSObjIsSet() const;
50         JSObjectRef getNumbersJSObj();
51         JSValueRef getNumbersJSValue();
52
53         void setEmailsJSObj(bool value, JSObjectRef initObj);
54         bool EmailsJSObjIsSet() const;
55         JSObjectRef getEmailsJSObj();
56         JSValueRef getEmailsJSValue();
57
58         void setAnniversariesJSObj(bool value, JSObjectRef initObj);
59         bool anniversariesJSObjIsSet() const;
60         JSObjectRef getAnniversariesJSObj();
61         JSValueRef getAnniversariesJSValue();
62
63         void setUrlsJSObj(bool value, JSObjectRef initObj);
64         bool urlsJSObjIsSet() const;
65         JSObjectRef getUrlsJSObj();
66         JSValueRef getUrlsJSValue();
67
68         void setAddressesJSObj(bool value, JSObjectRef initObj);
69         bool addressesJSObjIsSet() const;
70         JSObjectRef getAddressesJSObj();
71         JSValueRef getAddressesJSValue();
72
73         void setOrganizationsJSObj(bool value, JSObjectRef initObj);
74         bool organizationsJSObjIsSet() const;
75         JSObjectRef getOrganizationsJSObj();
76         JSValueRef getOrganizationsJSValue();
77
78         void setNotesJSObj(bool value, JSObjectRef initObj);
79         bool notesJSObjIsSet() const;
80         JSObjectRef getNotesJSObj();
81         JSValueRef getNotesJSValue();
82
83         void setGroupIdsJSObj(bool value, JSObjectRef initObj);
84         bool groupIdsJSObjIsSet() const;
85         JSObjectRef getGroupIdsJSObj();
86         JSValueRef getGroupIdsJSValue();
87
88         void setContext(JSContextRef contextRef);
89         JSContextRef getContext();
90
91 private:
92         contacts_record_h m_platformContactObject;
93         contacts_list_h m_platformContactObjectList;
94
95         bool m_numbersJSObjIsSet;
96         JSObjectRef m_numbersObj;
97         JSValueRef m_numbersJSValue;
98
99         bool m_emailsJSObjIsSet;
100         JSObjectRef m_emailsObj;
101         JSValueRef m_emailsJSValue;
102
103         bool m_anniversariesJSObjIsSet;
104         JSObjectRef m_anniversariesObj;
105         JSValueRef m_anniversariesJSValue;
106
107         bool m_urlsJSObjIsSet;
108         JSObjectRef m_urlsObj;
109         JSValueRef m_urlsJSValue;
110
111         bool m_addressesJSObjIsSet;
112         JSObjectRef m_addressesObj;
113         JSValueRef m_addressesJSValue;
114
115         bool m_organizationsJSObjIsSet;
116         JSObjectRef m_organizationsObj;
117         JSValueRef m_organizationsJSValue;
118
119         bool m_notesJSObjIsSet;
120         JSObjectRef m_notesObj;
121         JSValueRef m_notesJSValue;
122
123         bool m_groupIdsJSObjIsSet;
124         JSObjectRef m_groupIdsObj;
125         JSValueRef m_groupIdsJSValue;
126
127         JSContextRef m_context;
128 };
129
130 } // Contact
131 } // DeviceAPI
132
133 #endif // _PLATFORM_CONTACT_CONTACT_H_