Update change log and spec for wrt-plugins-tizen_0.4.9
[platform/framework/web/wrt-plugins-tizen.git] / src / Notification / JSStatusNotification.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 TIZENAPIS_TIZEN_JS_STATUS_NOTIFICATION_H_
20 #define TIZENAPIS_TIZEN_JS_STATUS_NOTIFICATION_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include "INotification.h"
25
26 namespace DeviceAPI {
27 namespace Notification {
28
29
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<INotificationPtr>::Type JSStatusNotificationPriv;
31
32 #define NOTIFICATION_ID "id"
33 #define NOTIFICATION_TYPE "type"
34 #define NOTIFICATION_POSTED_TIME "postedTime"
35 #define NOTIFICATION_TITLE "title"
36 #define NOTIFICATION_CONTENT "content"
37
38 #define NOTIFICATION_STATUS_TYPE "statusType"
39 #define NOTIFICATION_ICON_PATH "iconPath"
40 #define NOTIFICATION_SOUND_PATH "soundPath"
41 #define NOTIFICATION_VIBRATION "vibration"
42 #ifdef APPLICATION_API_BACKWARD_COMPATIBILITY
43 #define NOTIFICATION_SEVICE "service"
44 #endif
45 #define NOTIFICATION_APP_CONTROL "appControl"
46 #define NOTIFICATION_APP_ID "appId"
47 #define NOTIFICATION_PROGRESS_TYPE "progressType"
48 #define NOTIFICATION_PROGRESS_VALUE "progressValue"
49 #define NOTIFICATION_LINES "detailInfo"
50 #define NOTIFICATION_BACKGROUND_IMAGE_PATH "backgroundImagePath"
51 #define NOTIFICATION_NUMBER "number"
52 #define NOTIFICATION_THUMBNAILS "thumbnails"
53 #define NOTIFICATION_SUB_ICON_PATH "subIconPath"
54
55
56 class JSStatusNotification {
57 public:
58         static const JSClassDefinition* getClassInfo();
59         static const JSClassRef getClassRef();
60         static INotificationPtr getNotification(JSContextRef context, JSValueRef value);
61         static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
62                 JSStringRef propertyName, JSValueRef* exception);       
63         static bool setProperty(JSContextRef context, JSObjectRef object,
64         JSStringRef propertyName, JSValueRef value, JSValueRef* exception);     
65         static JSObjectRef createJSObject(JSContextRef context, INotificationPtr notification);
66         
67 private:
68         static void initialize(JSContextRef context, JSObjectRef object);
69         static void finalize(JSObjectRef object);
70         static bool hasInstance(JSContextRef context, JSObjectRef constructor,
71         JSValueRef possibleInstance, JSValueRef* exception);
72
73         static JSObjectRef constructor(JSContextRef context,
74                 JSObjectRef constructor,
75                 size_t argumentCount,
76                 const JSValueRef arguments[],
77                 JSValueRef* exception);
78
79         static JSClassDefinition m_classInfo;
80         static JSStaticValue m_properties[];
81         
82         static JSClassRef m_jsClassRef;
83 };
84
85 }
86 }
87
88 #endif
89