2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
20 * @author Kisub Song (kisubs.song@samsung.com)
25 #ifndef _API_CONTACT_CONTACT_NAME_H_
26 #define _API_CONTACT_CONTACT_NAME_H_
30 #include <dpl/shared_ptr.h>
31 #include <JavaScriptCore/JavaScript.h>
32 #include "ContactTypes.h"
38 typedef DPL::SharedPtr<ContactName> ContactNamePtr;
40 typedef std::vector<ContactNamePtr> ContactNameArray;
41 typedef DPL::SharedPtr<ContactNameArray> ContactNameArrayPtr;
47 virtual ~ContactName();
49 std::string getPrefix() const;
50 void setPrefix(const std::string &value);
52 bool getPrefixIsSet() const;
54 std::string getSuffix() const;
55 void setSuffix(const std::string &value);
57 bool getSuffixIsSet() const;
59 std::string getFirstName() const;
60 void setFirstName(const std::string &value);
61 void unsetFirstName();
62 bool getFirstNameIsSet() const;
64 std::string getMiddleName() const;
65 void setMiddleName(const std::string &value);
66 void unsetMiddleName();
67 bool getMiddleNameIsSet() const;
69 std::string getLastName() const;
70 void setLastName(const std::string &value);
72 bool getLastNameIsSet() const;
74 StringArrayPtr getNicknames() const;
75 void setNicknames(const StringArrayPtr &value);
76 void addNickname(const std::string& value);
77 void clearNicknames();
78 int getNicknamesNum() const;
80 std::string getPhoneticFirstName() const;
81 void setPhoneticFirstName(const std::string &value);
82 void unsetPhoneticFirstName();
83 bool getPhoneticFirstNameIsSet() const;
85 std::string getPhoneticMiddleName() const;
86 void setPhoneticMiddleName(const std::string &value);
87 void unsetPhoneticMiddleName();
88 bool getPhoneticMiddleNameIsSet() const;
90 std::string getPhoneticLastName() const;
91 void setPhoneticLastName(const std::string &value);
92 void unsetPhoneticLastName();
93 bool getPhoneticLastNameIsSet() const;
95 std::string getDisplayName() const;
96 void setDisplayName(const std::string &value);
97 void unsetDisplayName();
98 bool getDisplayNameIsSet() const;
101 ContactNamePtr clone() const;
103 void setTypesJSArray(bool value, JSObjectRef initValue);
104 JSValueRef getTypesJSArray();
105 JSObjectRef getTypesJSObj();
106 bool IsTypesSetJSArray() const;
107 void resetTypesJSObj();
109 void setContext(JSContextRef contextRef);
110 JSContextRef getContext();
113 std::string m_prefix;
116 std::string m_suffix;
119 std::string m_firstName;
120 bool m_firstNameIsSet;
122 std::string m_middleName;
123 bool m_middleNameIsSet;
125 std::string m_lastName;
126 bool m_lastNameIsSet;
128 StringArrayPtr m_nicknames;
130 std::string m_phoneticFirstName;
131 bool m_phoneticFirstNameIsSet;
133 std::string m_phoneticMiddleName;
134 bool m_phoneticMiddleNameIsSet;
136 std::string m_phoneticLastName;
137 bool m_phoneticLastNameIsSet;
139 std::string m_displayName;
140 bool m_displayNameIsSet;
142 bool is_typesSetJSArray;
143 JSValueRef m_typesJsValue;
144 JSObjectRef m_typesObj;
146 JSContextRef m_context;
152 #endif // _API_CONTACT_CONTACT_NAME_H_