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> and <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.
138 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);
142 * Starts the application control if there is only one application control that matches the specified URI, operation ID, and data type. @n
143 * If there are more than one application controls, the one that the user selects is started.
145 * @brief <i> [Deprecated] </i>
146 * @deprecated This method is deprecated because IAppControlListener is deprecated and replaced by IAppControlResponselistener.
147 * 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().
191 * @privilege %http://tizen.org/privilege/application.launch
193 * @return An error code
194 * @param[in] pOperationId The operation ID
195 * @param[in] pCategory The application control category
196 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
197 * The '.' prefix must be used when specifying the file extension.
198 * @param[in] pUriPattern A URI pattern which is used for application control resolution and delivered as the argument
199 * @param[in] pDataList The data list that is delivered to the resolved application control @n
200 * It has a maximum size of @c 1024 bytes.
201 * @param[in] pListener A listener that gets notified when the resolved application control has started
202 * @exception E_SUCCESS The method is successful.
203 * @exception E_INVALID_ARG At least one of the specified @c pOperationId, @c pCategory, @c pDataType, or @c pUri must not be @c null.
204 * @exception E_MAX_EXCEEDED The size of @c pDataList has exceeded the maximum limit.
205 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
206 * @exception E_OBJ_NOT_FOUND The application control is not found.
207 * @exception E_IN_PROGRESS The target application control is in progress.
208 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
209 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
210 * @remarks For delivered launch arguments, see App::GetAppArgumentListN().
211 * @see App::GetAppArgumentListN()
212 * @see FindAppControlsN()
213 * @see AppControl::Start()
216 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);
219 * Gets the SQL-type data control that the caller wants to use. @n
220 * It resolves the matching data control with the specified data control provider ID.
224 * @return A pointer to the SqlDataControl instance if a matching data control is found, @n
226 * @param[in] providerId The provider ID
227 * @exception E_SUCCESS The method is successful.
228 * @exception E_OBJ_NOT_FOUND The data control specified with the @c providerId is not found.
229 * @exception E_ILLEGAL_ACCESS Access is denied due to insufficient permission.
230 * @exception E_OUT_OF_MEMORY The memory is insufficient.
231 * @exception E_SYSTEM A system error has occurred.
232 * @remarks The specific error code can be accessed using the GetLastResult() method.
234 static SqlDataControl* GetSqlDataControlN(const Tizen::Base::String& providerId);
237 * Gets the MAP-type data control that the caller wants to use. @n
238 * It resolves the matching data control with the specified data control provider ID.
242 * @return A pointer to the MapDataControl instance if a matching data control is found, @n
244 * @param[in] providerId The provider ID
245 * @exception E_SUCCESS The method is successful.
246 * @exception E_OBJ_NOT_FOUND The data control specified with the @c providerId is not found.
247 * @exception E_ILLEGAL_ACCESS Access is denied due to insufficient permission.
248 * @exception E_OUT_OF_MEMORY The memory is insufficient.
249 * @exception E_SYSTEM A system error has occurred.
250 * @remarks The specific error code can be accessed using the GetLastResult() method.
252 static MapDataControl* GetMapDataControlN(const Tizen::Base::String& providerId);
255 * Gets the path of the read-only shared directory exported by an other application specified with an application ID.
259 * @return The other application's shared directory path, @n
260 * else an empty string if an exception occurs
261 * @param[in] appId The application ID
262 * @exception E_SUCCESS The method is successful.
263 * @exception E_APP_NOT_INSTALLED The expected shared directory cannot be found
264 * because the application specified with @c appId cannot be installed.
266 * - The returned path can be invalid when the application with specified with @c appId is uninstalled.
267 * - The specific error code can be accessed using the GetLastResult() method.
269 static Tizen::Base::String GetAppSharedPath(const AppId& appId);
272 * Gets the application manager instance.
276 * @return A pointer to the %AppManager instance, @n
277 * else @c null if it fails
279 static AppManager* GetInstance(void);
283 * Launches the default application with the given @c appId. @n
284 * The launch arguments are given as App::OnUserEventReceivedN() or can be obtained by
285 * invoking App::GetAppArgumentListN(), especially within App::OnAppInitializing().
287 * @brief <i> [Deprecated] </i>
288 * @deprecated This method is deprecated because sending argument with %LaunchApplication() is not recommended. @n
289 * Instead of using this method, use %LaunchApplication() without launch arguments or AppControl::Start().
292 * @privilege %http://tizen.org/privilege/application.launch
294 * @return An error code
295 * @param[in] appId The application's ID to execute
296 * @param[in] pArguments A pointer to the list of string arguments that has a maximum size of @c 1024 bytes
297 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
298 * @exception E_SUCCESS The method is successful.
299 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
300 * @exception E_INVALID_ARG The specified @c appId is empty.
301 * @exception E_OBJ_NOT_FOUND The target application is not installed.
302 * @exception E_OUT_OF_MEMORY The memory is insufficient.
303 * @exception E_MAX_EXCEEDED The size of @c appId or @c pArguments has exceeded the maximum limit.
304 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
305 * @exception E_ILLEGAL_ACCESS The application is not signed with the same certificate of target application. @b Since: @b 2.1
308 result LaunchApplication(const AppId& appId, const Tizen::Base::Collection::IList* pArguments, LaunchOption option = LAUNCH_OPTION_DEFAULT);
311 * Launches the default application with the given @c appId.
315 * @privilege %http://tizen.org/privilege/application.launch
317 * @return An error code
318 * @param[in] appId The application's ID to execute
319 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
320 * @exception E_SUCCESS The method is successful.
321 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
322 * @exception E_APP_NOT_INSTALLED The target application is not installed.
323 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
324 * @exception E_ILLEGAL_ACCESS The application is not signed with the same certificate of target application. @b Since: @b 2.1
326 result LaunchApplication(const AppId& appId, LaunchOption option = LAUNCH_OPTION_DEFAULT);
329 * Terminates an application.
333 * @privilege %http://tizen.org/privilege/appmanager.kill @n
334 * (%http://tizen.org/privilege/application.kill is deprecated.)
336 * @return An error code
337 * @param[in] appId The application's ID to execute
338 * @exception E_SUCCESS The method is successful.
339 * @exception E_SYSTEM A system error has occurred.
340 * @exception E_OBJ_NOT_FOUND The application is either not installed or is not running.
341 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
343 result TerminateApplication(const AppId& appId);
346 * Checks whether an application is running.
350 * @return @c true if the application is running, @n
352 * @param[in] appId The installed application ID
354 bool IsRunning(const AppId& appId) const;
357 * Gets a list of running applications at the time of invocation.
361 * @return A pointer to the running state application list (AppId), @n
362 * else @c null if an error occurs
363 * @exception E_SUCCESS The method is successful.
364 * @exception E_OUT_OF_MEMORY The memory is insufficient.
365 * @exception E_SYSTEM A system error has occurred.
366 * @remarks The specific error code can be accessed using the GetLastResult() method.
368 Tizen::Base::Collection::IList* GetRunningAppListN(void) const;
371 * Registers an application with a specific condition and launches it if the condition is met. @n
372 * If the requested application is already running, the application is notified through IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
373 * The launch arguments are given as input parameters to %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
377 * @privilege %http://tizen.org/privilege/application.launch
378 * @feature %http://tizen.org/feature/network.nfc for L"NFC='command'" or %http://tzen.org/feature/usb.accessory for "Serial='command'" in the value of @c condition
380 * @return An error code
381 * @param[in] condition The launch condition for the application @n
382 * 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
383 * 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>.
384 * <table><tr><th>Condition Format</th><th>Meaning</th></tr>
385 <tr><td>L"DateTime='mm/dd/yyyy hh:mm:ss'"</td>
386 <td>The specified condition is the local due time.</td></tr>
387 <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
388 <td>The specific condition is the time period after due time.</td></tr>
389 <tr><td>L"WeeklyTime='EEE HH:mm:ss'"</td>
390 <td>The specified condition is a day of week with specific time to launch an application for every week. For multiple description, "," delimiter can be used like following example.<br>i"Mon 09:00:00, Tue 09:00:00, Wed 09:00:00, Thu 09:00:00, Fir 09:00:00"<br> The format of a day of week is support following string only.<br>Mon: Monday<br>Tue: Tuesday<br>Wed: Wednesday<br>Thu: Thursday<br>Fri: Friday<br>Sat: Saturday<br>Sun: Sunday</td></tr>
391 <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
392 communication input command.</td></tr>
393 <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.
394 </td></tr></table> @n
397 * @param[in] pArguments A list of string arguments that has a maximum size of @c 1024 bytes @n
398 * The parameter can also contain @c null. @n
399 * 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>.
400 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
401 * @exception E_SUCCESS The method is successful.
402 * @exception E_INVALID_ARG The launch condition is empty or too long (Maximum 400 bytes).
403 * @exception E_INVALID_FORMAT The specified condition format is invalid.
404 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
405 * @exception E_OBJ_ALREADY_EXIST The specified @c condition is already registered by a different application.
406 * @exception E_OUT_OF_MEMORY The memory is insufficient.
407 * @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
408 * @exception E_SYSTEM A system error has occurred.
409 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
410 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>. @b Since: @b 2.1
412 * @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
413 * @remarks The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
414 * @remarks Registering the same launch condition overwrites the previous launch argument without throwing an exception.
415 * @remarks The launch period requires more consideration because an inappropriate short period value may lead
416 * to an adverse effect on the device battery.
417 * @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
418 * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
419 * @see UnregisterAppLaunch()
420 * @see IsAppLaunchRegistered()
421 * @see LaunchApplication(const AppId&, LaunchOption);
422 * @see Tizen::Base::DateTime::ToString()
423 * @see Tizen::Io::SerialPort
425 * The following example demonstrates how to use the %RegisterAppLaunch() method.
430 * SystemTime::GetCurrentTime(TIME_MODE_WALL, time);
431 * time.AddMinutes(1);
434 * cond.Format(70, L"DueTime='%S' LaunchPeriod='60'", time.ToString().GetPointer());
436 * // Registers a periodic condition that fires every 60 minutes starting after one minute
437 * AppManager::GetInstance()->RegisterAppLaunch(cond, null, AppManager::LAUNCH_OPTION_DEFAULT)
441 result RegisterAppLaunch(const Tizen::Base::String& condition, const Tizen::Base::Collection::IList* pArguments, LaunchOption option);
444 * Unregisters the previously registered launch condition.
448 * @privilege %http://tizen.org/privilege/application.launch
450 * @return An error code
451 * @exception E_SUCCESS Either of the following conditions has occurred:
452 * - The method is successful.
453 * - There is no registered launch condition.
454 * @exception E_SYSTEM A system error has occurred.
455 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
456 * @see RegisterAppLaunch()
457 * @see IsAppLaunchRegistered()
459 result UnregisterAppLaunch(void);
462 * Unregisters the specified launch condition.
466 * @privilege %http://tizen.org/privilege/application.launch
468 * @return An error code
469 * @param[in] condition The launch condition for the application
470 * @exception E_SUCCESS The method is successful.
471 * @exception E_OBJ_NOT_FOUND The specified launch condition is not found.
472 * @exception E_SYSTEM A system error has occurred.
473 * @exception E_OUT_OF_MEMORY The memory is insufficient.
474 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
475 * @see RegisterAppLaunch()
476 * @see IsAppLaunchRegistered()
478 result UnregisterAppLaunch(const Tizen::Base::String& condition);
481 * Checks whether a launch condition is registered for the application.
485 * @return @c true if a condition is already registered to the application invoking this method, @n
487 * @exception E_SUCCESS The method is successful.
488 * @exception E_SYSTEM A system error has occurred.
490 * @remarks The specific error code can be accessed using the GetLastResult() method.
491 * @see RegisterAppLaunch()
492 * @see UnregisterAppLaunch()
494 bool IsAppLaunchRegistered(void) const;
497 * Registers the specified application with a specific condition and launches it if the condition is met. @n
498 * If the requested application is already running, the application is notified through IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
499 * The launch arguments are given as input parameters to %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
503 * @privilege %http://tizen.org/privilege/appmanager.launch
504 * @feature %http://tizen.org/feature/network.nfc for L"NFC='command'" or %http://tzen.org/feature/usb.accessory for L"Serial='command'" in the value of @c condition
506 * @return An error code
507 * @param[in] appId The ID of the application registered for launch
508 * @param[in] condition The launch condition for the application @n
509 * 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
510 * 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>.
511 * <table><tr><th>Condition Format</th><th>Meaning</th></tr>
512 <tr><td>L"DateTime='mm/dd/yyyy hh:mm:ss'"</td>
513 <td>The specified condition is the local due time.</td></tr>
514 <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
515 <td>The specific condition is the time period after due time.</td></tr>
516 <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
517 communication input command.</td></tr>
518 <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.
519 </td></tr></table> @n
522 * @param[in] pArguments A list of string arguments that has a maximum size of @c 1024 bytes @n
523 * The parameter can also contain @c null. @n
524 * 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>.
525 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
526 * @exception E_SUCCESS The method is successful.
527 * @exception E_APP_NOT_INSTALLED The application is not installed.
528 * @exception E_INVALID_ARG The launch condition is empty or too long (Maximum 400 bytes).
529 * @exception E_INVALID_FORMAT The specified condition format is invalid.
530 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
531 * @exception E_OUT_OF_MEMORY The memory is insufficient.
532 * @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
533 * @exception E_SYSTEM A system error has occurred.
534 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
535 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>. @b Since: @b 2.1
537 * @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
538 * @remarks The newly introduced launch condition does not work on the previous SDK version and the @c E_INVALID_CONDITION exception is returned.
539 * @remarks Registering the same launch condition overwrites the previous launch argument without throwing an exception.
540 * @remarks The launch period requires more consideration because an inappropriate short period value may lead
541 * to an adverse effect on the device battery.
542 * @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
543 * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
544 * @see UnregisterAppLaunch()
545 * @see IsAppLaunchRegistered()
546 * @see LaunchApplication(const AppId&, LaunchOption);
547 * @see IAppLaunchConditionEventListener::OnAppLaunchConditionMetN()
548 * @see Tizen::Base::DateTime::ToString()
549 * @see Tizen::Io::SerialPort
551 result RegisterAppLaunch(const AppId& appId, const Tizen::Base::String& condition, const Tizen::Base::Collection::IList* pArguments, LaunchOption option);
554 * Unregisters the launch condition.
558 * @privilege %http://tizen.org/privilege/appmanager.launch
560 * @return An error code
561 * @param[in] appId The application ID
562 * @param[in] pCondition The launch condition to unregister @n
563 * If the parameter contains @c null, all the conditions are unregistered.
564 * @exception E_SUCCESS The method is successful.
565 * @exception E_APP_NOT_INSTALLED The application is not installed.
566 * @exception E_OBJ_NOT_FOUND The specified launch condition is not found.
567 * @exception E_SYSTEM A system error has occurred.
568 * @exception E_OUT_OF_MEMORY The memory is insufficient.
569 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
571 * @see RegisterAppLaunch()
572 * @see IsAppLaunchRegistered()
574 result UnregisterAppLaunch(const AppId& appId, const Tizen::Base::String* pCondition);
577 * Checks whether a previously registered launch condition is present for the specified application.
581 * @privilege %http://tizen.org/privilege/appmanager.launch
583 * @return @c true if a condition is already registered to the specified application with the specified condition, @n
585 * @param[in] appId The application ID
586 * @param[in] pCondition The launch condition to register for the specified @c appId @n
587 * If the parameter contains @c null, the method checks for any registered launch condition for the specified @c appId.
588 * @exception E_SUCCESS The method is successful.
589 * @exception E_APP_NOT_INSTALLED The application is not installed.
590 * @exception E_SYSTEM A system error has occurred.
591 * @exception E_OUT_OF_MEMORY The memory is insufficient.
592 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
594 * @remarks The specific error code can be accessed using the GetLastResult() method.
595 * @see RegisterAppLaunch()
596 * @see UnregisterAppLaunch()
598 bool IsAppLaunchRegistered(const AppId& appId, const Tizen::Base::String* pCondition = null) const;
601 * Sets a checkpoint event listener. @n
602 * The listener gets notified when a checkpoint event is fired.
606 * @return An error code
607 * @param[in] listener The listener to receive the checkpoint event
608 * @exception E_SUCCESS The method is successful.
609 * @exception E_OBJ_ALREADY_EXIST The listener is already set.
610 * @exception E_SYSTEM A system error has occurred.
611 * @see IAppCheckpointEventListener
614 result SetCheckpointEventListener(IAppCheckpointEventListener& listener);
618 * Sends the result list for the application control request. @n
619 * The client can get the result list by implementing IAppControlEventListener::OnAppControlCompleted().
621 * @brief <i> [Deprecated] </i>
622 * @deprecated This method is deprecated because a new method has been added. @n
623 * Instead of using this method, use AppControlProviderManager::SendAppControlResult().
626 * @return An error code
627 * @param[in] appControlRequestId The application control request ID @n
628 * The application control request ID is given as an argument for
629 * App::GetAppArgumentListN() or App::OnUserEventReceivedN().
630 * @param[in] pResultList The list of the result strings of the application control
631 * @exception E_SUCCESS The method is successful.
632 * @exception E_OBJ_NOT_FOUND The application control request is not found.
633 * @exception E_OUT_OF_MEMORY The memory is insufficient.
634 * @exception E_SYSTEM A system error has occurred.
635 * @see IAppControlEventListener
638 static result SendAppControlResult(const Tizen::Base::String& appControlRequestId, const Tizen::Base::Collection::IList* pResultList);
641 * Sets an IAppLaunchConditionEventListener to the %AppManager. @n
642 * The listener gets notified when the application is launched by the registered condition.
646 * @param[in] pListener The event listener @n
647 * To unset the listener, pass a @c null value to the listener parameter.
648 * @remarks If the application is newly launched by the condition, then %SetAppLaunchConditionEventListener() must
649 * be set within App::OnAppInitializing().
650 * If the application does not set the listener using %SetAppLaunchConditionEventListener(),
651 * then the application is launched without invoking any listener for the condition.
652 * @see RegisterAppLaunch()
654 void SetAppLaunchConditionEventListener(IAppLaunchConditionEventListener* pListener);
657 * Adds an IActiveAppEventListener to the %AppManager. @n
658 * The listener gets notified when the active application is changed.
663 * @privilege %http://tizen.org/privilege/appusage
665 * @return An error code
666 * @param[in] listener The event listener
667 * @exception E_SUCCESS The method is successful.
668 * @exception E_OUT_OF_MEMORY The memory is insufficient.
669 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
670 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
671 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
672 * @remarks Active application is the top most window with focus.
673 * @see GetActiveApp()
674 * @see RemoveActiveAppEventListener()
675 * @see IActiveAppEventListener
677 result AddActiveAppEventListener(IActiveAppEventListener& listener);
680 * Removes an IActiveAppEventListener from the %AppManager.
685 * @privilege %http://tizen.org/privilege/appusage
687 * @return An error code
688 * @param[in] listener The event listener
689 * @exception E_SUCCESS The method is successful.
690 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
691 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
692 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
693 * @see GetActiveApp()
694 * @see AddActiveAppEventListener()
695 * @see IActiveAppEventListener
697 result RemoveActiveAppEventListener(IActiveAppEventListener& listener);
700 * Gets the current active application AppId.
705 * @privilege %http://tizen.org/privilege/appusage
707 * @return An error code
708 * @param[out] appId The AppId of the active application
709 * @exception E_SUCCESS The method is successful.
710 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
711 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
712 * @remarks Active application is the top most window with focus.
713 * @see AddActiveAppEventListener()
714 * @see RemoveActiveAppEventListener()
716 result GetActiveApp(AppId& appId);
720 * This default constructor is intentionally declared as private to implement the %Singleton semantic.
727 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
731 AppManager(const AppManager& rhs);
734 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
738 AppManager& operator =(const AppManager& rhs);
741 * Constructs the instance of this class.
745 * @return An error code
746 * @exception E_SUCCESS The method is successful.
747 * @exception E_OUT_OF_MEMORY The memory is insufficient.
748 * @exception E_SYSTEM A system error has occurred.
750 result Construct(void);
753 * This destructor is intentionally declared as private to implement the %Singleton semantic.
757 virtual ~AppManager(void);
760 class _AppManagerImpl* __pAppManagerImpl;
762 friend class _AppManagerImpl;
767 #endif // _FAPP_APP_MANAGER_H_