Update change log and spec for wrt-plugins-tizen_0.4.49
[framework/web/wrt-plugins-tizen.git] / src / Contact / ContactEmailAddress.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        ContactEmailAddress.h
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief
23  */
24
25 #ifndef _API_CONTACT_CONTACT_EMAIL_ADDRESS_H_
26 #define _API_CONTACT_CONTACT_EMAIL_ADDRESS_H_
27
28 #include <algorithm>
29 #include <vector>
30 #include <string>
31 #include <dpl/shared_ptr.h>
32 #include "ContactTypes.h"
33 #include <JavaScriptCore/JavaScript.h>
34
35 namespace DeviceAPI {
36 namespace Contact {
37
38 class ContactEmailAddress;
39 typedef DPL::SharedPtr<ContactEmailAddress> ContactEmailAddressPtr;
40
41 typedef std::vector<ContactEmailAddressPtr> ContactEmailAddressArray;
42 typedef DPL::SharedPtr<ContactEmailAddressArray> ContactEmailAddressArrayPtr;
43
44 typedef std::vector<ContactEmailAddressType> ContactEmailAddressTypeArray;
45 typedef DPL::SharedPtr<ContactEmailAddressTypeArray> ContactEmailAddressTypeArrayPtr;
46
47 class ContactEmailAddress
48 {
49 public:
50         ContactEmailAddress();
51         ~ContactEmailAddress();
52
53         std::string getEmail() const;
54         void setEmail(const std::string &value);
55         void unsetEmail();
56         bool getEmailIsSet() const;
57
58         bool getIsDefault() const;
59         void setIsDefault(const bool &value);
60
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;
66
67         void clear();
68         ContactEmailAddressPtr clone() const;
69
70         std::string getLabel() const;
71         void setLabel(const std::string &value);
72         bool getLabelIsSet() const;
73
74         void setTypesJSArray(bool value, JSObjectRef initValue);
75         JSValueRef getTypesJSArray();
76         JSObjectRef getTypesJSObj();
77         bool IsTypesSetJSArray() const;
78         void resetTypesJSObj();
79
80         void setContext(JSContextRef contextRef);
81         JSContextRef getContext();
82
83 private:
84         std::string     m_email;
85         bool            m_emailIsSet;
86
87         bool            m_isDefault;
88
89         ContactEmailAddressTypeArrayPtr m_types;
90
91         std::string     m_label;
92         bool            m_labelIsSet;
93
94         bool is_typesSetJSArray;
95         JSValueRef m_typesJsValue;
96         JSObjectRef m_typesObj;
97
98         JSContextRef m_context;
99 };
100
101 } // Contact
102 } // DeviceAPI
103
104 #endif // _API_CONTACT_CONTACT_EMAIL_ADDRESS_H_