Update for log and documentation
[platform/framework/native/appfw.git] / inc / FAppAppManager.h
index fd1efca..6e3dd36 100755 (executable)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -61,7 +60,7 @@ class MapDataControl;
  * The application manager supports normal and conditional application launch, and application control search and launch.
  * It looks up the specific application control from the application control registry and creates an application control instance.
  * @n
- * 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>.
+ * 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>.
  */
 class _OSP_EXPORT_ AppManager
        : public Tizen::Base::Object
@@ -96,18 +95,15 @@ public:
         * @remarks     The specific error code can be accessed using the GetLastResult() method.
         * @remarks     %Tizen platform defines platform-defined alias for application ID and this aliased application ID
         *                      can be used to find the AppControl. For more information, see
-        *                      <a href="../org.tizen.native.appprogramming/html/guide/app/app_control.htm">here</a>.
+        *                      <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">here</a>.
         *
         * The following example demonstrates how to use the %FindAppControlN() method to find the application control.
         *
         * @code
-        * ArrayList dataList(SingleObjectDeleter);
-        * dataList.Construct();
-        * dataList.Add(new String(L"tel:1234567900"));
-        * dataList.Add(new String(L"type:voice"));
+        * String telUri = L"tel:12345678900";
         *
-        * AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone", L"http://tizen.org/appcontrol/operation/call");
-        * pAc->Start(&dataList, null);
+        * AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone", L"http://tizen.org/appcontrol/operation/dial");
+        * pAc->Start(&telUri, null, null, null);
         * @endcode
         */
        static AppControl* FindAppControlN(const AppId& appId, const Tizen::Base::String& operationId);
@@ -134,12 +130,11 @@ public:
         * @exception   E_SYSTEM                A system error has occurred. @n
         *                                                              Either the file operation or the DB operation has failed.
         * @remarks     The specific error code can be accessed using the GetLastResult() method.
-        * @remarks     For the delivered launch arguments, see App::GetAppArgumentListN().
         */
        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);
 
        /**
-         * @if OSPDEPREC
+     * @if OSPDEPREC
         * Starts the application control if there is only one application control that matches the specified URI, operation ID, and data type. @n
         * If there are more than one application controls, the one that the user selects is started.
         *
@@ -148,7 +143,7 @@ public:
         *                              Instead of using this method, use AppControl::FindAndStart().
         * @since               2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
         *
         * @return      An error code
         * @param[in]   uriData                 The URI that has a maximum size of @c 1024 bytes
@@ -175,7 +170,7 @@ public:
         * String operationId = L"http://tizen.org/appcontrol/operation/call";
         * StartAppControl(L"tel:1234567890", &operationId, null, null);
         * @endcode
-         * @endif
+     * @endif
         */
        static result StartAppControl(const Tizen::Base::String& uriData, const Tizen::Base::String* pOperationId, const Tizen::Base::String* pDataType, IAppControlListener* pListener);
 
@@ -189,7 +184,7 @@ public:
         *                              Instead of using this method, use AppControl::FindAndStart().
         * @since               2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
         *
         * @return      An error code
         * @param[in]   pOperationId    The operation ID
@@ -227,7 +222,7 @@ public:
         * @param[in]   providerId                      The provider ID
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OBJ_NOT_FOUND         The data control specified with the @c providerId is not found.
-        * @exception   E_ILLEGAL_ACCESS        The access is denied due to insufficient permission.
+        * @exception   E_ILLEGAL_ACCESS        Access is denied due to insufficient permission.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
         * @exception   E_SYSTEM                        A system error has occurred.
         * @remarks             The specific error code can be accessed using the GetLastResult() method.
@@ -245,7 +240,7 @@ public:
         * @param[in]   providerId                      The provider ID
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_OBJ_NOT_FOUND         The data control specified with the @c providerId is not found.
-        * @exception   E_ILLEGAL_ACCESS        The access is denied due to insufficient permission.
+        * @exception   E_ILLEGAL_ACCESS        Access is denied due to insufficient permission.
         * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
         * @exception   E_SYSTEM                        A system error has occurred.
         * @remarks             The specific error code can be accessed using the GetLastResult() method.
@@ -263,7 +258,9 @@ public:
        * @exception    E_SUCCESS                       The method is successful.
        * @exception    E_APP_NOT_INSTALLED     The expected shared directory cannot be found
        *                                                                       because the application specified with @c appId cannot be installed.
-       * @remarks              The specific error code can be accessed using the GetLastResult() method.
+       * @remarks              
+       *                               - The returned path can be invalid when the application with specified with @c appId is uninstalled.
+       *                               - The specific error code can be accessed using the GetLastResult() method.
        */
        static Tizen::Base::String GetAppSharedPath(const AppId& appId);
 
@@ -279,7 +276,7 @@ public:
 
        /**
         * @if OSPDEPREC
-        * Launches the default application with given @c appId. @n
+        * Launches the default application with the given @c appId. @n
         * The launch arguments are given as App::OnUserEventReceivedN() or can be obtained by
         * invoking App::GetAppArgumentListN(), especially within App::OnAppInitializing().
         *
@@ -288,7 +285,7 @@ public:
         *                              Instead of using this method, use %LaunchApplication() without launch arguments or AppControl::Start().
         * @since       2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
         *
         * @return      An error code
         * @param[in]   appId                           The application's ID to execute
@@ -307,11 +304,11 @@ public:
        result LaunchApplication(const AppId& appId, const Tizen::Base::Collection::IList* pArguments, LaunchOption option = LAUNCH_OPTION_DEFAULT);
 
        /**
-        * Launches the default application with given @c appId.
+        * Launches the default application with the given @c appId.
         *
         * @since       2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
         *
         * @return      An error code
         * @param[in]   appId                           The application's ID to execute
@@ -329,13 +326,14 @@ public:
         *
         * @since       2.0
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/application.kill
+        * @privilege   %http://tizen.org/privilege/appmanager.kill @n
+        *                              (%http://tizen.org/privilege/application.kill is deprecated.)
         *
         * @return      An error code
         * @param[in]   appId                           The application's ID to execute
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_SYSTEM                        A system error has occurred.
-        * @exception   E_OBJ_NOT_FOUND         The application is not installed or not running.
+        * @exception   E_OBJ_NOT_FOUND         The application is either not installed or is not running.
         * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
         */
        result TerminateApplication(const AppId& appId);
@@ -372,7 +370,8 @@ public:
         *
         * @since       2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
+        * @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
         *
         * @return              An error code
         * @param[in]   condition         The launch condition for the application @n
@@ -384,7 +383,7 @@ public:
                                      <tr><td>L"DueTime='mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'"</td>
                                      <td>The specific condition is the time period after due time.</td></tr>
                                      <tr><td>L"WeeklyTime='EEE HH:mm:ss'"</td>
-                                     <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>
+                                     <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>
                                      <tr><td>L"Serial='command'"</td><td>The specified condition is a serial
                                      communication input command.</td></tr>
                                      <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.
@@ -404,16 +403,18 @@ public:
         * @exception   E_MAX_EXCEEDED          The size of @c pArguments has exceeded the maximum limit.
         * @exception   E_SYSTEM                                A system error has occurred.
         * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+        * @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
         *
         * @remarks             When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
         * @remarks             The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
         * @remarks             Registering the same launch condition overwrites the previous launch argument without throwing an exception.
         * @remarks             The launch period requires more consideration because an inappropriate short period value may lead
         *                              to an adverse effect on the device battery.
-        * @remarks             For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+        * @remarks             For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+        * @remarks             Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
         * @see                 UnregisterAppLaunch()
         * @see                 IsAppLaunchRegistered()
-        * @see                 LaunchApplication()
+        * @see                 LaunchApplication(const AppId&, LaunchOption);
         * @see                 Tizen::Base::DateTime::ToString()
         * @see                 Tizen::Io::SerialPort
         *
@@ -440,13 +441,14 @@ public:
         *
         * @since       2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
         *
         * @return              An error code
-        * @exception   E_SUCCESS                       The method is successful.
+        * @exception   E_SUCCESS                       Either of the following conditions has occurred:
+        *                                                                      - The method is successful.
+        *                                                                      - There is no registered launch condition.
         * @exception   E_SYSTEM                        A system error has occurred.
         * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
-        * @remarks             E_SUCCESS                       An error occurs when there is no registered launch condition.
         * @see                 RegisterAppLaunch()
         * @see                 IsAppLaunchRegistered()
         */
@@ -457,7 +459,7 @@ public:
         *
         * @since               2.0
         * @privlevel   public
-        * @privilege   http://tizen.org/privilege/application.launch
+        * @privilege   %http://tizen.org/privilege/application.launch
         *
         * @return              An error code
         * @param[in]   condition                       The launch condition for the application
@@ -494,7 +496,8 @@ public:
         *
         * @since               2.0
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/appmanager.launch
+        * @privilege   %http://tizen.org/privilege/appmanager.launch
+        * @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
         *
         * @return     An error code
         * @param[in]  appId          The ID of the application registered for launch
@@ -525,16 +528,18 @@ public:
         * @exception  E_MAX_EXCEEDED           The size of @c pArguments has exceeded the maximum limit.
         * @exception  E_SYSTEM                         A system error has occurred.
         * @exception  E_PRIVILEGE_DENIED       The application does not have the privilege to call this method.
+        * @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
         *
         * @remarks    When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
-        * @remarks    The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
+        * @remarks    The newly introduced launch condition does not work on the previous SDK version and the @c E_INVALID_CONDITION exception is returned.
         * @remarks    Registering the same launch condition overwrites the previous launch argument without throwing an exception.
         * @remarks    The launch period requires more consideration because an inappropriate short period value may lead
         *             to an adverse effect on the device battery.
-        * @remarks    For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+        * @remarks    For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+        * @remarks     Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
         * @see        UnregisterAppLaunch()
         * @see        IsAppLaunchRegistered()
-        * @see        LaunchApplication()
+        * @see        LaunchApplication(const AppId&, LaunchOption);
         * @see        IAppLaunchConditionEventListener::OnAppLaunchConditionMetN()
         * @see        Tizen::Base::DateTime::ToString()
         * @see        Tizen::Io::SerialPort
@@ -546,7 +551,7 @@ public:
         *
         * @since               2.0
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/appmanager.launch
+        * @privilege   %http://tizen.org/privilege/appmanager.launch
         *
         * @return     An error code
         * @param[in]  appId          The application ID
@@ -569,7 +574,7 @@ public:
         *
         * @since               2.0
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/appmanager.launch
+        * @privilege   %http://tizen.org/privilege/appmanager.launch
         *
         * @return     @c true if a condition is already registered to the specified application with the specified condition, @n
         *             else @c false
@@ -651,7 +656,7 @@ public:
         * @since       2.0
         *
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/appusage
+        * @privilege   %http://tizen.org/privilege/appusage
         *
         * @return              An error code
         * @param[in]   listener                                The event listener
@@ -673,7 +678,7 @@ public:
         * @since       2.0
         *
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/appusage
+        * @privilege   %http://tizen.org/privilege/appusage
         *
         * @return              An error code
         * @param[in]   listener                                The event listener
@@ -693,7 +698,7 @@ public:
         * @since       2.0
         *
         * @privlevel   partner
-        * @privilege   http://tizen.org/privilege/appusage
+        * @privilege   %http://tizen.org/privilege/appusage
         *
         * @return              An error code
         * @param[out]  appId                                   The AppId of the active application
@@ -706,6 +711,42 @@ public:
         */
        result GetActiveApp(AppId& appId);
 
+       /**
+        * Checks whether the specified application is declared as preferred application for any AppControl resolution
+        *
+        * @since         2.2
+        * @privlevel      platform
+        * @privilege     %http://tizen.org/privilege/appmanager.setting
+        *
+        * @return        @c true if the application is running, @n
+        *           else @c false
+        * @param[in]    appId                         Application ID
+        * @exception    E_SUCCESS                   The method is successful.
+        * @exception    E_SYSTEM                    The method cannot proceed due to a severe system error.
+        * @exception    E_APP_NOT_INSTALLED    The specified application is not installed.
+        * @exception    E_PRIVILEGE_DENIED       The application does not have the privilege to call this method.
+        * @remarks      The specific error code can be accessed using the GetLastResult() method.
+        * @remarks      For more information on AppControl resolution, see <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">Application Controls</a>.
+        */
+       bool IsUserPreferredAppForAppControlResolution(const AppId& appId) const;           
+
+       /**
+        * Clear user preference for all AppControl resolutions on the specified application.
+        *
+        * @since         2.2
+        * @privlevel      platform
+        * @privilege     %http://tizen.org/privilege/appmanager.setting
+        *
+        * @return        An error code
+        * @param[in]    appId                         The preferred application's ID
+        * @exception    E_SUCCESS                   The method is successful. 
+        * @exception    E_SYSTEM                    The method cannot proceed due to a severe system error.
+        * @exception    E_APP_NOT_INSTALLED    The specified application is not installed.
+        * @exception    E_PRIVILEGE_DENIED       The application does not have the privilege to call this method.
+        * @remarks      For more information on AppControl resolution, see <a href="../org.tizen.native.appprogramming/html/guide/app/app_controls.htm">Application Controls</a>.
+        */
+       result ClearUserPreferenceForAppControlResolution(const AppId& appId);
+
 private:
        /**
         * This default constructor is intentionally declared as private to implement the %Singleton semantic.