--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file StDownloadedApplicationForm.h
+ * @brief This is the header file for DownloadedApplicationForm class.
+ */
+
+#ifndef _ST_DOWNLOADED_APPLICATION_FORM_H_
+#define _ST_DOWNLOADED_APPLICATION_FORM_H_
+
+#include "StBaseForm.h"
+
+class DownloadedApplicationForm
+ : public BaseForm
+{
+public:
+ DownloadedApplicationForm(void);
+ virtual ~DownloadedApplicationForm(void);
+
+ void CreateFooter(void);
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+
+ virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
+ virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
+ virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+ virtual Tizen::Ui::Controls::TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth);
+ virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth);
+ virtual int GetDefaultGroupItemHeight(void);
+ virtual int GetDefaultItemHeight(void);
+ virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
+ virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
+ virtual int GetGroupCount(void);
+ virtual int GetItemCount(int groupIndex);
+ virtual void UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
+ virtual void UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
+
+ virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
+ virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+ virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+
+private:
+ result SetDownLoadAppIdKeyList(void);
+ result SetAppIdListFromPackageManager(void);
+ void RemoveAllDownLoadAppIdKeyList(void);
+ void RemoveAllAppIdList(void);
+ Tizen::Base::String GetAppSettingFilePathFromAppIdListAt(Tizen::Base::String key);
+ Tizen::Base::String GetDownLoadAppNameAt(unsigned int index);
+ Tizen::Base::String GetDownLoadAppIdKeyAt(unsigned int index);
+ unsigned int GetDownLoadAppCount(void);
+ Tizen::Base::String GetAppSettingIconPathFromAppIdListAt(Tizen::Base::String& id);
+ void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+ void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
+
+private:
+ Tizen::Base::Collection::IList* __pDownloadAppIdKeyList;
+ Tizen::Base::Collection::HashMap* __pAppIdHashMap;
+ Tizen::Base::Collection::HashMap* __pAppIconPathHashMap;
+};
+
+#endif // _ST_DOWNLOADED_APPLICATION_FORM_H_
\ No newline at end of file
virtual void OnResultReceivedForSetValueAsync(const Tizen::Base::String& key, result r);
virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
- virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
-
private:
- result SetDownLoadAppIdKeyList(void);
- result SetAppIdListFromPackageManager(void);
- void RemoveAllDownLoadAppIdKeyList(void);
- void RemoveAllAppIdList(void);
- Tizen::Base::String GetAppSettingFilePathFromAppIdListAt(Tizen::Base::String key);
- Tizen::Base::String GetDownLoadAppNameAt(unsigned int index);
- Tizen::Base::String GetDownLoadAppIdKeyAt(unsigned int index);
- unsigned int GetDownLoadAppCount(void);
void FindAppControlScene(int itemIndex);
-// void SetIFlightModeSetValueAsyncResultListener(void);
- Tizen::Base::String GetAppSettingIconPathFromAppIdListAt(Tizen::Base::String& id);
const wchar_t* GroupConnectivitySceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
const wchar_t* GroupPersonalSceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
const wchar_t* GroupDeviceSceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
const wchar_t* GroupSystemSceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
+ bool IsEmulator(void);
private:
int __currentTableViewList;
- Tizen::Base::Collection::IList* __pDownloadAppIdKeyList;
- Tizen::Base::Collection::HashMap* __pAppIdHashMap;
- Tizen::Base::Collection::HashMap* __pAppIconPathHashMap;
-// Tizen::System::ISettingInfoSetValueAsyncResultListener* __pFlightModeSetValueAsyncResultListener;
+ bool __isEmulator;
};
#endif // _ST_MAIN_MENU_FORM_H_
\ No newline at end of file
extern const wchar_t* IDSCN_WIFI_DIRECT_CONNECTION;
extern const wchar_t* IDSCN_TIME_ZONE;
extern const wchar_t* IDSCN_XML_PARSER;
+extern const wchar_t* IDSCN_HOME_AND_LOCK_SCREEN;
+extern const wchar_t* IDSCN_DOWNLOADED_APPLICATION;
+
extern const wchar_t* IDSCN_NULL;
//Main Menu Form
extern const wchar_t* IDC_FORM_WIFI_DIRECT_CONNECTION;
extern const wchar_t* IDC_FORM_TIME_ZONE;
extern const wchar_t* IDC_FORM_XML_PARSER;
+extern const wchar_t* IDC_FORM_HOME_AND_LOCK_SCREEN;
+extern const wchar_t* IDC_FORM_DOWNLOADED_APPLICATION;
#endif // _ST_SETTING_SCENES_LIST_H_
\ No newline at end of file
<Privilege>http://tizen.org/privilege/wifimanager</Privilege>
<Privilege>http://tizen.org/privilege/systemsetting.write</Privilege>
<Privilege>http://tizen.org/privilege/packagesetting</Privilege>
+ <Privilege>http://tizen.org/privilege/package.info</Privilege>
<Privilege>http://tizen.org/privilege/setting</Privilege>
<Privilege>http://tizen.org/privilege/nfc.p2p</Privilege>
<Privilege>http://tizen.org/privilege/wifi.admin</Privilege>
CreateSearchAnimationFrame();
bool EnableStatus = false;
- if (SystemInfo::GetValue(SYSTEM_INFO_KEY_BLUETOOTH, EnableStatus) != E_SUCCESS)
+ if (0)//SystemInfo::GetValue(SYSTEM_INFO_KEY_BLUETOOTH, EnableStatus) != E_SUCCESS)
{
AppLogDebug("Bluetooth is not supported");
DisableScanFooter();
{
relativeLayout.SetMargin(*pLabel, RELATIVE_LAYOUT_LEFT_MARGIN, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
}
- if (style == TABLE_VIEW_ANNEX_STYLE_DETAILED)
+ else if (style == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
relativeLayout.SetMargin(*pLabel, itemRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN_DETAIL_BUTTON, 0, 0);
}
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file StDownloadedApplicationForm.cpp
+ * @brief This is the implementation file for DownloadedApplicationForm class.
+ */
+
+#include <FIo.h>
+#include "StDownloadedApplicationForm.h"
+#include "StResourceManager.h"
+#include "StSettingScenesList.h"
+#include "StTypes.h"
+
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+static const int MAIN_RELATIVE_LAYOUT_RIGHT_MARGIN = 60;
+static const wchar_t* ID_RELATIVE_SETTING_XML_FILE_PATH = L"/setting/setting.xml";
+static const wchar_t* ID_APPLICATION_DEFAULT_FOLDER_PATH = L"/opt/apps/";
+
+static const int ID_GROUP_COUNT = 1;
+static const int ID_GROUP_MAX_ITEM_COUNT = 3;
+
+DownloadedApplicationForm::DownloadedApplicationForm(void)
+ : __pDownloadAppIdKeyList(null)
+ , __pAppIdHashMap(null)
+ , __pAppIconPathHashMap(null)
+{
+}
+
+DownloadedApplicationForm::~DownloadedApplicationForm(void)
+{
+}
+
+void
+DownloadedApplicationForm::CreateFooter(void)
+{
+ Footer* pFooter = GetFooter();
+ AppAssert(pFooter);
+
+ pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+ pFooter->SetBackButton();
+ pFooter->AddActionEventListener(*this);
+
+ SetFormBackEventListener(this);
+}
+
+result
+DownloadedApplicationForm::OnInitializing(void)
+{
+ CreateHeader(ResourceManager::GetString(L"IDS_ST_BODY_DOWNLOADED_APPLICATIONS"));
+ CreateFooter();
+ CreateTableView();
+ SetAppIdListFromPackageManager();
+
+ return E_SUCCESS;
+}
+
+result
+DownloadedApplicationForm::OnTerminating(void)
+{
+ RemoveAllDownLoadAppIdKeyList();
+ RemoveAllAppIdList();
+ __pTableView = null;
+
+ SetFormBackEventListener(null);
+ return E_SUCCESS;
+}
+
+void
+DownloadedApplicationForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+ if (pArgs != null)
+ {
+ delete pArgs;
+ }
+ RemoveAllDownLoadAppIdKeyList();
+ SetAppIdListFromPackageManager();
+
+ __pTableView->UpdateTableView();
+}
+
+void
+DownloadedApplicationForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+void
+DownloadedApplicationForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+}
+
+int
+DownloadedApplicationForm::GetGroupCount(void)
+{
+ AppLogDebug("ENTER");
+
+ return ID_GROUP_COUNT;
+}
+
+int
+DownloadedApplicationForm::GetItemCount(int groupIndex)
+{
+ int itemCount = GetDownLoadAppCount();
+
+ AppLogDebug("GetItemCount %d", itemCount);
+
+ return itemCount;
+}
+
+TableViewGroupItem*
+DownloadedApplicationForm::CreateGroupItem(int groupIndex, int itemWidth)
+{
+ AppLogDebug("ENTER");
+
+ int itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
+ int yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
+ LabelTextStyle style = LABEL_TEXT_STYLE_NORMAL;
+ Rectangle itemRectangle;
+ String groupText;
+ Label* pLabel = null;
+ int fontSize = GetFontSize();
+
+ TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
+
+ yItemOffset = H_GROUP_INDEX_NO_HELP_TEXT_GAP;
+ itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
+
+ itemRectangle.x = X_GROUP_ITEM_DEFAULT_LABEL;
+ itemRectangle.y = yItemOffset;
+ itemRectangle.width = itemWidth;
+ itemRectangle.height = itemHeight;
+
+ RelativeLayout relativeLayout;
+ relativeLayout.Construct();
+
+ pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight));
+ pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT);
+
+ pLabel = new (std::nothrow) Label();
+ pLabel->Construct(itemRectangle, groupText);
+ pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
+ pLabel->SetTextConfig(fontSize, style);
+ pLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
+
+ pItem->AddControl(*pLabel);
+ relativeLayout.SetMargin(*pLabel, itemRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
+ pItem->SetEnabled(false);
+
+ return pItem;
+}
+
+TableViewItem*
+DownloadedApplicationForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
+{
+ AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
+
+ Rectangle itemRectIcon;
+ Rectangle itemRectLabel;
+ TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
+ String itemText;
+ String secondLineText;
+ String fontReturnValue;
+ Label* pLabel = null;
+ Bitmap* pBitmap;
+
+ int fontSize = GetFontSize();
+ int itemHeight = H_GROUP_ITEM_DEFAULT_LABEL;
+ ItemTypeIconAndOneLine(itemRectIcon, itemRectLabel);
+
+ String appIdKey = GetDownLoadAppIdKeyAt(itemIndex);
+ String iconPath = GetAppSettingIconPathFromAppIdListAt(appIdKey);
+
+ itemText = GetDownLoadAppNameAt(itemIndex);
+
+ if (iconPath.IsEmpty() == true)
+ {
+ pBitmap = ResourceManager::GetBitmapN(IDB_DEFAULT_ICON);
+ }
+ else
+ {
+ pBitmap = ResourceManager::GetApplicationBitmapN(iconPath);
+ }
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+
+ RelativeLayout relativeLayout;
+ relativeLayout.Construct();
+
+ pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight), style);
+ pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
+
+ pLabel = new (std::nothrow) Label();
+ pLabel->Construct(itemRectIcon, L"");
+ pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+ pLabel->SetBackgroundBitmap(*pBitmap);
+
+ pItem->AddControl(*pLabel);
+
+ pLabel = new (std::nothrow) Label();
+ pLabel->Construct(itemRectLabel, itemText);
+ pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
+ pLabel->SetTextColor(COLOR_MAIN_TEXT);
+
+ pItem->AddControl(*pLabel);
+ relativeLayout.SetMargin(*pLabel, itemRectLabel.x, MAIN_RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
+
+ return pItem;
+}
+
+bool
+DownloadedApplicationForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
+{
+ AppLogDebug("ENTER");
+
+ delete pItem;
+ pItem = null;
+
+ return true;
+}
+
+bool
+DownloadedApplicationForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
+{
+ AppLogDebug("ENTER");
+
+ delete pItem;
+ pItem = null;
+
+ return true;
+}
+
+void
+DownloadedApplicationForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
+{
+ AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
+
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ ArrayList* pArgs = null;
+
+ String appIdKey = GetDownLoadAppIdKeyAt(itemIndex);
+ if (appIdKey.IsEmpty() == true)
+ {
+ AppLogDebug("GetDownLoadAppIdKeyAt[%d] fail", itemIndex);
+ }
+
+ String appSettingFilepath = GetAppSettingFilePathFromAppIdListAt(appIdKey);
+ if (appSettingFilepath.IsEmpty() == true)
+ {
+ AppLogDebug("GetAppSettingFilePathFromAppIdListAt[%ls] fail", appIdKey.GetPointer());
+ }
+
+ pArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ if (pArgs == null)
+ {
+ AppLogDebug("pArgs is null");
+ }
+
+ result r = pArgs->Construct();
+ if (IsFailed(r))
+ {
+ AppLogDebug("Construct fail [%s]", GetErrorMessage(r));
+ }
+
+ pArgs->Add(*(new (std::nothrow) String(appIdKey)));
+ pArgs->Add(*(new (std::nothrow) String(appSettingFilepath)));
+
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_XML_PARSER, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
+}
+
+int
+DownloadedApplicationForm::GetDefaultGroupItemHeight(void)
+{
+ return H_GROUP_INDEX_NO_TITLE_DEFAULT;
+}
+
+int
+DownloadedApplicationForm::GetDefaultItemHeight(void)
+{
+ return H_GROUP_ITEM_DEFAULT;
+}
+
+void
+DownloadedApplicationForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
+{
+}
+
+void
+DownloadedApplicationForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
+{
+ Invalidate(true);
+}
+
+void
+DownloadedApplicationForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
+{
+}
+
+void
+DownloadedApplicationForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
+{
+}
+
+void
+DownloadedApplicationForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
+{
+ Invalidate(true);
+}
+
+void
+DownloadedApplicationForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
+{
+ if (requestId == FRFRESH_REQUEST_EVENT)
+ {
+ if (__pTableView)
+ {
+ RemoveAllDownLoadAppIdKeyList();
+ SetAppIdListFromPackageManager();
+ __pTableView->UpdateTableView();
+ }
+ if (pArgs)
+ {
+ pArgs->RemoveAll(true);
+ delete pArgs;
+ }
+ }
+}
+
+result
+DownloadedApplicationForm::SetDownLoadAppIdKeyList(void)
+{
+ RemoveAllDownLoadAppIdKeyList();
+
+ if (__pAppIdHashMap == null)
+ {
+ AppLogDebug("__pAppIdHashMap is null");
+ return E_FAILURE;
+ }
+
+ __pDownloadAppIdKeyList = __pAppIdHashMap->GetKeysN();
+ if (__pDownloadAppIdKeyList == null)
+ {
+ AppLogDebug("__pDownloadAppIdKeyList is null");
+ return E_FAILURE;
+ }
+
+ return E_SUCCESS;
+}
+
+void
+DownloadedApplicationForm::RemoveAllDownLoadAppIdKeyList(void)
+{
+ if (__pDownloadAppIdKeyList != null)
+ {
+ __pDownloadAppIdKeyList->RemoveAll();
+ delete __pDownloadAppIdKeyList;
+ __pDownloadAppIdKeyList = null;
+ }
+}
+
+result
+DownloadedApplicationForm::SetAppIdListFromPackageManager(void)
+{
+ RemoveAllAppIdList();
+
+ __pAppIdHashMap = new (std::nothrow) HashMap();
+ if (__pAppIdHashMap == null)
+ {
+ AppLogDebug("__pAppIdHashMap is null");
+ return E_FAILURE;
+ }
+
+ result r = __pAppIdHashMap->Construct();
+ if (IsFailed(r))
+ {
+ AppLogDebug("Construct fail [%s]", GetErrorMessage(GetLastResult()));
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ __pAppIconPathHashMap = new (std::nothrow) HashMap();
+ if (__pAppIconPathHashMap == null)
+ {
+ AppLogDebug("__pAppIconPathHashMap is null");
+ return E_FAILURE;
+ }
+ r = __pAppIconPathHashMap->Construct();
+ if (IsFailed(r))
+ {
+ AppLogDebug("Construct fail [%s]", GetErrorMessage(GetLastResult()));
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ IList* pList = null;
+ PackageManager* pPackageManager = PackageManager::GetInstance();
+ if (pPackageManager == null)
+ {
+ AppLogDebug("pPackageManager is null");
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ HashMap packageFilterMap;
+ r = packageFilterMap.Construct();
+ if (IsFailed(r))
+ {
+ AppLogDebug("pPackageFilter Construct fail");
+ }
+
+ String* pKey = new String("http://tizen.org/package/appsetting");
+ Boolean* pValue = new Boolean(true);
+
+ r = packageFilterMap.Add(pKey, pValue);
+ if (IsFailed(r))
+ {
+ AppLogDebug("packageFilterMap add Fail");
+ }
+
+ pList = pPackageManager->GetPackageInfoListN(packageFilterMap);
+ if (pList == null)
+ {
+ AppLogDebug("pList is null");
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ IEnumerator* pEnumerator = pList->GetEnumeratorN();
+ if (pEnumerator == null)
+ {
+ AppLogDebug("pEnumerator is null");
+ pList->RemoveAll();
+ delete pList;
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ bool isFindXml = false;
+ UiApp* pApp = UiApp::GetInstance();
+ AppAssert(pApp);
+
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ PackageInfo* pPackage = static_cast<PackageInfo*>(pEnumerator->GetCurrent());
+ if (pPackage != null && pPackage->GetType() == PACKAGE_TYPE_TPK)
+ {
+ String path(ID_APPLICATION_DEFAULT_FOLDER_PATH);
+ path.Append(pPackage->GetId());
+
+ path.Append(ID_RELATIVE_SETTING_XML_FILE_PATH);
+
+ if ((File::IsFileExist(path) == true)
+ && (!pApp->GetAppId().Contains(pPackage->GetId())))
+ {
+ String key(pPackage->GetDisplayName());
+ key.Append(L":");
+ key.Append(pPackage->GetId());
+
+ String currentAppId = pPackage->GetMainAppId();
+ PackageAppInfo* pPackageInfo = static_cast<PackageAppInfo*>(pPackage->GetPackageAppInfoN(currentAppId));
+ String iconPath = pPackageInfo->GetAppMenuIconPath();
+
+ __pAppIdHashMap->Add(*(new (std::nothrow) String(key)), *(new (std::nothrow) String(path)));
+ __pAppIconPathHashMap->Add(*(new (std::nothrow) String(key)), *(new (std::nothrow) String(iconPath)));
+ isFindXml = true;
+ }
+ }
+ }
+ delete pEnumerator;
+ delete pList;
+
+ if (isFindXml == false)
+ {
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ r = SetDownLoadAppIdKeyList();
+ if (IsFailed(r))
+ {
+ RemoveAllDownLoadAppIdKeyList();
+ RemoveAllAppIdList();
+ return E_FAILURE;
+ }
+
+ return E_SUCCESS;
+}
+
+
+void
+DownloadedApplicationForm::RemoveAllAppIdList(void)
+{
+ if (__pAppIdHashMap != null)
+ {
+ __pAppIdHashMap->RemoveAll();
+ delete __pAppIdHashMap;
+ __pAppIdHashMap = null;
+ }
+
+ if (__pAppIconPathHashMap != null)
+ {
+ __pAppIconPathHashMap->RemoveAll();
+ delete __pAppIconPathHashMap;
+ __pAppIconPathHashMap = null;
+ }
+}
+
+Tizen::Base::String
+DownloadedApplicationForm::GetAppSettingFilePathFromAppIdListAt(Tizen::Base::String key)
+{
+ String appSettingFilePath;
+ if (__pAppIdHashMap == null)
+ {
+ AppLogDebug("__pAppIdHashMap is null");
+ return appSettingFilePath;
+ }
+
+ bool isFind = false;
+ result r = __pAppIdHashMap->ContainsKey(key, isFind);
+ if ((isFind == false)
+ || (IsFailed(r)))
+ {
+ if (isFind == false)
+ {
+ AppLogDebug("key[%ls] is not found", key.GetPointer());
+ }
+ else
+ {
+ AppLogDebug("ContainsKey fail [%s]", GetErrorMessage(r));
+ }
+ return appSettingFilePath;
+ }
+
+ String* pValue = static_cast<String*>(__pAppIdHashMap->GetValue(key));
+ if (pValue == null)
+ {
+ AppLogDebug("pValue is null");
+ return appSettingFilePath;
+ }
+
+ appSettingFilePath.Append(*pValue);
+ return appSettingFilePath;
+}
+
+Tizen::Base::String
+DownloadedApplicationForm::GetDownLoadAppNameAt(unsigned int index)
+{
+ String appName;
+ if (__pDownloadAppIdKeyList == null)
+ {
+ AppLogDebug("__pDownloadAppIdKeyList is null");
+ return appName;
+ }
+
+ String* pAppKey = static_cast<String*>(__pDownloadAppIdKeyList->GetAt(index));
+ if (pAppKey == null)
+ {
+ AppLogDebug("pAppKey is null");
+ return appName;
+ }
+
+ StringTokenizer stringTokenizer(*pAppKey, L":");
+ result r = stringTokenizer.GetNextToken(appName);
+ if (IsFailed(r))
+ {
+ AppLogDebug("GetNextToken fail[%s]",GetErrorMessage(r));
+ return appName;
+ }
+
+ return appName;
+}
+
+Tizen::Base::String
+DownloadedApplicationForm::GetDownLoadAppIdKeyAt(unsigned int index)
+{
+ String appIdKey;
+ if (__pDownloadAppIdKeyList == null)
+ {
+ AppLogDebug("__pDownloadAppIdKeyList is null");
+ return appIdKey;
+ }
+
+ String* pAppKey = static_cast<String*>(__pDownloadAppIdKeyList->GetAt(index));
+ if (pAppKey == null)
+ {
+ AppLogDebug("pAppKey is null");
+ return appIdKey;
+ }
+
+ appIdKey.Append(*pAppKey);
+
+ return appIdKey;
+}
+
+unsigned int
+DownloadedApplicationForm::GetDownLoadAppCount(void)
+{
+ unsigned int downLoadAppCount = 0;
+ if (__pDownloadAppIdKeyList == null)
+ {
+ AppLogDebug("__pDownloadAppIdKeyList is null");
+ return downLoadAppCount;
+ }
+
+ downLoadAppCount = __pDownloadAppIdKeyList->GetCount();
+ return downLoadAppCount;
+}
+
+Tizen::Base::String
+DownloadedApplicationForm::GetAppSettingIconPathFromAppIdListAt(Tizen::Base::String& id)
+{
+ String iconPath;
+
+ if (__pAppIconPathHashMap)
+ {
+ if (__pAppIconPathHashMap->ContainsKey(id) == true)
+ {
+ iconPath = *(static_cast<String*>(__pAppIconPathHashMap->GetValue((id))));
+ }
+ }
+ return iconPath;
+}
\ No newline at end of file
-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
#include "StDateTimeForm.h"
#include "StDeveloperOptionForm.h"
#include "StDisplayForm.h"
+#include "StDownloadedApplicationForm.h"
#include "StEventsNotificationForm.h"
#include "StFontForm.h"
#include "StFontSizeForm.h"
const wchar_t* IDSCN_XML_PARSER = L"ReadXMLFileForDownloadApp";
const wchar_t* IDSCN_WIFI_DIRECT_CONNECTION = L"WifiDirectConnection";
const wchar_t* IDSCN_TIME_ZONE = L"TimeZone";
+const wchar_t* IDSCN_HOME_AND_LOCK_SCREEN = L"HomeAndLockScreen";
+const wchar_t* IDSCN_DOWNLOADED_APPLICATION = L"DownloadedApplication";
const wchar_t* IDC_FORM_MAIN_MENU = L"MainMenuForm";
const wchar_t* IDC_FORM_XML_PARSER = L"ReadXMLFileForDownloadAppForm";
const wchar_t* IDC_FORM_WIFI_DIRECT_CONNECTION = L"WifiDirectConnectionForm";
const wchar_t* IDC_FORM_TIME_ZONE = L"TimeZoneForm";
+const wchar_t* IDC_FORM_HOME_AND_LOCK_SCREEN = L"HomeAndLockScreenForm";
+const wchar_t* IDC_FORM_DOWNLOADED_APPLICATION = L"DownloadedApplicationForm";
const wchar_t* IDSCN_NULL = L"Empty";
pSceneManager->AddSceneEventListener(sceneId, *pForm);
pNewForm = pForm;
}
+ else if (formId == IDC_FORM_DOWNLOADED_APPLICATION)
+ {
+ DownloadedApplicationForm* pForm = new (std::nothrow) DownloadedApplicationForm();
+ pForm->Initialize();
+ pSceneManager->AddSceneEventListener(sceneId, *pForm);
+ pNewForm = pForm;
+ }
else if (formId == IDC_FORM_MAIN_MENU)
{
MainMenuForm* pForm = new (std::nothrow) MainMenuForm();
pSceneManager->RegisterScene(IDSCN_WIFI_DIRECT_CONNECTION, IDC_FORM_WIFI_DIRECT_CONNECTION, L"");
pSceneManager->RegisterScene(IDSCN_TIME_ZONE, IDC_FORM_TIME_ZONE, L"");
pSceneManager->RegisterScene(IDSCN_XML_PARSER, IDC_FORM_XML_PARSER, L"");
+ pSceneManager->RegisterScene(IDSCN_HOME_AND_LOCK_SCREEN, IDC_FORM_HOME_AND_LOCK_SCREEN, L"");
+ pSceneManager->RegisterScene(IDSCN_DOWNLOADED_APPLICATION, IDC_FORM_DOWNLOADED_APPLICATION, L"");
SettingsApp* pApp = static_cast<SettingsApp*>(SettingsApp::GetInstance());
* @brief This is the implementation file for MainMenuForm class.
*/
-#include <FIo.h>
-#include "StAppSettingManager.h"
#include "StBluetoothPresentationModel.h"
#include "StMainMenuForm.h"
#include "StNfcPresentationModel.h"
#include "StTypes.h"
using namespace Tizen::App;
-using namespace Tizen::App::Package;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
-using namespace Tizen::Base::Utility;
using namespace Tizen::Graphics;
-using namespace Tizen::Io;
using namespace Tizen::Net::Bluetooth;
using namespace Tizen::System;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
-//static const int W_RESIZE_LABEL_GAP = 110;
-
static const int H_GROUP_FONT_SIZE_GIANT = 146;
static const int H_GROUP_FONT_SIZE_HUGE = 128;
static const int H_GROUP_FONT_SIZE_LARGE = 110;
static const wchar_t* APPCONTROL_PROVIDER_ID_PHONE = L"tizen.phone";
static const wchar_t* APPCONTROL_PROVIDER_ID_ACCOUNT = L"ZsnYtAdjl2.Account";
-static const wchar_t* ID_RELATIVE_SETTING_XML_FILE_PATH = L"/setting/setting.xml";
-static const wchar_t* ID_APPLICATION_DEFAULT_FOLDER_PATH = L"/opt/apps/";
-
static const int ID_GROUP_CONNECTIVITY = 0;
static const int ID_ITEM_CONNECTIVITY_WIFI = 0;
static const int ID_ITEM_CONNECTIVITY_BLUETOOTH = 1;
static const int ID_ITEM_CONNECTIVITY_NFC = 3;
static const int ID_GROUP_CONNECTIVITY_ITEM_COUNT = 4;
-//static const int ID_GROUP_MODE = 1;
-//static const int ID_ITEM_MODE_FLIGHT_MODE = 0;
-//static const int ID_GROUP_MODE_ITEM_COUNT = 1;
-
static const int ID_GROUP_PERSONAL = 1;
static const int ID_ITEM_PERSONAL_HOME_SCREEN = 0;
static const int ID_ITEM_PERSONAL_LOCK_SCREEN = 1;
static const int ID_GROUP_SYSTEM = 3;
static const int ID_ITEM_SYSTEM_MANAGE_APPLICATION = 0;
+static const int ID_ITEM_SYSTEM_DOWNLOADED_APPLICATION = 1;
static const int ID_ITEM_SYSTEM_DEVELOPER_OPTION = 2;
-static const int ID_ITEM_SYSTEM_ABOUT_PHONE = 1;
-static const int ID_GROUP_SYSTEM_ITEM_COUNT = 2;
+static const int ID_ITEM_SYSTEM_ABOUT_PHONE = 3;
+static const int ID_GROUP_SYSTEM_ITEM_COUNT = 3;
+static const int ID_GROUP_SYSTEM_DEVICE_ITEM_COUNT = 4;
static const int ID_GROUP_APPSETTING = 4;
static const int ID_GROUP_NO_APPSETTING = 4;
static const int ID_MAIN_MENU_DEFAULT_COUNT = 1;
-//void
-//IFlightModeSetValueAsyncResultListener::OnResultReceivedForSetValueAsync(const Tizen::Base::String& key, result r)
-//{
-// AppLogDebug("key(%ls) r(%s)", key.GetPointer(), GetErrorMessage(r));
-//}
-
MainMenuForm::MainMenuForm(void)
- : __pDownloadAppIdKeyList(null)
- , __pAppIdHashMap(null)
- , __pAppIconPathHashMap(null)
-// , __pFlightModeSetValueAsyncResultListener(null)
+ : __currentTableViewList(0)
{
}
CreateHeader(ResourceManager::GetString(L"IDS_COM_BODY_SETTINGS"));
CreateFooter();
CreateTableView();
- SetAppIdListFromPackageManager();
+ __isEmulator = IsEmulator();
return E_SUCCESS;
}
result
MainMenuForm::OnTerminating(void)
{
- RemoveAllDownLoadAppIdKeyList();
- RemoveAllAppIdList();
__pTableView = null;
return E_SUCCESS;
Header* pHeader = GetHeader();
pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_SETTINGS"));
- RemoveAllDownLoadAppIdKeyList();
- SetAppIdListFromPackageManager();
-
__pTableView->UpdateTableView();
-
-// bool flightModeEnableStatus = false;
-// if (SettingInfo::GetValue(SETTING_INFO_KEY_NETWORK_FLIGHTMODE, flightModeEnableStatus) == E_SUCCESS)
-// {
-// __pTableView->SetItemChecked(ID_GROUP_MODE, ID_ITEM_MODE_FLIGHT_MODE, flightModeEnableStatus);
-// }
}
void
MainMenuForm::GetGroupCount(void)
{
int groupItemCount = ID_GROUP_NO_APPSETTING;
- if (GetDownLoadAppCount() > 0)
- {
- groupItemCount = ID_GROUP_APPSETTING + ID_MAIN_MENU_DEFAULT_COUNT;
- }
return groupItemCount;
}
case ID_GROUP_SYSTEM:
{
- itemCount = ID_GROUP_SYSTEM_ITEM_COUNT;
+ if (__isEmulator)
+ {
+ itemCount = ID_GROUP_SYSTEM_ITEM_COUNT;
+ }
+ else
+ {
+ itemCount = ID_GROUP_SYSTEM_DEVICE_ITEM_COUNT;
+ }
}
break;
case ID_GROUP_APPSETTING:
{
- itemCount = GetDownLoadAppCount();
+ itemCount = ID_MAIN_MENU_DEFAULT_COUNT;
}
break;
{
case ID_ITEM_CONNECTIVITY_WIFI:
{
+ if (__isEmulator)
+ {
+ return null;
+ }
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI);
itemText = ResourceManager::GetString(L"IDS_ST_BODY_WI_FI");
}
}
break;
+ case ID_ITEM_SYSTEM_DOWNLOADED_APPLICATION:
+ {
+ pBitmap = ResourceManager::GetBitmapN(IDB_DEFAULT_ICON);
+ itemText = ResourceManager::GetString(L"IDS_ST_BODY_DOWNLOADED_APPLICATIONS");
+ }
+ break;
+
case ID_ITEM_SYSTEM_DEVELOPER_OPTION:
{
- pBitmap = ResourceManager::GetBitmapN(IDB_DEVELOPER_OPTION);
- itemText = ResourceManager::GetString(L"IDS_ST_BODY_DEVELOPER_OPTIONS");
+ if (__isEmulator)
+ {
+ pBitmap = ResourceManager::GetBitmapN(IDB_ABOUT_PHONE);
+ itemText = ResourceManager::GetString(L"IDS_ST_BODY_ABOUT_PHONE");
+ }
+ else
+ {
+ pBitmap = ResourceManager::GetBitmapN(IDB_DEVELOPER_OPTION);
+ itemText = ResourceManager::GetString(L"IDS_ST_BODY_DEVELOPER_OPTIONS");
+ }
}
break;
}
break;
- case ID_GROUP_APPSETTING:
- {
- String appIdKey = GetDownLoadAppIdKeyAt(itemIndex);
- String iconPath = GetAppSettingIconPathFromAppIdListAt(appIdKey);
-
- itemText = GetDownLoadAppNameAt(itemIndex);
-
- if (iconPath.IsEmpty() == true)
- {
- pBitmap = ResourceManager::GetBitmapN(IDB_DEFAULT_ICON);
- }
- else
- {
- pBitmap = ResourceManager::GetApplicationBitmapN(iconPath);
- }
- }
- break;
-
default:
break;
}
return pItem;
}
-Tizen::Base::String
-MainMenuForm::GetAppSettingIconPathFromAppIdListAt(Tizen::Base::String& id)
-{
- String iconPath;
-
- if (__pAppIconPathHashMap)
- {
- if (__pAppIconPathHashMap->ContainsKey(id) == true)
- {
- iconPath = *(static_cast<String*>(__pAppIconPathHashMap->GetValue((id))));
- }
- }
- return iconPath;
-}
-
bool
MainMenuForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
{
{
pSceneName = GroupConnectivitySceneConnect(__currentTableViewList, itemIndex, status);
#if 1 // temp
- if(pSceneName == IDSCN_WIFI)
+ if (pSceneName == IDSCN_WIFI)
{
AppControl* pAppControl = AppManager::GetInstance()->FindAppControlN(L"wifi-efl-ug", L"");
}
break;
- case ID_GROUP_APPSETTING:
- {
- String appIdKey = GetDownLoadAppIdKeyAt(itemIndex);
- if (appIdKey.IsEmpty() == true)
- {
- AppLogDebug("GetDownLoadAppIdKeyAt[%d] fail", itemIndex);
- break;
- }
-
- String appSettingFilepath = GetAppSettingFilePathFromAppIdListAt(appIdKey);
- if (appSettingFilepath.IsEmpty() == true)
- {
- AppLogDebug("GetAppSettingFilePathFromAppIdListAt[%ls] fail", appIdKey.GetPointer());
- break;
- }
-
- pArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
- if (pArgs == null)
- {
- AppLogDebug("pArgs is null");
- break;
- }
-
- result r = pArgs->Construct();
- if (IsFailed(r))
- {
- AppLogDebug("Construct fail [%s]", GetErrorMessage(r));
- break;
- }
-
- pArgs->Add(*(new (std::nothrow) String(appIdKey)));
- pArgs->Add(*(new (std::nothrow) String(appSettingFilepath)));
-
- pSceneName = IDSCN_XML_PARSER;
- }
- break;
-
default:
break;
}
}
}
-result
-MainMenuForm::SetDownLoadAppIdKeyList(void)
-{
- RemoveAllDownLoadAppIdKeyList();
-
- if (__pAppIdHashMap == null)
- {
- AppLogDebug("__pAppIdHashMap is null");
- return E_FAILURE;
- }
-
- __pDownloadAppIdKeyList = __pAppIdHashMap->GetKeysN();
- if (__pDownloadAppIdKeyList == null)
- {
- AppLogDebug("__pDownloadAppIdKeyList is null");
- return E_FAILURE;
- }
-
- return E_SUCCESS;
-}
-
-void
-MainMenuForm::RemoveAllDownLoadAppIdKeyList(void)
-{
- if (__pDownloadAppIdKeyList != null)
- {
- __pDownloadAppIdKeyList->RemoveAll();
- delete __pDownloadAppIdKeyList;
- __pDownloadAppIdKeyList = null;
- }
-}
-
-result
-MainMenuForm::SetAppIdListFromPackageManager(void)
-{
- RemoveAllAppIdList();
-
- __pAppIdHashMap = new (std::nothrow) HashMap();
- if (__pAppIdHashMap == null)
- {
- AppLogDebug("__pAppIdHashMap is null");
- return E_FAILURE;
- }
-
- result r = __pAppIdHashMap->Construct();
- if (IsFailed(r))
- {
- AppLogDebug("Construct fail [%s]", GetErrorMessage(GetLastResult()));
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- __pAppIconPathHashMap = new (std::nothrow) HashMap();
- if (__pAppIconPathHashMap == null)
- {
- AppLogDebug("__pAppIconPathHashMap is null");
- return E_FAILURE;
- }
- r = __pAppIconPathHashMap->Construct();
- if (IsFailed(r))
- {
- AppLogDebug("Construct fail [%s]", GetErrorMessage(GetLastResult()));
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- IList* pList = null;
- PackageManager* pPackageManager = PackageManager::GetInstance();
- if (pPackageManager == null)
- {
- AppLogDebug("pPackageManager is null");
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- pList = pPackageManager->GetPackageInfoListN();
- if (pList == null)
- {
- AppLogDebug("pList is null");
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- IEnumerator* pEnumerator = pList->GetEnumeratorN();
- if (pEnumerator == null)
- {
- AppLogDebug("pEnumerator is null");
- pList->RemoveAll();
- delete pList;
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- bool isFindXml = false;
- UiApp* pApp = UiApp::GetInstance();
- AppAssert(pApp);
-
- while (pEnumerator->MoveNext() == E_SUCCESS)
- {
- PackageInfo* pPackage = static_cast<PackageInfo*>(pEnumerator->GetCurrent());
- if (pPackage != null && pPackage->GetType() == PACKAGE_TYPE_TPK)
- {
- String path(ID_APPLICATION_DEFAULT_FOLDER_PATH);
- path.Append(pPackage->GetId());
-
- path.Append(ID_RELATIVE_SETTING_XML_FILE_PATH);
-
- if ((File::IsFileExist(path) == true)
- && (!pApp->GetAppId().Contains(pPackage->GetId())))
- {
- String key(pPackage->GetDisplayName());
- key.Append(L":");
- key.Append(pPackage->GetId());
-
- String currentAppId = pPackage->GetMainAppId();
- PackageAppInfo* pPackageInfo = static_cast<PackageAppInfo*>(pPackage->GetPackageAppInfoN(currentAppId));
- String iconPath = pPackageInfo->GetAppMenuIconPath();
-
- __pAppIdHashMap->Add(*(new (std::nothrow) String(key)), *(new (std::nothrow) String(path)));
- __pAppIconPathHashMap->Add(*(new (std::nothrow) String(key)), *(new (std::nothrow) String(iconPath)));
- isFindXml = true;
- }
- }
- }
- delete pEnumerator;
- delete pList;
-
- if (isFindXml == false)
- {
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- r = SetDownLoadAppIdKeyList();
- if (IsFailed(r))
- {
- RemoveAllDownLoadAppIdKeyList();
- RemoveAllAppIdList();
- return E_FAILURE;
- }
-
- return E_SUCCESS;
-}
-
-void
-MainMenuForm::RemoveAllAppIdList(void)
-{
- if (__pAppIdHashMap != null)
- {
- __pAppIdHashMap->RemoveAll();
- delete __pAppIdHashMap;
- __pAppIdHashMap = null;
- }
-
- if (__pAppIconPathHashMap != null)
- {
- __pAppIconPathHashMap->RemoveAll();
- delete __pAppIconPathHashMap;
- __pAppIconPathHashMap = null;
- }
-}
-
-Tizen::Base::String
-MainMenuForm::GetAppSettingFilePathFromAppIdListAt(Tizen::Base::String key)
-{
- String appSettingFilePath;
- if (__pAppIdHashMap == null)
- {
- AppLogDebug("__pAppIdHashMap is null");
- return appSettingFilePath;
- }
-
- bool isFind = false;
- result r = __pAppIdHashMap->ContainsKey(key, isFind);
- if ((isFind == false)
- || (IsFailed(r)))
- {
- if (isFind == false)
- {
- AppLogDebug("key[%ls] is not found", key.GetPointer());
- }
- else
- {
- AppLogDebug("ContainsKey fail [%s]", GetErrorMessage(r));
- }
- return appSettingFilePath;
- }
-
- String* pValue = static_cast<String*>(__pAppIdHashMap->GetValue(key));
- if (pValue == null)
- {
- AppLogDebug("pValue is null");
- return appSettingFilePath;
- }
-
- appSettingFilePath.Append(*pValue);
- return appSettingFilePath;
-}
-
-Tizen::Base::String
-MainMenuForm::GetDownLoadAppNameAt(unsigned int index)
-{
- String appName;
- if (__pDownloadAppIdKeyList == null)
- {
- AppLogDebug("__pDownloadAppIdKeyList is null");
- return appName;
- }
-
- String* pAppKey = static_cast<String*>(__pDownloadAppIdKeyList->GetAt(index));
- if (pAppKey == null)
- {
- AppLogDebug("pAppKey is null");
- return appName;
- }
-
- StringTokenizer stringTokenizer(*pAppKey, L":");
- result r = stringTokenizer.GetNextToken(appName);
- if (IsFailed(r))
- {
- AppLogDebug("GetNextToken fail[%s]",GetErrorMessage(r));
- return appName;
- }
-
- return appName;
-}
-
-Tizen::Base::String
-MainMenuForm::GetDownLoadAppIdKeyAt(unsigned int index)
-{
- String appIdKey;
- if (__pDownloadAppIdKeyList == null)
- {
- AppLogDebug("__pDownloadAppIdKeyList is null");
- return appIdKey;
- }
-
- String* pAppKey = static_cast<String*>(__pDownloadAppIdKeyList->GetAt(index));
- if (pAppKey == null)
- {
- AppLogDebug("pAppKey is null");
- return appIdKey;
- }
-
- appIdKey.Append(*pAppKey);
-
- return appIdKey;
-}
-
-unsigned int
-MainMenuForm::GetDownLoadAppCount(void)
-{
- unsigned int downLoadAppCount = 0;
- if (__pDownloadAppIdKeyList == null)
- {
- AppLogDebug("__pDownloadAppIdKeyList is null");
- return downLoadAppCount;
- }
-
- downLoadAppCount = __pDownloadAppIdKeyList->GetCount();
- return downLoadAppCount;
-}
-
const wchar_t*
MainMenuForm::GroupConnectivitySceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status)
{
}
break;
+ case ID_ITEM_SYSTEM_DOWNLOADED_APPLICATION:
+ {
+ pScene = IDSCN_DOWNLOADED_APPLICATION;
+ }
+ break;
+
case ID_ITEM_SYSTEM_DEVELOPER_OPTION:
{
- pScene = IDSCN_DEVELOPER_OPTION;
+ if (__isEmulator)
+ {
+ pScene = IDSCN_PHONE_INFO;
+ }
+ else
+ {
+ pScene = IDSCN_DEVELOPER_OPTION;
+ }
}
break;
return pScene;
}
+bool
+MainMenuForm::IsEmulator(void)
+{
+ String modelName;
+ if (SystemInfo::GetValue(SYSTEM_INFO_KEY_MODELNAME, modelName) != E_SUCCESS)
+ {
+ AppLogDebug("GetValue is error %s", GetErrorMessage(GetLastResult()));
+ return false;
+ }
+
+ return modelName.Equals(L"Emulator", false);
+}
+
void
MainMenuForm::FindAppControlScene(int itemIndex)
{
AppLogDebug("ENTER");
}
-//void
-//MainMenuForm::SetIFlightModeSetValueAsyncResultListener(void)
-//{
-// __pFlightModeSetValueAsyncResultListener = new (std::nothrow) IFlightModeSetValueAsyncResultListener();
-//}
-
void
MainMenuForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
{
Invalidate(true);
-}
-
-void
-MainMenuForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
-{
- if (requestId == FRFRESH_REQUEST_EVENT)
- {
- if (__pTableView)
- {
- RemoveAllDownLoadAppIdKeyList();
- SetAppIdListFromPackageManager();
- __pTableView->UpdateTableView();
- }
- if (pArgs)
- {
- pArgs->RemoveAll(true);
- delete pArgs;
- }
- }
-}
+}
\ No newline at end of file