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 class JSApplicationManager {
32 static const JSClassDefinition* getClassInfo();
34 static const JSClassRef getClassRef();
36 //static void setTitleProperty(JSContextRef context, std::string propertyValue);
40 * The callback invoked when an object is first created.
42 static void initialize(JSContextRef context, JSObjectRef object);
45 * The callback invoked when an object is finalized.
47 static void finalize(JSObjectRef object);
50 * Gets a current application
52 static JSValueRef getCurrentApplication(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
53 const JSValueRef arguments[], JSValueRef* exception);
56 * Launches a application with given application id
58 static JSValueRef launch(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
59 const JSValueRef arguments[], JSValueRef* exception);
62 * Kills the application based on application context.
64 static JSValueRef kill(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
65 const JSValueRef arguments[], JSValueRef* exception);
69 * exit current application
71 static JSValueRef setUserAgent(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
72 const JSValueRef arguments[], JSValueRef* exception);
75 * Gets the list of installed packages.
77 static JSValueRef getAppsInfo(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
78 const JSValueRef arguments[], JSValueRef* exception);
81 * Gets the list of running packages.
83 static JSValueRef getAppsContext(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
84 const JSValueRef arguments[], JSValueRef* exception);
87 * Gets the application information of based on the package name.
89 static JSValueRef getAppInfo(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
90 const JSValueRef arguments[], JSValueRef* exception);
93 * Gets the current application Context
95 static JSValueRef getAppContext(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
96 const JSValueRef arguments[], JSValueRef* exception);
99 * Watch for changes on installed applicaiton.
101 static JSValueRef addAppInfoEventListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
102 const JSValueRef arguments[], JSValueRef* exception);
105 * Unset installed Applications listener
107 static JSValueRef removeAppInfoEventListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
108 const JSValueRef arguments[], JSValueRef* exception);
111 * Launch a application control
113 static JSValueRef launchAppControl(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
114 const JSValueRef arguments[], JSValueRef* exception);
117 * Find application info list with application control
119 static JSValueRef findAppControl(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
120 const JSValueRef arguments[], JSValueRef* exception);
123 * Get certificate information of given application
125 static JSValueRef getAppCerts(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
126 const JSValueRef arguments[], JSValueRef* exception);
129 * Get shared directory URI of specific application
131 static JSValueRef getAppSharedURI(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
132 const JSValueRef arguments[], JSValueRef* exception);
135 * Get meta data of specific application
137 static JSValueRef getAppMetaData(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
138 const JSValueRef arguments[], JSValueRef* exception);
141 * This structure contains properties and callbacks that define a type of object.
143 static JSClassDefinition m_classInfo;
146 * This structure describes a statically declared function property.
148 static JSStaticFunction m_function[];
150 static JSClassRef m_jsClassRef;