Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSCalendarAttendee.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef _JS_CALENDAR_ATTENDEE_H_
19 #define _JS_CALENDAR_ATTENDEE_H_
20
21 #include <string>
22 #include <vector>
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include <API/Calendar/CalendarEvent.h>
26 #include <API/Calendar/EventAttendee.h>
27
28 namespace TizenApis {
29 namespace Tizen1_0 {
30 namespace Calendar {
31
32 #define TIZEN_INTERFACE_CALENDAR_ATTENDEE "CalendarAttendee"
33
34 #define TIZEN_ATTENDEE_NAME "name"
35 #define TIZEN_ATTENDEE_URI "uri"
36 #define TIZEN_ATTENDEE_ROLE "role"
37 #define TIZEN_ATTENDEE_STATUS "status"
38 #define TIZEN_ATTENDEE_RSVP "RSVP"
39 #define TIZEN_ATTENDEE_TYPE "type"
40 #define TIZEN_ATTENDEE_GROUP "group"
41 #define TIZEN_ATTENDEE_DELEGATORURI "delegatorURI"
42 #define TIZEN_ATTENDEE_DELEGATEURI "delegateURI"
43 #define TIZEN_ATTENDEE_CONTACT_REF "contactRef"
44
45 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::EventAttendeePtr,
46         WrtDeviceApis::CommonsJavaScript::NoOwnership> AttendeePrivateObject;
47
48 class JSCalendarAttendee
49 {
50   public:
51
52     static const JSClassDefinition* getClassInfo();
53
54     static JSClassRef getClassRef();
55
56     static JSObjectRef createJSCalendarAttendee(JSContextRef context, TizenApis::Api::Calendar::EventAttendeePtr event);
57
58     static TizenApis::Api::Calendar::EventAttendeePtr getPrivateObject(JSObjectRef object);
59
60     static void setPrivateObject(const TizenApis::Api::Calendar::EventAttendeePtr &attendee,
61             JSContextRef ctx,
62             const JSObjectRef object);
63
64   private:
65
66     /**
67      * The callback invoked when an object is first created.
68      */
69     static void initialize(JSContextRef context, JSObjectRef object);
70
71     /**
72      * The callback invoked when an object is finalized.
73      */
74     static void finalize(JSObjectRef object);
75
76         /**
77          * Constructor for the CalendarAttendee interface.
78          */
79         static JSObjectRef constructor(JSContextRef context,
80                     JSObjectRef constructor,
81                     size_t argumentCount,
82                     const JSValueRef arguments[],
83                     JSValueRef* exception);
84
85     static JSValueRef getProperty(JSContextRef context,
86             JSObjectRef object,
87             JSStringRef propertyName,
88             JSValueRef* exception);
89
90     static bool setProperty(JSContextRef context,
91             JSObjectRef object,
92             JSStringRef propertyName,
93             JSValueRef value,
94             JSValueRef* exception);
95
96     static JSClassRef m_jsClassRef;
97
98     /**
99      * This structure describes a statically declared function property.
100      */
101     static JSStaticFunction m_function[];
102
103     /**
104      * This structure contains properties and callbacks that define a type of object.
105      */
106     static JSClassDefinition m_classInfo;
107
108     /**
109      * This member variable contains the initialization values for the static properties of this class.
110      * The values are given according to the data structure JSPropertySpec
111      */
112     static JSStaticValue m_property[];
113 };
114
115 }
116 }
117 }
118
119 #endif /* _JS_CALENDAR_ATTENDEE_H_ */