2 // Open Service Platform
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 * @file FAppAppManager.h
20 * @brief This is the header file for the %AppManager class.
22 * This header file contains the declarations of the %AppManager class.
25 #ifndef _FAPP_APP_MANAGER_H_
26 #define _FAPP_APP_MANAGER_H_
28 #include <FBaseObject.h>
29 #include <FAppTypes.h>
31 namespace Tizen { namespace Base {
33 namespace Collection {
39 namespace Tizen { namespace App
42 class IAppControlEventListener;
43 class IAppControlListener;
44 class IAppControlResponseListener;
45 class IAppCheckpointEventListener;
46 class IAppLaunchConditionEventListener;
47 class IActiveAppEventListener;
54 * @brief This class manages all the applications.
58 * @final This class is not intended for extension.
60 * The %AppManager class manages all the applications.
61 * The application manager supports normal and conditional application launch, and application control search and launch.
62 * It looks up the specific application control from the application control registry and creates an application control instance.
64 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/app/launching_other_apps_within_apps.htm">Launching Other Applications</a>, <a href="../org.tizen.native.appprogramming/html/guide/app/registering_launch_condition.htm">Registering a Launch Condition</a>, and <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">Application Controls</a>.
66 class _OSP_EXPORT_ AppManager
67 : public Tizen::Base::Object
73 * Defines the launch options.
79 LAUNCH_OPTION_DEFAULT /**< The launch option: default */
83 * Finds the application control that the caller wants to start. @n
84 * It resolves the matched application control with the delivered application ID and operation ID.
88 * @return A pointer to the newly created AppControl instance if a matched %AppControl is found, @n
90 * @param[in] appId The application ID
91 * @param[in] operationId The operation ID
92 * @exception E_SUCCESS The method is successful.
93 * @exception E_OBJ_NOT_FOUND The application control is not found.
94 * @exception E_SYSTEM A system error has occurred. @n
95 * Either the file operation or the DB operation has failed.
96 * @remarks The specific error code can be accessed using the GetLastResult() method.
97 * @remarks %Tizen platform defines platform-defined alias for application ID and this aliased application ID
98 * can be used to find the AppControl. For more information, see
99 * <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">here</a>.
101 * The following example demonstrates how to use the %FindAppControlN() method to find the application control.
104 * ArrayList dataList(SingleObjectDeleter);
105 * dataList.Construct();
106 * dataList.Add(new String(L"tel:1234567900"));
107 * dataList.Add(new String(L"type:voice"));
109 * AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone", L"http://tizen.org/appcontrol/operation/call");
110 * pAc->Start(&dataList, null);
113 static AppControl* FindAppControlN(const AppId& appId, const Tizen::Base::String& operationId);
116 * Finds a list of AppControl instances that matches the specified operation ID, category,
117 * data type, and URI pattern.
121 * @return A pointer to the list of the AppControl instances that matches the specified operation ID, category, URI, and data type, @n
122 * else @c null if it fails
123 * @param[in] pOperationId The operation ID
124 * @param[in] pCategory The application category
125 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
126 * The '.' prefix must be used when specifying the file extension.
127 * @param[in] pUriPattern The URI pattern
129 * @exception E_SUCCESS The method is successful.
130 * @exception E_INVALID_ARG At least one of the specified @c pOperationId, @c pCategory, @c pDataType, or @c pUriScheme must not be @c null.
131 * @exception E_INVALID_FORMAT The specified URI scheme is invalid (RFC 2396).
132 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
133 * @exception E_OBJ_NOT_FOUND The application control is not found.
134 * @exception E_SYSTEM A system error has occurred. @n
135 * Either the file operation or the DB operation has failed.
136 * @remarks The specific error code can be accessed using the GetLastResult() method.
137 * @remarks For the delivered launch arguments, see App::GetAppArgumentListN().
139 static Tizen::Base::Collection::IList* FindAppControlsN(const Tizen::Base::String* pOperationId, const Tizen::Base::String* pCategory, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriPattern);
143 * Starts the application control if there is only one application control that matches the specified URI, operation ID, and data type. @n
144 * If there are more than one application controls, the one that the user selects is started.
146 * @brief <i> [Deprecated] </i>
147 * @deprecated This method is deprecated because IAppControlListener is deprecated and replaced by IAppControlResponselistener.
148 * Instead of using this method, use AppControl::FindAndStart().
150 * @privilege %http://tizen.org/privilege/application.launch
152 * @return An error code
153 * @param[in] uriData The URI that has a maximum size of @c 1024 bytes
154 * @param[in] pOperationId The operation ID
155 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
156 * The '.' prefix must be used for the @c dataType when specifying the file extension.
157 * @param[in] pListener A listener that gets notified when the resolved application control has started
158 * @exception E_SUCCESS The method is successful.
159 * @exception E_MAX_EXCEEDED The size of @c uri has exceeded the maximum limit.
160 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
161 * @exception E_OUT_OF_MEMORY The memory is insufficient.
162 * @exception E_OBJ_NOT_FOUND The application control is not found.
163 * @exception E_IN_PROGRESS The target application control is in progress.
164 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
165 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
167 * @see App::GetAppArgumentListN()
168 * @see FindAppControlN()
169 * @see FindAppControlsN()
170 * @see AppControl::Start()
172 * The following example demonstrates how to use the %StartAppControl() method.
174 * String operationId = L"http://tizen.org/appcontrol/operation/call";
175 * StartAppControl(L"tel:1234567890", &operationId, null, null);
179 static result StartAppControl(const Tizen::Base::String& uriData, const Tizen::Base::String* pOperationId, const Tizen::Base::String* pDataType, IAppControlListener* pListener);
183 * Starts the application control if there is only one application control that matches the specified operation ID, category, URI, and data type. @n
184 * If there are more than one application controls, the one that the user selects is started.
186 * @brief <i> [Deprecated] </i>
187 * @deprecated This method is deprecated because IAppControlListener is deprecated and replaced by IAppControlResponselistener.
188 * Instead of using this method, use AppControl::FindAndStart().
190 * @privilege %http://tizen.org/privilege/application.launch
192 * @return An error code
193 * @param[in] pOperationId The operation ID
194 * @param[in] pCategory The application control category
195 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
196 * The '.' prefix must be used when specifying the file extension.
197 * @param[in] pUriPattern A URI pattern which is used for application control resolution and delivered as the argument
198 * @param[in] pDataList The data list that is delivered to the resolved application control @n
199 * It has a maximum size of @c 1024 bytes.
200 * @param[in] pListener A listener that gets notified when the resolved application control has started
201 * @exception E_SUCCESS The method is successful.
202 * @exception E_INVALID_ARG At least one of the specified @c pOperationId, @c pCategory, @c pDataType, or @c pUri must not be @c null.
203 * @exception E_MAX_EXCEEDED The size of @c pDataList has exceeded the maximum limit.
204 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
205 * @exception E_OBJ_NOT_FOUND The application control is not found.
206 * @exception E_IN_PROGRESS The target application control is in progress.
207 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
208 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
209 * @remarks For delivered launch arguments, see App::GetAppArgumentListN().
210 * @see App::GetAppArgumentListN()
211 * @see FindAppControlsN()
212 * @see AppControl::Start()
215 static result StartAppControl(const Tizen::Base::String* pOperationId, const Tizen::Base::String* pCategory, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriPattern, const Tizen::Base::Collection::IList* pDataList, IAppControlListener* pListener);
218 * Gets the SQL-type data control that the caller wants to use. @n
219 * It resolves the matching data control with the specified data control provider ID.
223 * @return A pointer to the SqlDataControl instance if a matching data control is found, @n
225 * @param[in] providerId The provider ID
226 * @exception E_SUCCESS The method is successful.
227 * @exception E_OBJ_NOT_FOUND The data control specified with the @c providerId is not found.
228 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
229 * @exception E_OUT_OF_MEMORY The memory is insufficient.
230 * @exception E_SYSTEM A system error has occurred.
231 * @remarks The specific error code can be accessed using the GetLastResult() method.
233 static SqlDataControl* GetSqlDataControlN(const Tizen::Base::String& providerId);
236 * Gets the MAP-type data control that the caller wants to use. @n
237 * It resolves the matching data control with the specified data control provider ID.
241 * @return A pointer to the MapDataControl instance if a matching data control is found, @n
243 * @param[in] providerId The provider ID
244 * @exception E_SUCCESS The method is successful.
245 * @exception E_OBJ_NOT_FOUND The data control specified with the @c providerId is not found.
246 * @exception E_ILLEGAL_ACCESS The access is denied due to insufficient permission.
247 * @exception E_OUT_OF_MEMORY The memory is insufficient.
248 * @exception E_SYSTEM A system error has occurred.
249 * @remarks The specific error code can be accessed using the GetLastResult() method.
251 static MapDataControl* GetMapDataControlN(const Tizen::Base::String& providerId);
254 * Gets the path of the read-only shared directory exported by an other application specified with an application ID.
258 * @return The other application's shared directory path, @n
259 * else an empty string if an exception occurs
260 * @param[in] appId The application ID
261 * @exception E_SUCCESS The method is successful.
262 * @exception E_APP_NOT_INSTALLED The expected shared directory cannot be found
263 * because the application specified with @c appId cannot be installed.
264 * @remarks The specific error code can be accessed using the GetLastResult() method.
266 static Tizen::Base::String GetAppSharedPath(const AppId& appId);
269 * Gets the application manager instance.
273 * @return A pointer to the %AppManager instance, @n
274 * else @c null if it fails
276 static AppManager* GetInstance(void);
280 * Launches the default application with given @c appId. @n
281 * The launch arguments are given as App::OnUserEventReceivedN() or can be obtained by
282 * invoking App::GetAppArgumentListN(), especially within App::OnAppInitializing().
284 * @brief <i> [Deprecated] </i>
285 * @deprecated This method is deprecated because sending argument with %LaunchApplication() is not recommended. @n
286 * Instead of using this method, use %LaunchApplication() without launch arguments or AppControl::Start().
288 * @privilege %http://tizen.org/privilege/application.launch
290 * @return An error code
291 * @param[in] appId The application's ID to execute
292 * @param[in] pArguments A pointer to the list of string arguments that has a maximum size of @c 1024 bytes
293 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
294 * @exception E_SUCCESS The method is successful.
295 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
296 * @exception E_INVALID_ARG The specified @c appId is empty.
297 * @exception E_OBJ_NOT_FOUND The target application is not installed.
298 * @exception E_OUT_OF_MEMORY The memory is insufficient.
299 * @exception E_MAX_EXCEEDED The size of @c appId or @c pArguments has exceeded the maximum limit.
300 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
303 result LaunchApplication(const AppId& appId, const Tizen::Base::Collection::IList* pArguments, LaunchOption option = LAUNCH_OPTION_DEFAULT);
306 * Launches the default application with given @c appId.
309 * @privilege %http://tizen.org/privilege/application.launch
311 * @return An error code
312 * @param[in] appId The application's ID to execute
313 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
314 * @exception E_SUCCESS The method is successful.
315 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
316 * @exception E_APP_NOT_INSTALLED The target application is not installed.
317 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
319 result LaunchApplication(const AppId& appId, LaunchOption option = LAUNCH_OPTION_DEFAULT);
323 * Terminates an application.
326 * @visibility partner
327 * @privilege %http://tizen.org/privilege/application.kill
329 * @return An error code
330 * @param[in] appId The application's ID to execute
331 * @exception E_SUCCESS The method is successful.
332 * @exception E_SYSTEM A system error has occurred.
333 * @exception E_OBJ_NOT_FOUND The application is not installed or not running.
334 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
337 result TerminateApplication(const AppId& appId);
340 * Checks whether an application is running.
344 * @return @c true if the application is running, @n
346 * @param[in] appId The installed application ID
348 bool IsRunning(const AppId& appId) const;
351 * Gets a list of running applications at the time of invocation.
355 * @return A pointer to the running state application list (AppId), @n
356 * else @c null if an error occurs
357 * @exception E_SUCCESS The method is successful.
358 * @exception E_OUT_OF_MEMORY The memory is insufficient.
359 * @exception E_SYSTEM A system error has occurred.
360 * @remarks The specific error code can be accessed using the GetLastResult() method.
362 Tizen::Base::Collection::IList* GetRunningAppListN(void) const;
365 * Registers an application with a specific condition and launches it if the condition is met. @n
366 * If the requested application is already running, the application is notified through IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
367 * The launch arguments are given as input parameters to %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
370 * @privilege %http://tizen.org/privilege/application.launch
372 * @return An error code
373 * @param[in] condition The launch condition for the application @n
374 * The condition has L"Key='value'" format and is case sensitive. To use single or double quotes in the condition values, prefix them with a slash (\' or \"). @n
375 * For more information on the condition formats, see <a href="../org.tizen.native.appprogramming/html/guide/app/registering_launch_condition.htm">Registering a Launch Condition</a>.
376 * <table><tr><th>Condition Format</th><th>Meaning</th></tr>
377 <tr><td>L"DateTime='mm/dd/yyyy hh:mm:ss'"</td>
378 <td>The specified condition is the local due time.</td></tr>
379 <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
380 <td>The specific condition is the time period after due time.</td></tr>
381 <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
382 communication input command.</td></tr>
383 <tr><td>L"NFC='command'"</td><td>The specified condition is a Near Field Communication (NFC) tag that has the NFC Data Exchange Format (NDEF) data.
384 </td></tr></table> @n
387 * @param[in] pArguments A list of string arguments that has a maximum size of @c 1024 bytes @n
388 * The parameter can also contain @c null. @n
389 * For more information on the arguments, see <a href="../org.tizen.native.appprogramming/html/guide/app/launching_other_apps_within_apps.htm">Launching Other Applications</a>.
390 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
391 * @exception E_SUCCESS The method is successful.
392 * @exception E_INVALID_ARG The launch condition is empty or too long (Maximum 400 bytes).
393 * @exception E_INVALID_FORMAT The specified condition format is invalid.
394 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
395 * @exception E_OBJ_ALREADY_EXIST The specified @c condition is already registered by a different application.
396 * @exception E_OUT_OF_MEMORY The memory is insufficient.
397 * @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
398 * @exception E_SYSTEM A system error has occurred.
399 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
401 * @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
402 * @remarks The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
403 * @remarks Registering the same launch condition overwrites the previous launch argument without throwing an exception.
404 * @remarks The launch period requires more consideration because an inappropriate short period value may lead
405 * to an adverse effect on the device battery.
406 * @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
407 * @see UnregisterAppLaunch()
408 * @see IsAppLaunchRegistered()
409 * @see LaunchApplication()
410 * @see Tizen::Base::DateTime::ToString()
411 * @see Tizen::Io::SerialPort
413 * The following example demonstrates how to use the %RegisterAppLaunch() method.
418 * SystemTime::GetCurrentTime(TIME_MODE_WALL, time);
419 * time.AddMinutes(1);
422 * cond.Format(70, L"DueTime='%S' LaunchPeriod='60'", time.ToString().GetPointer());
424 * // Registers a periodic condition that fires every 60 minutes starting after one minute
425 * AppManager::GetInstance()->RegisterAppLaunch(cond, null, AppManager::LAUNCH_OPTION_DEFAULT)
429 result RegisterAppLaunch(const Tizen::Base::String& condition, const Tizen::Base::Collection::IList* pArguments, LaunchOption option);
432 * Unregisters the previously registered launch condition.
435 * @privilege %http://tizen.org/privilege/application.launch
437 * @return An error code
438 * @exception E_SUCCESS The method is successful.
439 * @exception E_SYSTEM A system error has occurred.
440 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
441 * @remarks E_SUCCESS An error occurs when there is no registered launch condition.
442 * @see RegisterAppLaunch()
443 * @see IsAppLaunchRegistered()
445 result UnregisterAppLaunch(void);
448 * Unregisters the specified launch condition.
451 * @privilege %http://tizen.org/privilege/application.launch
453 * @return An error code
454 * @param[in] condition The launch condition for the application
455 * @exception E_SUCCESS The method is successful.
456 * @exception E_OBJ_NOT_FOUND The specified launch condition is not found.
457 * @exception E_SYSTEM A system error has occurred.
458 * @exception E_OUT_OF_MEMORY The memory is insufficient.
459 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
460 * @see RegisterAppLaunch()
461 * @see IsAppLaunchRegistered()
463 result UnregisterAppLaunch(const Tizen::Base::String& condition);
466 * Checks whether a launch condition is registered for the application.
470 * @return @c true if a condition is already registered to the application invoking this method, @n
472 * @exception E_SUCCESS The method is successful.
473 * @exception E_SYSTEM A system error has occurred.
475 * @remarks The specific error code can be accessed using the GetLastResult() method.
476 * @see RegisterAppLaunch()
477 * @see UnregisterAppLaunch()
479 bool IsAppLaunchRegistered(void) const;
483 * Registers the specified application with a specific condition and launches it if the condition is met. @n
484 * If the requested application is already running, the application is notified through IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
485 * The launch arguments are given as input parameters to %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
488 * @visibility partner
489 * @privilege %http://tizen.org/privilege/appmanager.launch
491 * @return An error code
492 * @param[in] appId The ID of the application registered for launch
493 * @param[in] condition The launch condition for the application @n
494 * The condition has L"Key='value'" format and is case sensitive. To use single or double quotes in the condition values, prefix them with a slash (\' or \"). @n
495 * For more information on the condition formats, see <a href="../org.tizen.native.appprogramming/html/guide/app/registering_launch_condition.htm">Registering a Launch Condition</a>.
496 * <table><tr><th>Condition Format</th><th>Meaning</th></tr>
497 <tr><td>L"DateTime='mm/dd/yyyy hh:mm:ss'"</td>
498 <td>The specified condition is the local due time.</td></tr>
499 <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
500 <td>The specific condition is the time period after due time.</td></tr>
501 <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
502 communication input command.</td></tr>
503 <tr><td>L"NFC='command'"</td><td>The specified condition is a Near Field Communication (NFC) tag that has the NFC Data Exchange Format (NDEF) data.
504 </td></tr></table> @n
507 * @param[in] pArguments A list of string arguments that has a maximum size of @c 1024 bytes @n
508 * The parameter can also contain @c null. @n
509 * For more information on the arguments, see <a href="../org.tizen.native.appprogramming/html/guide/app/launching_other_apps_within_apps.htm">Launching Other Applications</a>.
510 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
511 * @exception E_SUCCESS The method is successful.
512 * @exception E_APP_NOT_INSTALLED The application is not installed.
513 * @exception E_INVALID_ARG The launch condition is empty or too long (Maximum 400 bytes).
514 * @exception E_INVALID_FORMAT The specified condition format is invalid.
515 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
516 * @exception E_OUT_OF_MEMORY The memory is insufficient.
517 * @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
518 * @exception E_SYSTEM A system error has occurred.
519 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
521 * @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
522 * @remarks The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
523 * @remarks Registering the same launch condition overwrites the previous launch argument without throwing an exception.
524 * @remarks The launch period requires more consideration because an inappropriate short period value may lead
525 * to an adverse effect on the device battery.
526 * @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
527 * @see UnregisterAppLaunch()
528 * @see IsAppLaunchRegistered()
529 * @see LaunchApplication()
530 * @see IAppLaunchConditionEventListener::OnAppLaunchConditionMetN()
531 * @see Tizen::Base::DateTime::ToString()
532 * @see Tizen::Io::SerialPort
535 result RegisterAppLaunch(const AppId& appId, const Tizen::Base::String& condition, const Tizen::Base::Collection::IList* pArguments, LaunchOption option);
539 * Unregisters the launch condition.
542 * @visibility partner
543 * @privilege %http://tizen.org/privilege/appmanager.launch
545 * @return An error code
546 * @param[in] appId The application ID
547 * @param[in] pCondition The launch condition to unregister @n
548 * If the parameter contains @c null, all the conditions are unregistered.
549 * @exception E_SUCCESS The method is successful.
550 * @exception E_APP_NOT_INSTALLED The application is not installed.
551 * @exception E_OBJ_NOT_FOUND The specified launch condition is not found.
552 * @exception E_SYSTEM A system error has occurred.
553 * @exception E_OUT_OF_MEMORY The memory is insufficient.
554 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
556 * @see RegisterAppLaunch()
557 * @see IsAppLaunchRegistered()
560 result UnregisterAppLaunch(const AppId& appId, const Tizen::Base::String* pCondition);
564 * Checks whether a previously registered launch condition is present for the specified application.
567 * @visibility partner
568 * @privilege %http://tizen.org/privilege/appmanager.launch
570 * @return @c true if a condition is already registered to the specified application with the specified condition, @n
572 * @param[in] appId The application ID
573 * @param[in] pCondition The launch condition to register for the specified @c appId @n
574 * If the parameter contains @c null, the method checks for any registered launch condition for the specified @c appId.
575 * @exception E_SUCCESS The method is successful.
576 * @exception E_APP_NOT_INSTALLED The application is not installed.
577 * @exception E_SYSTEM A system error has occurred.
578 * @exception E_OUT_OF_MEMORY The memory is insufficient.
579 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
581 * @remarks The specific error code can be accessed using the GetLastResult() method.
582 * @see RegisterAppLaunch()
583 * @see UnregisterAppLaunch()
586 bool IsAppLaunchRegistered(const AppId& appId, const Tizen::Base::String* pCondition = null) const;
589 * Sets a checkpoint event listener. @n
590 * The listener gets notified when a checkpoint event is fired.
594 * @return An error code
595 * @param[in] listener The listener to receive the checkpoint event
596 * @exception E_SUCCESS The method is successful.
597 * @exception E_OBJ_ALREADY_EXIST The listener is already set.
598 * @exception E_SYSTEM A system error has occurred.
599 * @see IAppCheckpointEventListener
602 result SetCheckpointEventListener(IAppCheckpointEventListener& listener);
606 * Sends the result list for the application control request. @n
607 * The client can get the result list by implementing IAppControlEventListener::OnAppControlCompleted().
609 * @brief <i> [Deprecated] </i>
610 * @deprecated This method is deprecated because a new method has been added. @n
611 * Instead of using this method, use AppControlProviderManager::SendAppControlResult().
614 * @return An error code
615 * @param[in] appControlRequestId The application control request ID @n
616 * The application control request ID is given as an argument for
617 * App::GetAppArgumentListN() or App::OnUserEventReceivedN().
618 * @param[in] pResultList The list of the result strings of the application control
619 * @exception E_SUCCESS The method is successful.
620 * @exception E_OBJ_NOT_FOUND The application control request is not found.
621 * @exception E_OUT_OF_MEMORY The memory is insufficient.
622 * @exception E_SYSTEM A system error has occurred.
623 * @see IAppControlEventListener
626 static result SendAppControlResult(const Tizen::Base::String& appControlRequestId, const Tizen::Base::Collection::IList* pResultList);
629 * Sets an IAppLaunchConditionEventListener to the %AppManager. @n
630 * The listener gets notified when the application is launched by the registered condition.
634 * @param[in] pListener The event listener @n
635 * To unset the listener, pass a @c null value to the listener parameter.
636 * @remarks If the application is newly launched by the condition, then %SetAppLaunchConditionEventListener() must
637 * be set within App::OnAppInitializing().
638 * If the application does not set the listener using %SetAppLaunchConditionEventListener(),
639 * then the application is launched without invoking any listener for the condition.
640 * @see RegisterAppLaunch()
642 void SetAppLaunchConditionEventListener(IAppLaunchConditionEventListener* pListener);
646 * Adds an IActiveAppEventListener to the %AppManager. @n
647 * The listener gets notified when the active application is changed.
651 * @visibility partner
652 * @privilege %http://tizen.org/privilege/appusage
654 * @return An error code
655 * @param[in] listener The event listener
656 * @exception E_SUCCESS The method is successful.
657 * @exception E_OUT_OF_MEMORY The memory is insufficient.
658 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
659 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
660 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
661 * @remarks Active application is the top most window with focus.
662 * @see GetActiveApp()
663 * @see RemoveActiveAppEventListener()
664 * @see IActiveAppEventListener
667 result AddActiveAppEventListener(IActiveAppEventListener& listener);
671 * Removes an IActiveAppEventListener from the %AppManager.
675 * @visibility partner
676 * @privilege %http://tizen.org/privilege/appusage
678 * @return An error code
679 * @param[in] listener The event listener
680 * @exception E_SUCCESS The method is successful.
681 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
682 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
683 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
684 * @see GetActiveApp()
685 * @see AddActiveAppEventListener()
686 * @see IActiveAppEventListener
689 result RemoveActiveAppEventListener(IActiveAppEventListener& listener);
693 * Gets the current active application AppId.
697 * @visibility partner
698 * @privilege %http://tizen.org/privilege/appusage
700 * @return An error code
701 * @param[out] appId The AppId of the active application
702 * @exception E_SUCCESS The method is successful.
703 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
704 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
705 * @remarks Active application is the top most window with focus.
706 * @see AddActiveAppEventListener()
707 * @see RemoveActiveAppEventListener()
710 result GetActiveApp(AppId& appId);
714 * This default constructor is intentionally declared as private to implement the %Singleton semantic.
721 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
725 AppManager(const AppManager& rhs);
728 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
732 AppManager& operator =(const AppManager& rhs);
735 * Constructs the instance of this class.
739 * @return An error code
740 * @exception E_SUCCESS The method is successful.
741 * @exception E_OUT_OF_MEMORY The memory is insufficient.
742 * @exception E_SYSTEM A system error has occurred.
744 result Construct(void);
747 * This destructor is intentionally declared as private to implement the %Singleton semantic.
751 virtual ~AppManager(void);
754 class _AppManagerImpl* __pAppManagerImpl;
756 friend class _AppManagerImpl;
761 #endif // _FAPP_APP_MANAGER_H_