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 getPhoneticLastName() const;
86 void setPhoneticLastName(const std::string &value);
87 void unsetPhoneticLastName();
88 bool getPhoneticLastNameIsSet() const;
90 std::string getDisplayName() const;
91 void setDisplayName(const std::string &value);
92 void unsetDisplayName();
93 bool getDisplayNameIsSet() const;
96 ContactNamePtr clone() const;
98 void setTypesJSArray(bool value, JSObjectRef initValue);
99 JSValueRef getTypesJSArray();
100 JSObjectRef getTypesJSObj();
101 bool IsTypesSetJSArray() const;
102 void resetTypesJSObj();
104 void setContext(JSContextRef contextRef);
105 JSContextRef getContext();
108 std::string m_prefix;
111 std::string m_suffix;
114 std::string m_firstName;
115 bool m_firstNameIsSet;
117 std::string m_middleName;
118 bool m_middleNameIsSet;
120 std::string m_lastName;
121 bool m_lastNameIsSet;
123 StringArrayPtr m_nicknames;
125 std::string m_phoneticFirstName;
126 bool m_phoneticFirstNameIsSet;
128 std::string m_phoneticLastName;
129 bool m_phoneticLastNameIsSet;
131 std::string m_displayName;
132 bool m_displayNameIsSet;
134 bool is_typesSetJSArray;
135 JSValueRef m_typesJsValue;
136 JSObjectRef m_typesObj;
138 JSContextRef m_context;
144 #endif // _API_CONTACT_CONTACT_NAME_H_