Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSAttendee.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_ATTENDEE_H_
19 #define _JS_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 using namespace TizenApis::Api::Calendar;
29 using namespace WrtDeviceApis::Commons;
30 using namespace WrtDeviceApis::CommonsJavaScript;
31
32 namespace TizenApis {
33 namespace Tizen1_0 {
34 namespace Calendar {
35
36 #define TIZEN_ATTENDEE_NAME "name"
37 #define TIZEN_ATTENDEE_URI "uri"
38 #define TIZEN_ATTENDEE_ROLE "role"
39 #define TIZEN_ATTENDEE_STATUS "status"
40 #define TIZEN_ATTENDEE_RSVP "RSVP"
41 #define TIZEN_ATTENDEE_TYPE "type"
42 #define TIZEN_ATTENDEE_GROUP "group"
43 #define TIZEN_ATTENDEE_DELEGATORURI "delegatorURI"
44 #define TIZEN_ATTENDEE_DELEGATEURI "delegateURI"
45 #define TIZEN_ATTENDEE_UID "uid"
46
47 typedef PrivateObject<Api::Calendar::EventAttendeePtr,
48                                NoOwnership> AttendeePrivateObject;
49
50 class JSAttendee
51 {
52   public:
53
54     static const JSClassDefinition* getClassInfo();
55
56     static JSClassRef getClassRef();
57
58     static JSObjectRef createJSAttendee(JSContextRef context, Api::Calendar::EventAttendeePtr event);
59
60   private:
61
62     /**
63      * The callback invoked when an object is first created.
64      */
65     static void initialize(JSContextRef context, JSObjectRef object);
66
67     /**
68      * The callback invoked when an object is finalized.
69      */
70     static void finalize(JSObjectRef object);
71
72     static JSValueRef getProperty(JSContextRef context,
73             JSObjectRef object,
74             JSStringRef propertyName,
75             JSValueRef* exception);
76
77     static bool setProperty(JSContextRef context,
78             JSObjectRef object,
79             JSStringRef propertyName,
80             JSValueRef value,
81             JSValueRef* exception);
82
83     static JSClassRef m_jsClassRef;
84
85     /**
86      * This structure describes a statically declared function property.
87      */
88     static JSStaticFunction m_function[];
89
90     /**
91      * This structure contains properties and callbacks that define a type of object.
92      */
93     static JSClassDefinition m_classInfo;
94
95     /**
96      * This member variable contains the initialization values for the static properties of this class.
97      * The values are given according to the data structure JSPropertySpec
98      */
99     static JSStaticValue m_property[];
100 };
101
102 }
103 }
104 }
105
106 #endif /* _JS_ATTENDEE_H_ */