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 TIZENAPIS_TIZEN_JS_APPLICATION_CONTROL_H_
20 #define TIZENAPIS_TIZEN_JS_APPLICATION_CONTROL_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include "ApplicationControl.h"
25 #include "JSApplicationControlData.h"
28 namespace Application {
30 #define TIZEN_INTERFACE_APPLICATION_CONTROL "ApplicationControl"
32 #define TIZEN_APPLICATION_CONTROL_OPERATION "operation"
33 #define TIZEN_APPLICATION_CONTROL_URI "uri"
34 #define TIZEN_APPLICATION_CONTROL_MIME "mime"
35 #define TIZEN_APPLICATION_CONTROL_CATEGORY "category"
36 #define TIZEN_APPLICATION_CONTROL_DATA "data"
38 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<ApplicationControlPtr>::Type JSApplicationControlPriv;
40 class JSApplicationControl {
42 static const JSClassDefinition* getClassInfo();
44 static const JSClassRef getClassRef();
47 * create an JSObject for callback function(onAnswerReceived).
49 static JSObjectRef createJSObject(JSContextRef context,
50 const ApplicationControlPtr &appsvc);
53 * The Constructor of ApplicationControl
55 static JSObjectRef constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
58 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
60 static ApplicationControlPtr getApplicationControl(JSContextRef context, JSValueRef value);
64 //static ApplicationControlPtr getPrivateData(JSObjectRef object);
69 * The callback invoked when an object is first created.
71 static void initialize(JSContextRef context, JSObjectRef object);
74 * The callback invoked when an object is finalized.
76 static void finalize(JSObjectRef object);
78 static ApplicationControlPtr getPrivData(JSContextRef context, JSObjectRef object);
81 * The callback invoked when getting a property's value.
83 static JSValueRef getProperty(JSContextRef context,
85 JSStringRef propertyName,
86 JSValueRef* exception);
89 * The callback invoked when setting a property's value.
92 static bool setProperty(JSContextRef context,
94 JSStringRef propertyName,
96 JSValueRef* exception);
99 * This structure contains properties and callbacks that define a type of object.
101 static JSClassDefinition m_classInfo;
104 * This structure describes a statically declared value property.
106 static JSStaticValue m_property[];
109 * This structure describes a statically declared function property.
111 static JSStaticFunction m_function[];
114 static JSClassRef m_jsClassRef;