#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.
* @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
*
* @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:
//
}
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;