Update change log and spec for wrt-plugins-tizen_0.4.51
[framework/web/wrt-plugins-tizen.git] / src / Alarm / JSAlarmAbsolute.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19 #ifndef _JS_TIZEN_JSALARMABSOLUTE
20 #define _JS_TIZEN_JSALARMABSOLUTE
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <IApplicationManager.h>
25 #include "AlarmAbsolute.h"
26
27 namespace DeviceAPI {
28 namespace Alarm {
29
30 #define TIZEN_ALARM_ABSOLUTE_INTERFACE "AlarmAbsolute"
31
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"
36
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<AlarmAbsolutePtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSAlarmAbsolutePriv;
38
39 class JSAlarmAbsolute {
40 public:
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);
45
46 protected:
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);
50     
51 private:
52     static AlarmAbsolutePtr getPrivData(JSObjectRef object);
53
54     static JSValueRef getDate(JSContextRef context,
55                                         JSObjectRef object,
56                                         JSStringRef propertyName,
57                                         JSValueRef* exception);
58    
59     static JSValueRef getId(JSContextRef context,
60                                         JSObjectRef object,
61                                         JSStringRef propertyName,
62                                         JSValueRef* exception);
63
64     static JSValueRef getInterval(JSContextRef context,
65                                                 JSObjectRef object,
66                                                 JSStringRef propertyName,
67                                                 JSValueRef* exception);
68     
69     static JSValueRef getDaysOfTheWeek(JSContextRef context,
70                                                 JSObjectRef object,
71                                                 JSStringRef propertyName,
72                                                 JSValueRef* exception);
73     
74
75     static JSClassDefinition m_jsClassInfo;
76     static JSClassRef m_jsClassRef;
77     static JSStaticFunction m_function[];
78     static JSStaticValue m_property[];
79 };
80
81 }// Alarm
82 } // TizenApis
83
84 #endif