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.
17 #ifndef _JS_TIZEN_ALARMRELATIVE
18 #define _JS_TIZEN_ALARMRELATIVE
20 #include <JavaScriptCore/JavaScript.h>
21 #include <CommonsJavaScript/PrivateObject.h>
22 #include <API/Application/IApplication.h>
23 #include "AlarmRelative.h"
29 using namespace TizenApis::Api::Alarm;
31 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<AlarmRelativePtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSAlarmRelativePriv;
33 class JSAlarmRelative {
35 static const JSClassDefinition* getClassInfo();
36 static const JSClassRef getClassRef();
37 static JSValueRef createJSObject(JSContextRef context, const int id);
38 static JSValueRef createJSObject(JSContextRef context, struct tm date, AlarmRecurrencePtr ptr);
39 static JSValueRef createJSObject(JSContextRef context, int delay, AlarmRecurrencePtr ptr);
40 static JSValueRef createJSObject(JSContextRef context, struct tm date);
41 static JSValueRef createJSObject(JSContextRef context, int delay, int dummy);
42 static JSObjectRef constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
46 static void initialize(JSContextRef context, JSObjectRef object);
47 static void finalize(JSObjectRef object);
48 static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
49 static JSValueRef getNextScheduledDate(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
52 static Api::Alarm::AlarmRelativePtr getPrivData(JSObjectRef object);
54 static JSValueRef getId(JSContextRef context,
56 JSStringRef propertyName,
57 JSValueRef* exception);
59 static JSValueRef getRecurrenceRule(JSContextRef context,
61 JSStringRef propertyName,
62 JSValueRef* exception);
64 static JSClassDefinition m_jsClassInfo;
65 static JSClassRef m_jsClassRef;
66 static JSStaticFunction m_function[];
67 static JSStaticValue m_property[];