Update change log and spec for wrt-plugins-tizen_0.4.49
[framework/web/wrt-plugins-tizen.git] / src / Contact / ContactName.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        ContactName.h
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief
23  */
24
25 #ifndef _API_CONTACT_CONTACT_NAME_H_
26 #define _API_CONTACT_CONTACT_NAME_H_
27
28 #include <vector>
29 #include <string>
30 #include <dpl/shared_ptr.h>
31 #include <JavaScriptCore/JavaScript.h>
32 #include "ContactTypes.h"
33
34 namespace DeviceAPI {
35 namespace Contact {
36
37 class ContactName;
38 typedef DPL::SharedPtr<ContactName> ContactNamePtr;
39
40 typedef std::vector<ContactNamePtr> ContactNameArray;
41 typedef DPL::SharedPtr<ContactNameArray> ContactNameArrayPtr;
42
43 class ContactName
44 {
45 public:
46         ContactName();
47         virtual ~ContactName();
48
49         std::string getPrefix() const;
50         void setPrefix(const std::string &value);
51         void unsetPrefix();
52         bool getPrefixIsSet() const;
53
54         std::string getSuffix() const;
55         void setSuffix(const std::string &value);
56         void unsetSuffix();
57         bool getSuffixIsSet() const;
58
59         std::string getFirstName() const;
60         void setFirstName(const std::string &value);
61         void unsetFirstName();
62         bool getFirstNameIsSet() const;
63
64         std::string getMiddleName() const;
65         void setMiddleName(const std::string &value);
66         void unsetMiddleName();
67         bool getMiddleNameIsSet() const;
68
69         std::string getLastName() const;
70         void setLastName(const std::string &value);
71         void unsetLastName();
72         bool getLastNameIsSet() const;
73
74         StringArrayPtr getNicknames() const;
75         void setNicknames(const StringArrayPtr &value);
76         void addNickname(const std::string& value);
77         void clearNicknames();
78         int  getNicknamesNum() const;
79
80         std::string getPhoneticFirstName() const;
81         void setPhoneticFirstName(const std::string &value);
82         void unsetPhoneticFirstName();
83         bool getPhoneticFirstNameIsSet() const;
84
85         std::string getPhoneticMiddleName() const;
86         void setPhoneticMiddleName(const std::string &value);
87         void unsetPhoneticMiddleName();
88         bool getPhoneticMiddleNameIsSet() const;
89
90         std::string getPhoneticLastName() const;
91         void setPhoneticLastName(const std::string &value);
92         void unsetPhoneticLastName();
93         bool getPhoneticLastNameIsSet() const;
94
95         std::string getDisplayName() const;
96         void setDisplayName(const std::string &value);
97         void unsetDisplayName();
98         bool getDisplayNameIsSet() const;
99
100         void clear();
101         ContactNamePtr clone() const;
102
103         void setTypesJSArray(bool value, JSObjectRef initValue);
104         JSValueRef getTypesJSArray();
105         JSObjectRef getTypesJSObj();
106         bool IsTypesSetJSArray() const;
107         void resetTypesJSObj();
108
109         void setContext(JSContextRef contextRef);
110         JSContextRef getContext();
111
112 private:
113         std::string     m_prefix;
114         bool            m_prefixIsSet;
115
116         std::string     m_suffix;
117         bool            m_suffixIsSet;
118
119         std::string     m_firstName;
120         bool            m_firstNameIsSet;
121
122         std::string     m_middleName;
123         bool            m_middleNameIsSet;
124
125         std::string     m_lastName;
126         bool            m_lastNameIsSet;
127
128         StringArrayPtr  m_nicknames;
129
130         std::string     m_phoneticFirstName;
131         bool            m_phoneticFirstNameIsSet;
132
133         std::string     m_phoneticMiddleName;
134         bool            m_phoneticMiddleNameIsSet;
135
136         std::string     m_phoneticLastName;
137         bool            m_phoneticLastNameIsSet;
138
139         std::string     m_displayName;
140         bool            m_displayNameIsSet;
141
142         bool is_typesSetJSArray;
143         JSValueRef m_typesJsValue;
144         JSObjectRef m_typesObj;
145
146         JSContextRef m_context;
147 };
148
149 } // Contact
150 } // DeviceAPI
151
152 #endif // _API_CONTACT_CONTACT_NAME_H_