2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _JS_TIZEN_JSALARMABSOLUTE
20 #define _JS_TIZEN_JSALARMABSOLUTE
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <IApplicationManager.h>
25 #include "AlarmAbsolute.h"
30 #define TIZEN_ALARM_ABSOLUTE_INTERFACE "AlarmAbsolute"
32 #define TIZEN_ALARM_ABSOLUTE_ATTRIBUTE_ID "id"
33 #define TIZEN_ALARM_ABSOLUTE_ATTRIBUTE_DATE "date"
34 #define TIZEN_ALARM_ABSOLUTE_ATTRIBUTE_PERIOD "period"
35 #define TIZEN_ALARM_ABSOLUTE_ATTRIBUTE_DAYSOFTHEWEEK "daysOfTheWeek"
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<AlarmAbsolutePtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSAlarmAbsolutePriv;
39 class JSAlarmAbsolute {
41 static const JSClassDefinition* getClassInfo();
42 static const JSClassRef getClassRef();
43 static JSObjectRef constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
44 static JSValueRef createJSObject(JSContextRef context, AlarmAbsolutePtr privateData);
47 static void initialize(JSContextRef context, JSObjectRef object);
48 static void finalize(JSObjectRef object);
49 static JSValueRef getNextScheduledDate(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
52 static AlarmAbsolutePtr getPrivData(JSObjectRef object);
54 static JSValueRef getDate(JSContextRef context,
56 JSStringRef propertyName,
57 JSValueRef* exception);
59 static JSValueRef getId(JSContextRef context,
61 JSStringRef propertyName,
62 JSValueRef* exception);
64 static JSValueRef getInterval(JSContextRef context,
66 JSStringRef propertyName,
67 JSValueRef* exception);
69 static JSValueRef getDaysOfTheWeek(JSContextRef context,
71 JSStringRef propertyName,
72 JSValueRef* exception);
75 static JSClassDefinition m_jsClassInfo;
76 static JSClassRef m_jsClassRef;
77 static JSStaticFunction m_function[];
78 static JSStaticValue m_property[];