2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FAppAppManager.h
19 * @brief This is the header file for the %AppManager class.
21 * This header file contains the declarations of the %AppManager class.
24 #ifndef _FAPP_APP_MANAGER_H_
25 #define _FAPP_APP_MANAGER_H_
27 #include <FBaseObject.h>
28 #include <FAppTypes.h>
30 namespace Tizen { namespace Base {
32 namespace Collection {
38 namespace Tizen { namespace App
41 class IAppControlEventListener;
42 class IAppControlListener;
43 class IAppControlResponseListener;
44 class IAppCheckpointEventListener;
45 class IAppLaunchConditionEventListener;
46 class IActiveAppEventListener;
53 * @brief This class manages all the applications.
57 * @final This class is not intended for extension.
59 * The %AppManager class manages all the applications.
60 * The application manager supports normal and conditional application launch, and application control search and launch.
61 * It looks up the specific application control from the application control registry and creates an application control instance.
63 * 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>.
65 class _OSP_EXPORT_ AppManager
66 : public Tizen::Base::Object
72 * Defines the launch options.
78 LAUNCH_OPTION_DEFAULT /**< The launch option: default */
82 * Finds the application control that the caller wants to start. @n
83 * It resolves the matched application control with the delivered application ID and operation ID.
87 * @return A pointer to the newly created AppControl instance if a matched %AppControl is found, @n
89 * @param[in] appId The application ID
90 * @param[in] operationId The operation ID
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_OBJ_NOT_FOUND The application control is not found.
93 * @exception E_SYSTEM A system error has occurred. @n
94 * Either the file operation or the DB operation has failed.
95 * @remarks The specific error code can be accessed using the GetLastResult() method.
96 * @remarks %Tizen platform defines platform-defined alias for application ID and this aliased application ID
97 * can be used to find the AppControl. For more information, see
98 * <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">here</a>.
100 * The following example demonstrates how to use the %FindAppControlN() method to find the application control.
103 * String telUri = L"tel:12345678900";
105 * AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone", L"http://tizen.org/appcontrol/operation/dial");
106 * pAc->Start(&telUri, null, null, null);
109 static AppControl* FindAppControlN(const AppId& appId, const Tizen::Base::String& operationId);
112 * Finds a list of AppControl instances that matches the specified operation ID, category,
113 * data type, and URI pattern.
117 * @return A pointer to the list of the AppControl instances that matches the specified operation ID, category, URI, and data type, @n
118 * else @c null if it fails
119 * @param[in] pOperationId The operation ID
120 * @param[in] pCategory The application category
121 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
122 * The '.' prefix must be used when specifying the file extension.
123 * @param[in] pUriPattern The URI pattern
125 * @exception E_SUCCESS The method is successful.
126 * @exception E_INVALID_ARG At least one of the specified @c pOperationId, @c pCategory, @c pDataType, or @c pUriScheme must not be @c null.
127 * @exception E_INVALID_FORMAT The specified URI scheme is invalid (RFC 2396).
128 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
129 * @exception E_OBJ_NOT_FOUND The application control is not found.
130 * @exception E_SYSTEM A system error has occurred. @n
131 * Either the file operation or the DB operation has failed.
132 * @remarks The specific error code can be accessed using the GetLastResult() method.
134 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);
138 * Starts the application control if there is only one application control that matches the specified URI, operation ID, and data type. @n
139 * If there are more than one application controls, the one that the user selects is started.
141 * @brief <i> [Deprecated] </i>
142 * @deprecated This method is deprecated because IAppControlListener is deprecated and replaced by IAppControlResponselistener.
143 * Instead of using this method, use AppControl::FindAndStart().
146 * @privilege %http://tizen.org/privilege/application.launch
148 * @return An error code
149 * @param[in] uriData The URI that has a maximum size of @c 1024 bytes
150 * @param[in] pOperationId The operation ID
151 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
152 * The '.' prefix must be used for the @c dataType when specifying the file extension.
153 * @param[in] pListener A listener that gets notified when the resolved application control has started
154 * @exception E_SUCCESS The method is successful.
155 * @exception E_MAX_EXCEEDED The size of @c uri has exceeded the maximum limit.
156 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
157 * @exception E_OUT_OF_MEMORY The memory is insufficient.
158 * @exception E_OBJ_NOT_FOUND The application control is not found.
159 * @exception E_IN_PROGRESS The target application control is in progress.
160 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
161 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
163 * @see App::GetAppArgumentListN()
164 * @see FindAppControlN()
165 * @see FindAppControlsN()
166 * @see AppControl::Start()
168 * The following example demonstrates how to use the %StartAppControl() method.
170 * String operationId = L"http://tizen.org/appcontrol/operation/call";
171 * StartAppControl(L"tel:1234567890", &operationId, null, null);
175 static result StartAppControl(const Tizen::Base::String& uriData, const Tizen::Base::String* pOperationId, const Tizen::Base::String* pDataType, IAppControlListener* pListener);
179 * Starts the application control if there is only one application control that matches the specified operation ID, category, URI, and data type. @n
180 * If there are more than one application controls, the one that the user selects is started.
182 * @brief <i> [Deprecated] </i>
183 * @deprecated This method is deprecated because IAppControlListener is deprecated and replaced by IAppControlResponselistener.
184 * Instead of using this method, use AppControl::FindAndStart().
187 * @privilege %http://tizen.org/privilege/application.launch
189 * @return An error code
190 * @param[in] pOperationId The operation ID
191 * @param[in] pCategory The application control category
192 * @param[in] pDataType The MIME type (RFC 2046) or file extension @n
193 * The '.' prefix must be used when specifying the file extension.
194 * @param[in] pUriPattern A URI pattern which is used for application control resolution and delivered as the argument
195 * @param[in] pDataList The data list that is delivered to the resolved application control @n
196 * It has a maximum size of @c 1024 bytes.
197 * @param[in] pListener A listener that gets notified when the resolved application control has started
198 * @exception E_SUCCESS The method is successful.
199 * @exception E_INVALID_ARG At least one of the specified @c pOperationId, @c pCategory, @c pDataType, or @c pUri must not be @c null.
200 * @exception E_MAX_EXCEEDED The size of @c pDataList has exceeded the maximum limit.
201 * @exception E_UNSUPPORTED_FORMAT The specified file extension for @c pDataType is not supported.
202 * @exception E_OBJ_NOT_FOUND The application control is not found.
203 * @exception E_IN_PROGRESS The target application control is in progress.
204 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
205 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
206 * @remarks For delivered launch arguments, see App::GetAppArgumentListN().
207 * @see App::GetAppArgumentListN()
208 * @see FindAppControlsN()
209 * @see AppControl::Start()
212 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);
215 * Gets the SQL-type data control that the caller wants to use. @n
216 * It resolves the matching data control with the specified data control provider ID.
220 * @return A pointer to the SqlDataControl instance if a matching data control is found, @n
222 * @param[in] providerId The provider ID
223 * @exception E_SUCCESS The method is successful.
224 * @exception E_OBJ_NOT_FOUND The data control specified with the @c providerId is not found.
225 * @exception E_ILLEGAL_ACCESS Access is denied due to insufficient permission.
226 * @exception E_OUT_OF_MEMORY The memory is insufficient.
227 * @exception E_SYSTEM A system error has occurred.
228 * @remarks The specific error code can be accessed using the GetLastResult() method.
230 static SqlDataControl* GetSqlDataControlN(const Tizen::Base::String& providerId);
233 * Gets the MAP-type data control that the caller wants to use. @n
234 * It resolves the matching data control with the specified data control provider ID.
238 * @return A pointer to the MapDataControl instance if a matching data control is found, @n
240 * @param[in] providerId The provider ID
241 * @exception E_SUCCESS The method is successful.
242 * @exception E_OBJ_NOT_FOUND The data control specified with the @c providerId is not found.
243 * @exception E_ILLEGAL_ACCESS Access is denied due to insufficient permission.
244 * @exception E_OUT_OF_MEMORY The memory is insufficient.
245 * @exception E_SYSTEM A system error has occurred.
246 * @remarks The specific error code can be accessed using the GetLastResult() method.
248 static MapDataControl* GetMapDataControlN(const Tizen::Base::String& providerId);
251 * Gets the path of the read-only shared directory exported by an other application specified with an application ID.
255 * @return The other application's shared directory path, @n
256 * else an empty string if an exception occurs
257 * @param[in] appId The application ID
258 * @exception E_SUCCESS The method is successful.
259 * @exception E_APP_NOT_INSTALLED The expected shared directory cannot be found
260 * because the application specified with @c appId cannot be installed.
262 * - The returned path can be invalid when the application with specified with @c appId is uninstalled.
263 * - The specific error code can be accessed using the GetLastResult() method.
265 static Tizen::Base::String GetAppSharedPath(const AppId& appId);
268 * Gets the application manager instance.
272 * @return A pointer to the %AppManager instance, @n
273 * else @c null if it fails
275 static AppManager* GetInstance(void);
279 * Launches the default application with the given @c appId. @n
280 * The launch arguments are given as App::OnUserEventReceivedN() or can be obtained by
281 * invoking App::GetAppArgumentListN(), especially within App::OnAppInitializing().
283 * @brief <i> [Deprecated] </i>
284 * @deprecated This method is deprecated because sending argument with %LaunchApplication() is not recommended. @n
285 * 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.
301 * @exception E_ILLEGAL_ACCESS The application is not signed with the same certificate of target application. @b Since: @b 2.1
304 result LaunchApplication(const AppId& appId, const Tizen::Base::Collection::IList* pArguments, LaunchOption option = LAUNCH_OPTION_DEFAULT);
307 * Launches the default application with the given @c appId.
311 * @privilege %http://tizen.org/privilege/application.launch
313 * @return An error code
314 * @param[in] appId The application's ID to execute
315 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
316 * @exception E_SUCCESS The method is successful.
317 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
318 * @exception E_APP_NOT_INSTALLED The target application is not installed.
319 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
320 * @exception E_ILLEGAL_ACCESS The application is not signed with the same certificate of target application. @b Since: @b 2.1
322 result LaunchApplication(const AppId& appId, LaunchOption option = LAUNCH_OPTION_DEFAULT);
325 * Terminates an application.
329 * @privilege %http://tizen.org/privilege/appmanager.kill @n
330 * (%http://tizen.org/privilege/application.kill is deprecated.)
332 * @return An error code
333 * @param[in] appId The application's ID to execute
334 * @exception E_SUCCESS The method is successful.
335 * @exception E_SYSTEM A system error has occurred.
336 * @exception E_OBJ_NOT_FOUND The application is either not installed or is not running.
337 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
339 result TerminateApplication(const AppId& appId);
342 * Checks whether an application is running.
346 * @return @c true if the application is running, @n
348 * @param[in] appId The installed application ID
350 bool IsRunning(const AppId& appId) const;
353 * Gets a list of running applications at the time of invocation.
357 * @return A pointer to the running state application list (AppId), @n
358 * else @c null if an error occurs
359 * @exception E_SUCCESS The method is successful.
360 * @exception E_OUT_OF_MEMORY The memory is insufficient.
361 * @exception E_SYSTEM A system error has occurred.
362 * @remarks The specific error code can be accessed using the GetLastResult() method.
364 Tizen::Base::Collection::IList* GetRunningAppListN(void) const;
367 * Registers an application with a specific condition and launches it if the condition is met. @n
368 * If the requested application is already running, the application is notified through IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
369 * The launch arguments are given as input parameters to %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
373 * @privilege %http://tizen.org/privilege/application.launch
374 * @feature %http://tizen.org/feature/network.nfc for L"NFC='command'" or %http://tizen.org/feature/usb.accessory for "Serial='command'" in the value of @c condition
376 * @return An error code
377 * @param[in] condition The launch condition for the application @n
378 * 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
379 * 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>.
380 * <table><tr><th>Condition Format</th><th>Meaning</th></tr>
381 <tr><td>L"DateTime='mm/dd/yyyy hh:mm:ss'"</td>
382 <td>The specified condition is the local due time.</td></tr>
383 <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
384 <td>The specific condition is the time period after due time.</td></tr>
385 <tr><td>L"WeeklyTime='EEE HH:mm:ss'"</td>
386 <td>The specified condition is a day of a week with a specific time at which the application is launched on a weekly basis. For multiple descriptions, "," delimiter can be used as shown in the following example: <br>i"'Mon 09:00:00', 'Tue 09:00:00', 'Wed 09:00:00', 'Thu 09:00:00', 'Fri 09:00:00'"<br> To specify the day of the week, it must be in one of the following supported string format: <br>Mon: Monday<br>Tue: Tuesday<br>Wed: Wednesday<br>Thu: Thursday<br>Fri: Friday<br>Sat: Saturday<br>Sun: Sunday</td></tr>
387 <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
388 communication input command.</td></tr>
389 <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.
390 </td></tr></table> @n
393 * @param[in] pArguments A list of string arguments that has a maximum size of @c 1024 bytes @n
394 * The parameter can also contain @c null. @n
395 * 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>.
396 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
397 * @exception E_SUCCESS The method is successful.
398 * @exception E_INVALID_ARG The launch condition is empty or too long (Maximum 400 bytes).
399 * @exception E_INVALID_FORMAT The specified condition format is invalid.
400 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
401 * @exception E_OBJ_ALREADY_EXIST The specified @c condition is already registered by a different application.
402 * @exception E_OUT_OF_MEMORY The memory is insufficient.
403 * @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
404 * @exception E_SYSTEM A system error has occurred.
405 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
406 * @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
408 * @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
409 * @remarks The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
410 * @remarks Registering the same launch condition overwrites the previous launch argument without throwing an exception.
411 * @remarks The launch period requires more consideration because an inappropriate short period value may lead
412 * to an adverse effect on the device battery.
413 * @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
414 * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
415 * @see UnregisterAppLaunch()
416 * @see IsAppLaunchRegistered()
417 * @see LaunchApplication(const AppId&, LaunchOption);
418 * @see Tizen::Base::DateTime::ToString()
419 * @see Tizen::Io::SerialPort
421 * The following example demonstrates how to use the %RegisterAppLaunch() method.
426 * SystemTime::GetCurrentTime(TIME_MODE_WALL, time);
427 * time.AddMinutes(1);
430 * cond.Format(70, L"DueTime='%S' LaunchPeriod='60'", time.ToString().GetPointer());
432 * // Registers a periodic condition that fires every 60 minutes starting after one minute
433 * AppManager::GetInstance()->RegisterAppLaunch(cond, null, AppManager::LAUNCH_OPTION_DEFAULT)
437 result RegisterAppLaunch(const Tizen::Base::String& condition, const Tizen::Base::Collection::IList* pArguments, LaunchOption option);
440 * Unregisters the previously registered launch condition.
444 * @privilege %http://tizen.org/privilege/application.launch
446 * @return An error code
447 * @exception E_SUCCESS Either of the following conditions has occurred:
448 * - The method is successful.
449 * - There is no registered launch condition.
450 * @exception E_SYSTEM A system error has occurred.
451 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
452 * @see RegisterAppLaunch()
453 * @see IsAppLaunchRegistered()
455 result UnregisterAppLaunch(void);
458 * Unregisters the specified launch condition.
462 * @privilege %http://tizen.org/privilege/application.launch
464 * @return An error code
465 * @param[in] condition The launch condition for the application
466 * @exception E_SUCCESS The method is successful.
467 * @exception E_OBJ_NOT_FOUND The specified launch condition is not found.
468 * @exception E_SYSTEM A system error has occurred.
469 * @exception E_OUT_OF_MEMORY The memory is insufficient.
470 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
471 * @see RegisterAppLaunch()
472 * @see IsAppLaunchRegistered()
474 result UnregisterAppLaunch(const Tizen::Base::String& condition);
477 * Checks whether a launch condition is registered for the application.
481 * @return @c true if a condition is already registered to the application invoking this method, @n
483 * @exception E_SUCCESS The method is successful.
484 * @exception E_SYSTEM A system error has occurred.
486 * @remarks The specific error code can be accessed using the GetLastResult() method.
487 * @see RegisterAppLaunch()
488 * @see UnregisterAppLaunch()
490 bool IsAppLaunchRegistered(void) const;
493 * Registers the specified application with a specific condition and launches it if the condition is met. @n
494 * If the requested application is already running, the application is notified through IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
495 * The launch arguments are given as input parameters to %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
499 * @privilege %http://tizen.org/privilege/appmanager.launch
500 * @feature %http://tizen.org/feature/network.nfc for L"NFC='command'" or %http://tizen.org/feature/usb.accessory for L"Serial='command'" in the value of @c condition
502 * @return An error code
503 * @param[in] appId The ID of the application registered for launch
504 * @param[in] condition The launch condition for the application @n
505 * 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
506 * 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>.
507 * <table><tr><th>Condition Format</th><th>Meaning</th></tr>
508 <tr><td>L"DateTime='mm/dd/yyyy hh:mm:ss'"</td>
509 <td>The specified condition is the local due time.</td></tr>
510 <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
511 <td>The specific condition is the time period after due time.</td></tr>
512 <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
513 communication input command.</td></tr>
514 <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.
515 </td></tr></table> @n
518 * @param[in] pArguments A list of string arguments that has a maximum size of @c 1024 bytes @n
519 * The parameter can also contain @c null. @n
520 * 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>.
521 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
522 * @exception E_SUCCESS The method is successful.
523 * @exception E_APP_NOT_INSTALLED The application is not installed.
524 * @exception E_INVALID_ARG The launch condition is empty or too long (Maximum 400 bytes).
525 * @exception E_INVALID_FORMAT The specified condition format is invalid.
526 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
527 * @exception E_OUT_OF_MEMORY The memory is insufficient.
528 * @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
529 * @exception E_SYSTEM A system error has occurred.
530 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
531 * @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
533 * @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
534 * @remarks The newly introduced launch condition does not work on the previous SDK version and the @c E_INVALID_CONDITION exception is returned.
535 * @remarks Registering the same launch condition overwrites the previous launch argument without throwing an exception.
536 * @remarks The launch period requires more consideration because an inappropriate short period value may lead
537 * to an adverse effect on the device battery.
538 * @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
539 * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
540 * @see UnregisterAppLaunch()
541 * @see IsAppLaunchRegistered()
542 * @see LaunchApplication(const AppId&, LaunchOption);
543 * @see IAppLaunchConditionEventListener::OnAppLaunchConditionMetN()
544 * @see Tizen::Base::DateTime::ToString()
545 * @see Tizen::Io::SerialPort
547 result RegisterAppLaunch(const AppId& appId, const Tizen::Base::String& condition, const Tizen::Base::Collection::IList* pArguments, LaunchOption option);
550 * Unregisters the launch condition.
554 * @privilege %http://tizen.org/privilege/appmanager.launch
556 * @return An error code
557 * @param[in] appId The application ID
558 * @param[in] pCondition The launch condition to unregister @n
559 * If the parameter contains @c null, all the conditions are unregistered.
560 * @exception E_SUCCESS The method is successful.
561 * @exception E_APP_NOT_INSTALLED The application is not installed.
562 * @exception E_OBJ_NOT_FOUND The specified launch condition is not found.
563 * @exception E_SYSTEM A system error has occurred.
564 * @exception E_OUT_OF_MEMORY The memory is insufficient.
565 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
567 * @see RegisterAppLaunch()
568 * @see IsAppLaunchRegistered()
570 result UnregisterAppLaunch(const AppId& appId, const Tizen::Base::String* pCondition);
573 * Checks whether a previously registered launch condition is present for the specified application.
577 * @privilege %http://tizen.org/privilege/appmanager.launch
579 * @return @c true if a condition is already registered to the specified application with the specified condition, @n
581 * @param[in] appId The application ID
582 * @param[in] pCondition The launch condition to register for the specified @c appId @n
583 * If the parameter contains @c null, the method checks for any registered launch condition for the specified @c appId.
584 * @exception E_SUCCESS The method is successful.
585 * @exception E_APP_NOT_INSTALLED The application is not installed.
586 * @exception E_SYSTEM A system error has occurred.
587 * @exception E_OUT_OF_MEMORY The memory is insufficient.
588 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
590 * @remarks The specific error code can be accessed using the GetLastResult() method.
591 * @see RegisterAppLaunch()
592 * @see UnregisterAppLaunch()
594 bool IsAppLaunchRegistered(const AppId& appId, const Tizen::Base::String* pCondition = null) const;
597 * Sets a checkpoint event listener. @n
598 * The listener gets notified when a checkpoint event is fired.
602 * @return An error code
603 * @param[in] listener The listener to receive the checkpoint event
604 * @exception E_SUCCESS The method is successful.
605 * @exception E_OBJ_ALREADY_EXIST The listener is already set.
606 * @exception E_SYSTEM A system error has occurred.
609 result SetCheckpointEventListener(IAppCheckpointEventListener& listener);
613 * Sends the result list for the application control request. @n
614 * The client can get the result list by implementing IAppControlEventListener::OnAppControlCompleted().
616 * @brief <i> [Deprecated] </i>
617 * @deprecated This method is deprecated because a new method has been added. @n
618 * Instead of using this method, use AppControlProviderManager::SendAppControlResult().
621 * @return An error code
622 * @param[in] appControlRequestId The application control request ID @n
623 * The application control request ID is given as an argument for
624 * App::GetAppArgumentListN() or App::OnUserEventReceivedN().
625 * @param[in] pResultList The list of the result strings of the application control
626 * @exception E_SUCCESS The method is successful.
627 * @exception E_OBJ_NOT_FOUND The application control request is not found.
628 * @exception E_OUT_OF_MEMORY The memory is insufficient.
629 * @exception E_SYSTEM A system error has occurred.
630 * @see IAppControlEventListener
633 static result SendAppControlResult(const Tizen::Base::String& appControlRequestId, const Tizen::Base::Collection::IList* pResultList);
636 * Sets an IAppLaunchConditionEventListener to the %AppManager. @n
637 * The listener gets notified when the application is launched by the registered condition.
641 * @param[in] pListener The event listener @n
642 * To unset the listener, pass a @c null value to the listener parameter.
643 * @remarks If the application is newly launched by the condition, then %SetAppLaunchConditionEventListener() must
644 * be set within App::OnAppInitializing().
645 * If the application does not set the listener using %SetAppLaunchConditionEventListener(),
646 * then the application is launched without invoking any listener for the condition.
647 * @see RegisterAppLaunch()
649 void SetAppLaunchConditionEventListener(IAppLaunchConditionEventListener* pListener);
652 * Adds an IActiveAppEventListener to the %AppManager. @n
653 * The listener gets notified when the active application is changed.
658 * @privilege %http://tizen.org/privilege/appusage
660 * @return An error code
661 * @param[in] listener The event listener
662 * @exception E_SUCCESS The method is successful.
663 * @exception E_OUT_OF_MEMORY The memory is insufficient.
664 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
665 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
666 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
667 * @remarks Active application is the top most window with focus.
668 * @see GetActiveApp()
669 * @see RemoveActiveAppEventListener()
671 result AddActiveAppEventListener(IActiveAppEventListener& listener);
674 * Removes an IActiveAppEventListener from the %AppManager.
679 * @privilege %http://tizen.org/privilege/appusage
681 * @return An error code
682 * @param[in] listener The event listener
683 * @exception E_SUCCESS The method is successful.
684 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
685 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
686 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
687 * @see GetActiveApp()
688 * @see AddActiveAppEventListener()
690 result RemoveActiveAppEventListener(IActiveAppEventListener& listener);
693 * Gets the current active application AppId.
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()
709 result GetActiveApp(AppId& appId);
712 * Checks whether the specified application is declared as preferred application for any AppControl resolution
715 * @privlevel platform
716 * @privilege %http://tizen.org/privilege/appmanager.setting
718 * @return @c true if the application is running, @n
720 * @param[in] appId Application ID
721 * @exception E_SUCCESS The method is successful.
722 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
723 * @exception E_APP_NOT_INSTALLED The specified application is not installed.
724 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
725 * @remarks The specific error code can be accessed using the GetLastResult() method.
726 * @remarks For more information on AppControl resolution, see <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">Application Controls</a>.
728 bool IsUserPreferredAppForAppControlResolution(const AppId& appId) const;
731 * Clear user preference for all AppControl resolutions on the specified application.
734 * @privlevel platform
735 * @privilege %http://tizen.org/privilege/appmanager.setting
737 * @return An error code
738 * @param[in] appId The preferred application's ID
739 * @exception E_SUCCESS The method is successful.
740 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
741 * @exception E_APP_NOT_INSTALLED The specified application is not installed.
742 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
743 * @remarks For more information on AppControl resolution, see <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">Application Controls</a>.
745 result ClearUserPreferenceForAppControlResolution(const AppId& appId);
749 * This default constructor is intentionally declared as private to implement the %Singleton semantic.
756 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
760 AppManager(const AppManager& rhs);
763 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
767 AppManager& operator =(const AppManager& rhs);
770 * Constructs the instance of this class.
774 * @return An error code
775 * @exception E_SUCCESS The method is successful.
776 * @exception E_OUT_OF_MEMORY The memory is insufficient.
777 * @exception E_SYSTEM A system error has occurred.
779 result Construct(void);
782 * This destructor is intentionally declared as private to implement the %Singleton semantic.
786 virtual ~AppManager(void);
789 class _AppManagerImpl* __pAppManagerImpl;
791 friend class _AppManagerImpl;
796 #endif // _FAPP_APP_MANAGER_H_