650f8fdf80f8cdb9f69fdecc3becaaaf1115fe5f
[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 getPhoneticLastName() const;
86         void setPhoneticLastName(const std::string &value);
87         void unsetPhoneticLastName();
88         bool getPhoneticLastNameIsSet() const;
89
90         std::string getDisplayName() const;
91         void setDisplayName(const std::string &value);
92         void unsetDisplayName();
93         bool getDisplayNameIsSet() const;
94
95         void clear();
96         ContactNamePtr clone() const;
97
98         void setTypesJSArray(bool value, JSObjectRef initValue);
99         JSValueRef getTypesJSArray();
100         JSObjectRef getTypesJSObj();
101         bool IsTypesSetJSArray() const;
102         void resetTypesJSObj();
103
104         void setContext(JSContextRef contextRef);
105         JSContextRef getContext();
106
107 private:
108         std::string     m_prefix;
109         bool            m_prefixIsSet;
110
111         std::string     m_suffix;
112         bool            m_suffixIsSet;
113
114         std::string     m_firstName;
115         bool            m_firstNameIsSet;
116
117         std::string     m_middleName;
118         bool            m_middleNameIsSet;
119
120         std::string     m_lastName;
121         bool            m_lastNameIsSet;
122
123         StringArrayPtr  m_nicknames;
124
125         std::string     m_phoneticFirstName;
126         bool            m_phoneticFirstNameIsSet;
127
128         std::string     m_phoneticLastName;
129         bool            m_phoneticLastNameIsSet;
130
131         std::string     m_displayName;
132         bool            m_displayNameIsSet;
133
134         bool is_typesSetJSArray;
135         JSValueRef m_typesJsValue;
136         JSObjectRef m_typesObj;
137
138         JSContextRef m_context;
139 };
140
141 } // Contact
142 } // DeviceAPI
143
144 #endif // _API_CONTACT_CONTACT_NAME_H_