motify AddShortcut doxygen comment and behavior
authorjungmin76.park <jungmin76.park@samsung.com>
Fri, 22 Feb 2013 10:55:59 +0000 (19:55 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Fri, 22 Feb 2013 10:55:59 +0000 (19:55 +0900)
Change-Id: I155805e6cb5598b59e48541212e10814949a07d2
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
inc/FShellHomeManager.h [changed mode: 0644->0755]
src/core/FShellHomeManager.cpp

old mode 100644 (file)
new mode 100755 (executable)
index 8f054f5..2be35c9
 #ifndef _FSHELL_HOME_MANAGER_H_
 #define _FSHELL_HOME_MANAGER_H_
 
+#include <FBaseObject.h>
 #include <FBaseString.h>
 #include <FAppTypes.h>
 
 namespace Tizen { namespace Shell
 {
 
-
 /*
  * @class              HomeManager
  * @brief              Manages information of home screen.
@@ -55,10 +55,12 @@ public:
         * @return      A pointer to the %HomeManager instance, @n
         *                      else @c null if it fails
         */
-       static HomeManager* GetInstance();
+       static HomeManager* GetInstance(void);
 
        /*
-        * Gets a list of installed LiveboxProviderInfo
+        * Request the Home screen to add the spefied shortcut.
+        *
+        * @privilege   http::tizen.org/privilege/homemanager
         *
         * @since       2.1
         *
@@ -66,11 +68,18 @@ public:
         * @param[in]   appId   The application ID
         * @param[in]   displayName     The display name of shortcut
         * @param[in]   iconFilePath    The icon file path
-        * @param]in]   userInfo        User information for the shortcut
+        * @param]in]   uriData                         Uri that will be delivered by IAppControlProviderEventListener::OnAppControlRequestReceived(), when the application start via shortcut.
+        *
         * @exception   E_SUCCESS                       The method is successful.
+        * @exception   E_APP_NOT_INSTALLED     The application is not installed.
+        * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
         * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
+        *
+        * @remark              If uriData is specified, application will be started by AppControl with http://tizen.org/appcontrol/operation/view operation, when it's launched from the Home screen via shortcut.
+        *                              Or else application will be started by AppControl with default operation(http://tizen.org/appcontrol/operation/main).
+        * @see                 IAppControlEventListener::OnAppControlRequestReceived()
         */
-       result AddShortcut(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName, const Tizen::Base::String& iconFilePath, const Tizen::Base::String& userInfo);
+       result AddShortcut(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName, const Tizen::Base::String& iconFilePath, const Tizen::Base::String& uriData);
 
 private:
        //
index 126cb57..da752d9 100644 (file)
@@ -73,14 +73,15 @@ HomeManager::Construct()
 }
 
 result
-HomeManager::AddShortcut(const AppId& appId, const String& displayName, const String& iconFilePath, const String& userInfo)
+HomeManager::AddShortcut(const AppId& appId, const String& displayName, const String& iconFilePath, const String& uriData)
 {
        std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
        std::unique_ptr<char[]> pIcon(_StringConverter::CopyToCharArrayN(iconFilePath));
        std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(displayName));
-       std::unique_ptr<char[]> pUser(_StringConverter::CopyToCharArrayN(userInfo));
+       std::unique_ptr<char[]> pUriData(_StringConverter::CopyToCharArrayN(uriData));
 
-       int ret = add_to_home_shortcut(pAppId.get(), pName.get(), LAUNCH_BY_URI, pUser.get(), pIcon.get(), NULL, this);
+       int type = (uriData.IsEmpty())? LAUNCH_BY_PACKAGE : LAUNCH_BY_URI;
+       int ret = add_to_home_shortcut(pAppId.get(), pName.get(), type, pUriData.get(), pIcon.get(), NULL, this);
        SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "Failed to add_to_home_shortcut");
 
        return E_SUCCESS;