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.
18 #ifndef TIZENAPIS_TIZEN_JS_APPLICATION_MANAGER_H_
19 #define TIZENAPIS_TIZEN_JS_APPLICATION_MANAGER_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include "IApplicationManager.h"
26 namespace Application {
28 #define TIZEN_INTERFACE_APPLICATION_MANAGER "ApplicationManager"
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject
31 <IApplicationManagerPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSApplicationManagerPriv;
33 class JSApplicationManager {
35 static const JSClassDefinition* getClassInfo();
37 static const JSClassRef getClassRef();
39 //static void setTitleProperty(JSContextRef context, std::string propertyValue);
43 * The callback invoked when an object is first created.
45 static void initialize(JSContextRef context, JSObjectRef object);
48 * The callback invoked when an object is finalized.
50 static void finalize(JSObjectRef object);
53 * Gets a current application
55 static JSValueRef getCurrentApplication(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
56 const JSValueRef arguments[], JSValueRef* exception);
59 * Launches a application with given application id
61 static JSValueRef launch(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
62 const JSValueRef arguments[], JSValueRef* exception);
65 * Kills the application based on application context.
67 static JSValueRef kill(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
68 const JSValueRef arguments[], JSValueRef* exception);
72 * exit current application
74 static JSValueRef setUserAgent(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
75 const JSValueRef arguments[], JSValueRef* exception);
78 * Gets the list of installed packages.
80 static JSValueRef getAppsInfo(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
81 const JSValueRef arguments[], JSValueRef* exception);
84 * Gets the list of running packages.
86 static JSValueRef getAppsContext(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
87 const JSValueRef arguments[], JSValueRef* exception);
90 * Gets the application information of based on the package name.
92 static JSValueRef getAppInfo(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
93 const JSValueRef arguments[], JSValueRef* exception);
96 * Gets the current application Context
98 static JSValueRef getAppContext(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
99 const JSValueRef arguments[], JSValueRef* exception);
102 * Watch for changes on installed applicaiton.
104 static JSValueRef addAppInfoEventListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
105 const JSValueRef arguments[], JSValueRef* exception);
108 * Unset installed Applications listener
110 static JSValueRef removeAppInfoEventListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
111 const JSValueRef arguments[], JSValueRef* exception);
114 * Launch a application control
116 static JSValueRef launchAppControl(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
117 const JSValueRef arguments[], JSValueRef* exception);
120 * Find application info list with application control
122 static JSValueRef findAppControl(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
123 const JSValueRef arguments[], JSValueRef* exception);
126 * Get certificate information of given application
128 static JSValueRef getAppCerts(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
129 const JSValueRef arguments[], JSValueRef* exception);
132 * Get shared directory URI of specific application
134 static JSValueRef getAppSharedURI(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
135 const JSValueRef arguments[], JSValueRef* exception);
138 * Get meta data of specific application
140 static JSValueRef getAppMetaData(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
141 const JSValueRef arguments[], JSValueRef* exception);
144 * This structure contains properties and callbacks that define a type of object.
146 static JSClassDefinition m_classInfo;
149 * This structure describes a statically declared function property.
151 static JSStaticFunction m_function[];
153 static JSClassRef m_jsClassRef;