2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef _JS_CALENDAR_RECURRENCE_RULE_H_
19 #define _JS_CALENDAR_RECURRENCE_RULE_H_
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include <API/Calendar/CalendarEvent.h>
26 #include <API/Calendar/EventRecurrenceRule.h>
32 #define TIZEN_INTERFACE_CALENDAR_RECURRENCE_RULE "CalendarRecurrenceRule"
34 #define TIZEN_RECURRENCE_RULE_FREQUENCY "frequency"
35 #define TIZEN_RECURRENCE_RULE_INTERVAL "interval"
36 #define TIZEN_RECURRENCE_RULE_UNTIL_DATE "untilDate"
37 #define TIZEN_RECURRENCE_RULE_OCCURRENCE_COUNT "occurrenceCount"
38 //#define TIZEN_RECURRENCE_RULE_DAYS_OF_THE_MONTH "daysOfTheMonth"
39 #define TIZEN_RECURRENCE_RULE_DAYS_OF_THE_WEEK "daysOfTheWeek"
40 //#define TIZEN_RECURRENCE_RULE_DAYS_OF_THE_YEAR "daysOfTheYear"
41 //#define TIZEN_RECURRENCE_RULE_WEEKS_OF_THE_YEAR "weeksOfTheYear"
42 #define TIZEN_RECURRENCE_RULE_SET_POSITION "setPositions"
43 #define TIZEN_RECURRENCE_RULE_EXCEPTIONS "exceptions"
45 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Calendar::EventRecurrenceRulePtr,
46 WrtDeviceApis::CommonsJavaScript::NoOwnership> RecurrenceRulePrivateObject;
48 class JSCalendarRecurrenceRule
52 static const JSClassDefinition* getClassInfo();
54 static JSClassRef getClassRef();
56 static JSObjectRef createJSCalendarRecurrenceRule(JSContextRef context, TizenApis::Api::Calendar::EventRecurrenceRulePtr rule);
58 static TizenApis::Api::Calendar::EventRecurrenceRulePtr getPrivateObject(JSObjectRef object);
60 static void setPrivateObject(const TizenApis::Api::Calendar::EventRecurrenceRulePtr &rrule,
62 const JSObjectRef object);
67 * The callback invoked when an object is first created.
69 static void initialize(JSContextRef context, JSObjectRef object);
72 * The callback invoked when an object is finalized.
74 static void finalize(JSObjectRef object);
77 * Constructor for the CalendarRecurrenceRule interface.
79 static JSObjectRef constructor(JSContextRef context,
80 JSObjectRef constructor,
82 const JSValueRef arguments[],
83 JSValueRef* exception);
85 static JSValueRef getProperty(JSContextRef context,
87 JSStringRef propertyName,
88 JSValueRef* exception);
90 static bool setProperty(JSContextRef context,
92 JSStringRef propertyName,
94 JSValueRef* exception);
96 static JSClassRef m_jsClassRef;
99 * This structure describes a statically declared function property.
101 static JSStaticFunction m_function[];
104 * This structure contains properties and callbacks that define a type of object.
106 static JSClassDefinition m_classInfo;
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
112 static JSStaticValue m_property[];
119 #endif /* _JS_CALENDAR_RECURRENCE_RULE_H_ */