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.
19 * @file ContactEmailAddress.h
20 * @author Kisub Song (kisubs.song@samsung.com)
25 #ifndef _API_CONTACT_CONTACT_EMAIL_ADDRESS_H_
26 #define _API_CONTACT_CONTACT_EMAIL_ADDRESS_H_
31 #include <dpl/shared_ptr.h>
32 #include "ContactTypes.h"
33 #include <JavaScriptCore/JavaScript.h>
38 class ContactEmailAddress;
39 typedef DPL::SharedPtr<ContactEmailAddress> ContactEmailAddressPtr;
41 typedef std::vector<ContactEmailAddressPtr> ContactEmailAddressArray;
42 typedef DPL::SharedPtr<ContactEmailAddressArray> ContactEmailAddressArrayPtr;
44 typedef std::vector<ContactEmailAddressType> ContactEmailAddressTypeArray;
45 typedef DPL::SharedPtr<ContactEmailAddressTypeArray> ContactEmailAddressTypeArrayPtr;
47 class ContactEmailAddress
50 ContactEmailAddress();
51 ~ContactEmailAddress();
53 std::string getEmail() const;
54 void setEmail(const std::string &value);
56 bool getEmailIsSet() const;
58 bool getIsDefault() const;
59 void setIsDefault(const bool &value);
61 ContactEmailAddressTypeArrayPtr getTypes() const;
62 void setTypes(const ContactEmailAddressTypeArrayPtr &value);
63 void addType(ContactEmailAddressType value);
64 bool isTypeOf(ContactEmailAddressType value) const;
65 int getTypesNum() const;
68 ContactEmailAddressPtr clone() const;
70 std::string getLabel() const;
71 void setLabel(const std::string &value);
72 bool getLabelIsSet() const;
74 void setTypesJSArray(bool value, JSObjectRef initValue);
75 JSValueRef getTypesJSArray();
76 JSObjectRef getTypesJSObj();
77 bool IsTypesSetJSArray() const;
78 void resetTypesJSObj();
80 void setContext(JSContextRef contextRef);
81 JSContextRef getContext();
89 ContactEmailAddressTypeArrayPtr m_types;
94 bool is_typesSetJSArray;
95 JSValueRef m_typesJsValue;
96 JSObjectRef m_typesObj;
98 JSContextRef m_context;
104 #endif // _API_CONTACT_CONTACT_EMAIL_ADDRESS_H_