result r = _AccessController::CheckUserPrivilege(_PRV_SHORTCUT_INSTALL);
SysTryReturnResult(NID_SHELL, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
- if( allowDuplication )
- {
- SysLog(NID_SHELL, "This feature(allowDuplication) is not yet implemented!");
- }
-
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[]> pUriData(_StringConverter::CopyToCharArrayN(uriData));
-
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);
+
int ret = add_to_home_shortcut(pAppId.get(), pName.get(), type, pUriData.get(), pIcon.get(), allowDuplication, NULL, this);
SysTryReturnResult(NID_SHELL, ret == 0, E_SYSTEM, "Failed to add_to_home_shortcut");
}
result
+ShortcutManager::RemoveShortcut(const Tizen::App::AppId& appId, const Tizen::Base::String& displayName)
+{
+ result r = _AccessController::CheckUserPrivilege(_PRV_SHORTCUT_INSTALL);
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+ std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
+ std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(displayName));
+
+ int ret = add_to_home_remove_shortcut(pAppId.get(), pName.get(), "", null, this);
+ SysTryReturnResult(NID_SHELL, ret == 0, E_SYSTEM, "Failed to add_to_home_remove_shortcut");
+
+ return E_SUCCESS;
+}
+
+result
ShortcutManager::AddShortcutRequestListener(IShortcutRequestListener& listener)
{
return __pShortcutManagerImpl->AddShortcutRequestListener(listener);
pListenerList->GetAt(i, pListener);
if( pListener != null)
{
- pListener->OnShortcutAddRequested(appId, text, icon, content_info);
+ if( type == SHORTCUT_REMOVE)
+ {
+ pListener->OnShortcutRemoveRequested(appId, text);
+ }
+ else
+ {
+ pListener->OnShortcutAddRequested(appId, text, icon, content_info);
+ }
}
}
if( type == SHORTCUT_PACKAGE
|| type == SHORTCUT_DATA
- || type == SHORTCUT_DATA)
+ || type == SHORTCUT_REMOVE)
{
ShortcutRequestEventHandlerCB(appId, text, type, content_info, icon, pid, period, allowDuplication, data);
}