diff options
Diffstat (limited to 'mobile_src/Calendar/JSCalendarRecurrenceRule.h')
-rwxr-xr-x | mobile_src/Calendar/JSCalendarRecurrenceRule.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/mobile_src/Calendar/JSCalendarRecurrenceRule.h b/mobile_src/Calendar/JSCalendarRecurrenceRule.h new file mode 100755 index 0000000..9c3051a --- /dev/null +++ b/mobile_src/Calendar/JSCalendarRecurrenceRule.h @@ -0,0 +1,115 @@ +// +// Tizen Web Device API +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#ifndef _JS_CALENDAR_RECURRENCE_RULE_H_ +#define _JS_CALENDAR_RECURRENCE_RULE_H_ + +#include <string> +#include <vector> +#include <JavaScriptCore/JavaScript.h> +#include <CommonsJavaScript/PrivateObject.h> +#include "CalendarEvent.h" +#include "EventRecurrenceRule.h" + +namespace DeviceAPI { +namespace Calendar { + +#define TIZEN_INTERFACE_CALENDAR_RECURRENCE_RULE "CalendarRecurrenceRule" + +#define TIZEN_RECURRENCE_RULE_FREQUENCY "frequency" +#define TIZEN_RECURRENCE_RULE_INTERVAL "interval" +#define TIZEN_RECURRENCE_RULE_UNTIL_DATE "untilDate" +#define TIZEN_RECURRENCE_RULE_OCCURRENCE_COUNT "occurrenceCount" +//#define TIZEN_RECURRENCE_RULE_DAYS_OF_THE_MONTH "daysOfTheMonth" +#define TIZEN_RECURRENCE_RULE_DAYS_OF_THE_WEEK "daysOfTheWeek" +//#define TIZEN_RECURRENCE_RULE_DAYS_OF_THE_YEAR "daysOfTheYear" +//#define TIZEN_RECURRENCE_RULE_WEEKS_OF_THE_YEAR "weeksOfTheYear" +#define TIZEN_RECURRENCE_RULE_SET_POSITIONS "setPositions" +#define TIZEN_RECURRENCE_RULE_EXCEPTIONS "exceptions" + +typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<EventRecurrenceRulePtr, + WrtDeviceApis::CommonsJavaScript::NoOwnership> RecurrenceRulePrivateObject; + +class JSCalendarRecurrenceRule +{ + public: + + static const JSClassDefinition* getClassInfo(); + + static JSClassRef getClassRef(); + + static JSObjectRef createJSCalendarRecurrenceRule(JSContextRef context, EventRecurrenceRulePtr rule); + + static EventRecurrenceRulePtr getPrivateObject(JSObjectRef object); + + static void setPrivateObject(const EventRecurrenceRulePtr &rrule, + JSContextRef ctx, + const JSObjectRef object); + + static JSObjectRef constructor(JSContextRef context, + JSObjectRef constructor, + size_t argumentCount, + const JSValueRef arguments[], + JSValueRef* exception); + + private: + + /** + * The callback invoked when an object is first created. + */ + static void initialize(JSContextRef context, JSObjectRef object); + + /** + * The callback invoked when an object is finalized. + */ + static void finalize(JSObjectRef object); + + static JSValueRef getProperty(JSContextRef context, + JSObjectRef object, + JSStringRef propertyName, + JSValueRef* exception); + + static bool setProperty(JSContextRef context, + JSObjectRef object, + JSStringRef propertyName, + JSValueRef value, + JSValueRef* exception); + + static JSClassRef m_jsClassRef; + + /** + * This structure describes a statically declared function property. + */ + static JSStaticFunction m_function[]; + + /** + * This structure contains properties and callbacks that define a type of object. + */ + static JSClassDefinition m_classInfo; + + /** + * This member variable contains the initialization values for the static properties of this class. + * The values are given according to the data structure JSPropertySpec + */ + static JSStaticValue m_property[]; +}; + +} +} + +#endif /* _JS_CALENDAR_RECURRENCE_RULE_H_ */ |