// limitations under the License.
//
+#include <unique_ptr.h>
#include <FApp.h>
#include <FMedia.h>
-#include <FShellAppWidgetProviderInfo.h>
-#include <FShellAppWidgetManager.h>
-#include <FShellAppWidgetSizeInfo.h>
+#include <FShell.h>
#include "AppWidgetViewerMainForm.h"
#include "AppWidgetViewerFormFactory.h"
const int LIST_ITEM_MARGIN_TOP = 32;
const int LIST_ITEM_TEXT_HEIGHT = 50;
+const wchar_t OPERATION_APPWIDGET_CONFIG[] = L"http://tizen.org/appcontrol/operation/appwidget/configuration";
+const wchar_t EXTRA_KEY_USER_INFO[] = L"http://tizen.org/appcontrol/data/user_info";
+const wchar_t EXTRA_KEY_PROVIDER_NAME[] = L"http://tizen.org/appcontrol/data/provider_name";
+
+
+
+
AppWidgetViewerMainForm::AppWidgetViewerMainForm(void)
: __pList(null)
, __pAppWidgetProviderList(null)
String configurationAppControlAppId = __pSelectedProviderInfo->GetConfigurationAppControlAppId();
if(!configurationAppControlAppId.IsEmpty())
{
- StartConfigurationAppControl(__pSelectedProviderInfo->GetConfigurationAppControlAppId(), __pSelectedProviderInfo->GetName());
+ StartConfigurationAppControl(configurationAppControlAppId, __pSelectedProviderInfo->GetName());
}
else
{
void
AppWidgetViewerMainForm::StartConfigurationAppControl(const Tizen::Base::String& appId, const Tizen::Base::String& providerName)
{
- AppControl* pAc = AppManager::FindAppControlN( appId, L"http://tizen.org/appcontrol/operation/livebox/configuration");
- HashMap extra;
- extra.Construct();
- String key = L"ProviderName";
- String value = providerName;
- extra.Add(&key, &value);
-
- pAc->Start(null, null, &extra, this);
- delete pAc;
+ std::unique_ptr<AppControl> pAc( AppManager::FindAppControlN(appId, OPERATION_APPWIDGET_CONFIG) );
+ if (pAc)
+ {
+ HashMap extra;
+ extra.Construct();
+ String key = EXTRA_KEY_PROVIDER_NAME;
+ String value = providerName;
+ extra.Add(&key, &value);
+
+ pAc->Start(null, null, &extra, this);
+ }
+ else
+ {
+ Tizen::Shell::NotificationManager notiMgr;
+ notiMgr.Construct();
+ notiMgr.NotifyTextMessage(L"Failed to open setting screen for the selected Dynamic Box.");
+ }
}
void
if(pExtraData)
{
- String userInfokey(L"http://tizen.org/appcontrol/data/userinfo");
- const String* pUserInfoValue = dynamic_cast<const String*>(pExtraData->GetValue(userInfokey) );
- AppLog("%ls, %ls, %ls", appId.GetPointer(), operationId.GetPointer(), pUserInfoValue->GetPointer() );
+ String key = EXTRA_KEY_USER_INFO;
+ const String* pUserInfoValue = dynamic_cast<const String*>(pExtraData->GetValue(key) );
+ AppLog("appId:%ls, operationId:%ls, user info:%ls", appId.GetPointer(), operationId.GetPointer(), pUserInfoValue->GetPointer() );
GoAppWidgetViewScene(__pSelectedProviderInfo->GetAppId(), __pSelectedProviderInfo->GetName(), __pSelectedProviderInfo->GetDisplayName(), *pUserInfoValue);
}