Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Alarm / JSAbstractAlarm.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #include <cassert>
18 #include <memory>
19 #include <dpl/log/log.h>
20 #include <CommonsJavaScript/JSUtils.h>
21 #include <CommonsJavaScript/Converter.h>
22 #include <CommonsJavaScript/Validator.h>
23 #include <CommonsJavaScript/JSDOMExceptionFactory.h>
24 #include <Commons/Exception.h>
25 #include <Tizen/Common/JSTizenExceptionFactory.h>
26 #include <Tizen/Common/JSTizenException.h>
27 #include <app.h>
28 #include <time.h>
29 #include "JSAbstractAlarm.h"
30
31
32
33 namespace TizenApis {
34 namespace Tizen1_0 {
35 namespace Alarm {
36
37 using namespace std;
38 using namespace DPL;
39 using namespace WrtDeviceApis::Commons;
40 using namespace WrtDeviceApis::CommonsJavaScript;
41
42 JSClassRef JSAbstractAlarm::m_jsClassRef = NULL;
43
44 JSClassDefinition JSAbstractAlarm::m_jsClassInfo = {
45                 0,
46                 kJSClassAttributeNone,
47                 "AbstractAlarm",
48                 NULL,
49                 NULL,
50                 NULL,
51                 initialize,
52                 finalize,
53                 NULL, //hasProperty,
54                 NULL, //getProperty,
55                 NULL, //setProperty,
56                 NULL, //deleteProperty,Geolocation
57                 NULL, //getPropertyNames,
58                 NULL,
59                 NULL, // constructor
60                 hasInstance,
61                 NULL
62 };
63 const JSClassRef JSAbstractAlarm::getClassRef() 
64 {
65         if (!m_jsClassRef) {
66                 m_jsClassRef = JSClassCreate(&m_jsClassInfo);
67         }
68         return m_jsClassRef;
69 }
70
71 const JSClassDefinition* JSAbstractAlarm::getClassInfo() 
72 {
73         return &m_jsClassInfo;
74 }
75
76 void JSAbstractAlarm::initialize(JSContextRef context, JSObjectRef object) 
77 {
78
79 }
80 void JSAbstractAlarm::finalize(JSObjectRef object) 
81 {
82
83 }
84
85 bool JSAbstractAlarm::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception)
86 {
87     return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
88 }
89
90 } // Alarm
91 } // Tizen1_0 
92 } // TizenApis
93
94