--- /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 StHomeAndLockScreenForm.h
+ * @brief This is the header file for HomeAndLockScreenForm class.
+ */
+
+#ifndef _ST_HOME_AND_LOCK_SCREEN_FORM_H_
+#define _ST_HOME_AND_LOCK_SCREEN_FORM_H_
+
+#include <FBase.h>
+#include <FSystem.h>
+#include "StBaseForm.h"
+
+class HomeAndLockScreenForm
+ : public BaseForm
+{
+public:
+ HomeAndLockScreenForm(void);
+ virtual ~HomeAndLockScreenForm(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:
+ Tizen::Base::String GetTitleText(void);
+ int GetWallpaperIndex(void);
+ void SetWallpaperIndex(Tizen::Base::String& whitchOne);
+ Tizen::Base::String GetGroupText(int groupIndex);
+ Tizen::Base::String GetGroupItemText(int groupIndex);
+ void GetScreenTypeText(int groupIndex);
+ Tizen::Base::String GetGroupItemSelectedText();
+
+private:
+ int __wallpaperIndex;
+};
+
+#endif // _ST_HOME_AND_LOCK_SCREEN_FORM_H_
\ No newline at end of file
--- /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 StScreenTypeForm.h
+ * @brief This is the header file for ScreenTypeForm class.
+ */
+
+#ifndef _ST_SCREEN_TYPE_FORM_H_
+#define _ST_SCREEN_TYPE_FORM_H_
+
+#include <FSystem.h>
+#include "StBaseForm.h"
+
+class ScreenTypeForm
+ : public BaseForm
+{
+public:
+ ScreenTypeForm(void);
+ virtual ~ScreenTypeForm(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:
+ Tizen::Base::String GetTitleText(void);
+ int GetWallpaperIndex(void);
+ void SetWallpaperIndex(Tizen::Base::String& whitchOne);
+ result InitPackageInfoList(void);
+ int GetPackageAppInfoListCount(void);
+ void RemovePackageInfoList(void);
+ Tizen::Base::String GetScreenType(void);
+ Tizen::Base::String GetItemString(int itemIndex);
+
+private:
+ int __wallpaperIndex;
+ Tizen::Base::Collection::IList* __pPackageAppInfoList;
+};
+
+#endif // _ST_SCREEN_TYPE_FORM_H_
\ No newline at end of file
extern const wchar_t* IDSCN_SECURITY;
extern const wchar_t* IDSCN_POWER_SAVING_MODE;
extern const wchar_t* IDSCN_SCREEN_LOCK_TYPE;
-extern const wchar_t* IDSCN_LOCK_SCREEN;
+extern const wchar_t* IDSCN_SCREEN_TYPE;
extern const wchar_t* IDSCN_SCREEN_MODE;
extern const wchar_t* IDSCN_MORE_SYSTEM;
extern const wchar_t* IDSCN_FONT;
extern const wchar_t* IDC_FORM_SECURITY;
extern const wchar_t* IDC_FORM_POWER_SAVING_MODE;
extern const wchar_t* IDC_FORM_SCREEN_LOCK_TYPE;
-extern const wchar_t* IDC_FORM_LOCK_SCREEN;
+extern const wchar_t* IDC_FORM_SCREEN_TYPE;
extern const wchar_t* IDC_FORM_SCREEN_MODE;
extern const wchar_t* IDC_FORM_MORE_SYSTEM;
extern const wchar_t* IDC_FORM_FONT;
extern const wchar_t* SETTING_INFO_KEY_NETWORK_PACKETSERVICE;
extern const wchar_t* SETTING_INFO_KEY_NETWORK_ROAMING;
extern const wchar_t* SETTING_INFO_KEY_SCREEN_ROTAION_AUTO;
+extern const wchar_t* SETTING_INFO_KEY_SCREEN_TYPE_HOME;
+extern const wchar_t* SETTING_INFO_KEY_SCREEN_TYPE_LOCK;
extern const wchar_t* SETTING_INFO_KEY_SCREEN_WALLPAPER;
extern const wchar_t* SETTING_INFO_KEY_SCREEN_WALLPAPER_LOCK;
extern const wchar_t* SETTING_INFO_KEY_SOUND_MEDIA_VOLUME;
if (showEmptyMessageBox == true)
{
- ShowMessageBox(L"", L"\n\nThe Name cannot be empty or composited by spaces\n\n");
+ ShowMessageBox(L"", L"The Name cannot be empty or composited by spaces");
__pEditField->SetFocus();
}
else
if (errorStatus == false)
{
__pIOAppSetting->UpdateChangedValue();
- SceneManager* pSceneManager = SceneManager::GetInstance();
- AppAssert(pSceneManager);
-
- pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+ }
+ else
+ {
+ return;
}
}
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
}
int
#include "StEventsNotificationForm.h"
#include "StFontForm.h"
#include "StFontSizeForm.h"
+#include "StHomeAndLockScreenForm.h"
#include "StKeyboardForm.h"
#include "StKeyboardSelectionForm.h"
#include "StLanguageAndRegionForm.h"
#include "StPrivacyForm.h"
#include "StPrivacyDetailForm.h"
#include "StRegionForm.h"
+#include "StScreenTypeForm.h"
#include "StSoundsForm.h"
#include "StTimeZoneForm.h"
#include "StKeyboardInfoForm.h"
const wchar_t* IDSCN_SECURITY = L"Security";
const wchar_t* IDSCN_POWER_SAVING_MODE = L"PowerSavingMode";
const wchar_t* IDSCN_SCREEN_LOCK_TYPE= L"ScreenLockType";
-const wchar_t* IDSCN_LOCK_SCREEN= L"LockScreen";
+const wchar_t* IDSCN_SCREEN_TYPE= L"ScreenType";
const wchar_t* IDSCN_SCREEN_MODE= L"ScreenMode";
const wchar_t* IDSCN_MORE_SYSTEM = L"MoreSystem";
const wchar_t* IDSCN_FONT = L"Font";
const wchar_t* IDC_FORM_SECURITY = L"SecurityForm";
const wchar_t* IDC_FORM_POWER_SAVING_MODE = L"PowerSavingModeForm";
const wchar_t* IDC_FORM_SCREEN_LOCK_TYPE = L"ScreenLockTypeForm";
-const wchar_t* IDC_FORM_LOCK_SCREEN = L"LockScreenForm";
+const wchar_t* IDC_FORM_SCREEN_TYPE = L"ScreenTypeForm";
const wchar_t* IDC_FORM_SCREEN_MODE = L"ScreenModeForm";
const wchar_t* IDC_FORM_MORE_SYSTEM = L"MoreSystemForm";
const wchar_t* IDC_FORM_FONT = L"FontForm";
pSceneManager->AddSceneEventListener(sceneId, *pForm);
pNewForm = pForm;
}
+ else if (formId == IDC_FORM_HOME_AND_LOCK_SCREEN)
+ {
+ HomeAndLockScreenForm* pForm = new (std::nothrow) HomeAndLockScreenForm();
+ pForm->Initialize();
+ pSceneManager->AddSceneEventListener(sceneId, *pForm);
+ pNewForm = pForm;
+ }
+ else if (formId == IDC_FORM_SCREEN_TYPE)
+ {
+ ScreenTypeForm* pForm = new (std::nothrow) ScreenTypeForm();
+ pForm->Initialize();
+ pSceneManager->AddSceneEventListener(sceneId, *pForm);
+ pNewForm = pForm;
+ }
else if (formId == IDC_FORM_DOWNLOADED_APPLICATION)
{
DownloadedApplicationForm* pForm = new (std::nothrow) DownloadedApplicationForm();
--- /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 StHomeAndLockScreenForm.cpp
+ * @brief This is the implementation file for HomeAndLockScreenForm class.
+ */
+
+#include "StHomeAndLockScreenForm.h"
+#include "StResourceManager.h"
+#include "StSettingScenesList.h"
+#include "StTypes.h"
+
+using namespace Tizen::App::Package;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+static const int ID_INDEX_HOME_SCREEN_WALLPAPER = 0;
+static const int ID_INDEX_LOCK_SCREEN_WALLPAPER = 1;
+
+static const int ID_GROUP_SCREEN_TYPE = 0;
+static const int ID_ITEM_SCREEN_TYPE = 0;
+static const int ID_GROUP_SCREEN_TYPE_ITEM_COUNT = 1;
+
+static const int ID_GROUP_SCREEN_WALLPAPER = 1;
+static const int ID_ITEM_SCREEN_WALLPAPER = 0;
+static const int ID_GROUP_SCREEN_WALLPAPER_ITEM_COUNT = 1;
+
+static const int ID_GROUP_COUNT = 2;
+static const int ID_GROUP_MAX_ITEM_COUNT = 1;
+
+HomeAndLockScreenForm::HomeAndLockScreenForm(void)
+{
+}
+
+HomeAndLockScreenForm::~HomeAndLockScreenForm(void)
+{
+}
+
+void
+HomeAndLockScreenForm::CreateFooter(void)
+{
+ Footer* pFooter = GetFooter();
+ AppAssert(pFooter);
+
+ pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+ pFooter->SetBackButton();
+ pFooter->AddActionEventListener(*this);
+
+ SetFormBackEventListener(this);
+}
+
+result
+HomeAndLockScreenForm::OnInitializing(void)
+{
+ return E_SUCCESS;
+}
+
+result
+HomeAndLockScreenForm::OnTerminating(void)
+{
+ if (__pTableView)
+ {
+ __pTableView = null;
+ SetFormBackEventListener(null);
+ }
+ return E_SUCCESS;
+}
+
+void
+HomeAndLockScreenForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+ if (pArgs != null)
+ {
+ SetWallpaperIndex(*static_cast<String*>(pArgs->GetAt(0)));
+ delete pArgs;
+ AppLogDebug("Screen Mode[%d] ( home::0 / Lock::1 )", GetWallpaperIndex());
+
+ CreateHeader(GetTitleText());
+ CreateFooter();
+ CreateTableView();
+ AppLogDebug("ENTER");
+
+ __pTableView->UpdateTableView();
+ }
+ else
+ {
+ AppLogDebug("pArgs Null");
+ }
+}
+
+void
+HomeAndLockScreenForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+void
+HomeAndLockScreenForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+}
+
+int
+HomeAndLockScreenForm::GetGroupCount(void)
+{
+ AppLogDebug("ENTER");
+ return ID_GROUP_COUNT;
+}
+
+int
+HomeAndLockScreenForm::GetItemCount(int groupIndex)
+{
+ int itemCount = ID_GROUP_MAX_ITEM_COUNT;
+
+ AppLogDebug("GetItemCount %d", itemCount);
+
+ return itemCount;
+}
+
+TableViewGroupItem*
+HomeAndLockScreenForm::CreateGroupItem(int groupIndex, int itemWidth)
+{
+ AppLogDebug("ENTER");
+
+ int itemHeight = H_GROUP_INDEX_DEFAULT;;
+ int yItemOffset = 0;
+ Rectangle itemRectangle;
+ String groupText;
+ Label* pLabel = null;
+
+ groupText = GetGroupText(groupIndex);
+
+ itemRectangle.x = X_GROUP_ITEM_DEFAULT_LABEL;
+ itemRectangle.y = yItemOffset;
+ itemRectangle.width = itemWidth;
+ itemRectangle.height = itemHeight;
+
+ TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
+
+ 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_BOTTOM);
+ pLabel->SetTextConfig(FONT_SIZE_GROUP_TITLE_TEXT, LABEL_TEXT_STYLE_BOLD);
+ 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*
+HomeAndLockScreenForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
+{
+ AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
+
+ Rectangle itemRectangle;
+ Rectangle subItemRectangle;
+ TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
+ String itemText;
+ String secondLineText;
+ String fontReturnValue;
+ Label* pLabel = null;
+ int itemHeight = 0;
+ int fontSize = GetFontSize();
+
+ itemText = GetGroupItemText(groupIndex);
+
+ ItemTypeOneLine(itemRectangle);
+ itemHeight = itemRectangle.height;
+
+ if (groupIndex == ID_GROUP_SCREEN_TYPE)
+ {
+ secondLineText = GetGroupItemSelectedText();
+ ItemTypeTwoLine(itemRectangle, subItemRectangle, fontSize);
+ itemHeight = itemRectangle.height + subItemRectangle.height;
+ }
+
+ 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(itemRectangle, itemText);
+ pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
+ pLabel->SetTextColor(COLOR_MAIN_TEXT);
+
+ pItem->AddControl(*pLabel);
+
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
+
+ if (groupIndex == ID_GROUP_SCREEN_TYPE)
+ {
+ pLabel = new (std::nothrow) Label();
+ pLabel->Construct(subItemRectangle, secondLineText);
+ pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
+ pLabel->SetTextColor(COLOR_SUB_TEXT);
+
+ pItem->AddControl(*pLabel);
+
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+ relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
+ }
+ return pItem;
+}
+
+bool
+HomeAndLockScreenForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
+{
+ AppLogDebug("ENTER");
+
+ delete pItem;
+ pItem = null;
+
+ return true;
+}
+
+bool
+HomeAndLockScreenForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
+{
+ AppLogDebug("ENTER");
+
+ delete pItem;
+ pItem = null;
+
+ return true;
+}
+
+void
+HomeAndLockScreenForm::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 = 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(Integer::ToString(GetWallpaperIndex()))));
+
+ const wchar_t* pSceneName;
+ if (groupIndex == ID_GROUP_SCREEN_WALLPAPER)
+ {
+ pSceneName = IDSCN_WALLPAPER_ALBUM_LIST;
+ }
+ else
+ {
+ pSceneName = IDSCN_SCREEN_TYPE;
+ }
+
+ if (pSceneName != null)
+ {
+ pSceneManager->GoForward(ForwardSceneTransition(pSceneName, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
+ }
+}
+
+int
+HomeAndLockScreenForm::GetDefaultGroupItemHeight(void)
+{
+ return H_GROUP_INDEX_NO_TITLE_DEFAULT;
+}
+
+int
+HomeAndLockScreenForm::GetDefaultItemHeight(void)
+{
+ return H_GROUP_ITEM_DEFAULT;
+}
+
+void
+HomeAndLockScreenForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
+{
+}
+
+void
+HomeAndLockScreenForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
+{
+ Invalidate(true);
+}
+
+void
+HomeAndLockScreenForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
+{
+}
+
+void
+HomeAndLockScreenForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
+{
+}
+
+void
+HomeAndLockScreenForm::SetWallpaperIndex(Tizen::Base::String& whitchOne)
+{
+ Integer::Parse(whitchOne, __wallpaperIndex);
+}
+
+int
+HomeAndLockScreenForm::GetWallpaperIndex(void)
+{
+ return __wallpaperIndex;
+}
+
+Tizen::Base::String
+HomeAndLockScreenForm::GetTitleText(void)
+{
+ String headerText;
+
+ switch (GetWallpaperIndex())
+ {
+ case ID_INDEX_HOME_SCREEN_WALLPAPER:
+ {
+ headerText = ResourceManager::GetString(L"IDS_ST_HEADER_HOME_SCREEN");
+ }
+ break;
+
+ case ID_INDEX_LOCK_SCREEN_WALLPAPER:
+ {
+ headerText = ResourceManager::GetString(L"IDS_ST_BODY_LOCK_SCREEN");
+ }
+ break;
+ }
+
+ return headerText;
+}
+
+Tizen::Base::String
+HomeAndLockScreenForm::GetGroupText(int groupIndex)
+{
+ String groupText;
+
+ switch (groupIndex)
+ {
+ case ID_GROUP_SCREEN_TYPE:
+ {
+ if (GetWallpaperIndex())
+ {
+ groupText = ResourceManager::GetString(L"IDS_ST_BODY_LOCK_SCREEN");
+ }
+ else
+ {
+ groupText = ResourceManager::GetString(L"IDS_ST_HEADER_HOME_SCREEN");
+ }
+ }
+ break;
+
+ case ID_GROUP_SCREEN_WALLPAPER:
+ {
+ groupText = ResourceManager::GetString(L"IDS_ST_BODY_MAINDISPLAY_WALLPAPER");
+ }
+ break;
+ }
+
+ return groupText;
+}
+
+Tizen::Base::String
+HomeAndLockScreenForm::GetGroupItemText(int groupIndex)
+{
+ String itemText;
+
+ switch (groupIndex)
+ {
+ case ID_GROUP_SCREEN_TYPE:
+ {
+ if (GetWallpaperIndex())
+ {
+ itemText = L"Lock screen type";
+ }
+ else
+ {
+ itemText = L"Home screen type";
+ }
+ }
+ break;
+
+ case ID_GROUP_SCREEN_WALLPAPER:
+ {
+ if (GetWallpaperIndex())
+ {
+ itemText = L"Lock screen wallpaper";
+ }
+ else
+ {
+ itemText = L"Home screen wallpaper";
+ }
+ }
+ break;
+ }
+
+ return itemText;
+}
+
+Tizen::Base::String
+HomeAndLockScreenForm::GetGroupItemSelectedText(void)
+{
+ String itemText;
+ String screenType;
+ String applicationId;
+
+ if (GetWallpaperIndex() == 0)
+ {
+ screenType = SETTING_INFO_KEY_SCREEN_TYPE_HOME;
+ }
+ else
+ {
+ screenType = SETTING_INFO_KEY_SCREEN_TYPE_LOCK;
+ }
+
+ result r = SettingInfo::GetValue(screenType, applicationId);
+ if (IsFailed(r))
+ {
+ AppLogDebug("GetValue(screenType , ..) fail [%s]", GetErrorMessage(r));
+ }
+ AppLogTag("hwkim","app[%ls]", applicationId.GetPointer());
+
+ itemText = applicationId;
+
+ if (applicationId.Equals(L"org.tizen.menu-screen", false))
+ {
+ if (GetWallpaperIndex() == 0)
+ {
+ itemText = L"Default HomeScreen";
+ }
+ }
+ else
+ {
+ itemText = L"Default LockScreen";
+ }
+
+ return itemText;
+}
pSceneManager->RegisterScene(IDSCN_CERTIFICATE_USER_UNINSTALL, IDC_FORM_CERTIFICATE_USER_UNINSTALL, L"");
pSceneManager->RegisterScene(IDSCN_CERTIFICATE_USER_INSTALL_PASSWORD, IDC_FORM_CERTIFICATE_USER_INSTALL_PASSWORD, L"");
pSceneManager->RegisterScene(IDSCN_SCREEN_LOCK_TYPE, IDC_FORM_SCREEN_LOCK_TYPE, L"");
- pSceneManager->RegisterScene(IDSCN_LOCK_SCREEN, IDC_FORM_LOCK_SCREEN, L"");
+ pSceneManager->RegisterScene(IDSCN_SCREEN_TYPE, IDC_FORM_SCREEN_TYPE, L"");
pSceneManager->RegisterScene(IDSCN_SCREEN_MODE, IDC_FORM_SCREEN_MODE, L"");
pSceneManager->RegisterScene(IDSCN_MANAGE_APPLICATION, IDC_FORM_MANAGE_APPLICATION, L"");
pSceneManager->RegisterScene(IDSCN_MANAGE_APPLICATION_INFO, IDC_FORM_MANAGE_APPLICATION_INFO, L"");
{
case ID_ITEM_PERSONAL_HOME_SCREEN:
{
- pScene = IDSCN_WALLPAPER_ALBUM_LIST;
+ pScene = IDSCN_HOME_AND_LOCK_SCREEN;
}
break;
case ID_ITEM_PERSONAL_LOCK_SCREEN:
{
- pScene = IDSCN_WALLPAPER_ALBUM_LIST;
+ pScene = IDSCN_HOME_AND_LOCK_SCREEN;
}
break;
--- /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 StScreenTypeForm.cpp
+ * @brief This is the implementation file for ScreenTypeForm class.
+ */
+
+#include "StScreenTypeForm.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::Graphics;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+static const int ID_GROUP_COUNT = 1;
+static const int ID_GROUP_MAX_ITEM_COUNT = 1;
+static const int ID_INDEX_HOME_SCREEN_WALLPAPER = 0;
+static const int ID_INDEX_LOCK_SCREEN_WALLPAPER = 1;
+
+ScreenTypeForm::ScreenTypeForm(void)
+ : __wallpaperIndex(0)
+ , __pPackageAppInfoList(null)
+{
+}
+
+ScreenTypeForm::~ScreenTypeForm(void)
+{
+}
+
+void
+ScreenTypeForm::CreateFooter(void)
+{
+ Footer* pFooter = GetFooter();
+ AppAssert(pFooter);
+
+ pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+ pFooter->SetBackButton();
+ pFooter->AddActionEventListener(*this);
+
+ SetFormBackEventListener(this);
+}
+
+result
+ScreenTypeForm::OnInitializing(void)
+{
+ result r = InitPackageInfoList();
+ if (IsFailed(r))
+ {
+ AppLogDebug("InitPackageInfoList fail");
+ return r;
+ }
+ return E_SUCCESS;
+}
+
+result
+ScreenTypeForm::OnTerminating(void)
+{
+ RemovePackageInfoList();
+ __pTableView = null;
+
+ SetFormBackEventListener(null);
+ return E_SUCCESS;
+}
+
+void
+ScreenTypeForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+ if (pArgs != null)
+ {
+ SetWallpaperIndex(*static_cast<String*>(pArgs->GetAt(0)));
+ delete pArgs;
+ AppLogDebug("Screen Mode[%d] ( home::0 / Lock::1 )", GetWallpaperIndex());
+
+ CreateHeader(GetTitleText());
+ CreateFooter();
+ CreateTableView();
+ AppLogDebug("ENTER");
+
+ __pTableView->UpdateTableView();
+ __pTableView->SetItemChecked(0, 0, true);
+ }
+ else
+ {
+ AppLogDebug("pArgs Null");
+ }
+}
+
+void
+ScreenTypeForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+}
+
+void
+ScreenTypeForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+}
+
+int
+ScreenTypeForm::GetGroupCount(void)
+{
+ AppLogDebug("ENTER");
+
+ return ID_GROUP_COUNT;
+}
+
+int
+ScreenTypeForm::GetItemCount(int groupIndex)
+{
+ int itemCount = GetPackageAppInfoListCount();
+
+ AppLogDebug("GetItemCount %d", itemCount);
+
+ return itemCount;
+}
+
+TableViewGroupItem*
+ScreenTypeForm::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*
+ScreenTypeForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
+{
+ AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
+
+ Rectangle itemRectangle;
+ Rectangle itemSecondLineTextRect;
+ TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_RADIO;
+ String itemText = L"";
+ String valueKeyString = L"";
+ String secondLineText;
+ String fontReturnValue;
+ Label* pLabel = null;
+
+ int fontSize = GetFontSize();
+ int itemHeight = H_GROUP_ITEM_DEFAULT;
+
+ itemText = GetItemString(itemIndex);
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+
+ RelativeLayout relativeLayout;
+ relativeLayout.Construct();
+
+ pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight), style);
+ pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
+
+ ItemTypeOneLine(itemRectangle);
+ pLabel = new (std::nothrow) Label();
+ pLabel->Construct(itemRectangle, itemText);
+ pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
+ pLabel->SetTextColor(COLOR_MAIN_TEXT);
+
+ pItem->AddControl(*pLabel);
+ relativeLayout.SetMargin(*pLabel, RELATIVE_LAYOUT_LEFT_MARGIN, 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
+ScreenTypeForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
+{
+ AppLogDebug("ENTER");
+
+ delete pItem;
+ pItem = null;
+
+ return true;
+}
+
+bool
+ScreenTypeForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
+{
+ AppLogDebug("ENTER");
+
+ delete pItem;
+ pItem = null;
+
+ return true;
+}
+
+void
+ScreenTypeForm::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);
+
+ int groupCount = __pTableView->GetItemCountAt(groupIndex);
+
+ for (int index = 0; index < groupCount; index++)
+ {
+ if (index == itemIndex)
+ {
+ tableView.SetItemChecked(groupIndex, index, true);
+ }
+ else
+ {
+ tableView.SetItemChecked(groupIndex, index, false);
+ }
+ }
+
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+
+}
+
+Tizen::Base::String
+ScreenTypeForm::GetTitleText(void)
+{
+ String headerText;
+
+ switch (GetWallpaperIndex())
+ {
+ case ID_INDEX_HOME_SCREEN_WALLPAPER:
+ {
+ headerText = L"Home screen type";
+ }
+ break;
+
+ case ID_INDEX_LOCK_SCREEN_WALLPAPER:
+ {
+ headerText = L"Lock screen type";
+ }
+ break;
+ }
+
+ return headerText;
+}
+
+int
+ScreenTypeForm::GetWallpaperIndex(void)
+{
+ return __wallpaperIndex;
+}
+
+void
+ScreenTypeForm::SetWallpaperIndex(Tizen::Base::String& whitchOne)
+{
+ Integer::Parse(whitchOne, __wallpaperIndex);
+}
+
+int
+ScreenTypeForm::GetDefaultGroupItemHeight(void)
+{
+ return H_GROUP_INDEX_NO_TITLE_DEFAULT;
+}
+
+int
+ScreenTypeForm::GetDefaultItemHeight(void)
+{
+ return H_GROUP_ITEM_DEFAULT;
+}
+
+void
+ScreenTypeForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
+{
+}
+
+void
+ScreenTypeForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
+{
+ Invalidate(true);
+}
+
+void
+ScreenTypeForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
+{
+}
+
+void
+ScreenTypeForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
+{
+}
+
+result
+ScreenTypeForm::InitPackageInfoList(void)
+{
+ String screenType;
+ String applicationId;
+
+ screenType = GetScreenType();
+
+ result r = SettingInfo::GetValue(screenType, applicationId);
+ if (IsFailed(r))
+ {
+ return r;
+ }
+
+ PackageManager* pPackageManager = PackageManager::GetInstance();
+ if (pPackageManager == null)
+ {
+ return E_FAILURE;
+ }
+
+ PackageInfo* pPackageInfo = pPackageManager->GetPackageInfoN(applicationId);
+ if (pPackageInfo == null)
+ {
+ return E_FAILURE;
+ }
+
+ __pPackageAppInfoList = pPackageInfo->GetPackageAppInfoListN();
+ if (__pPackageAppInfoList == null)
+ {
+ return E_FAILURE;
+ }
+
+ return E_SUCCESS;
+}
+
+void
+ScreenTypeForm::RemovePackageInfoList(void)
+{
+ __pPackageAppInfoList = null;
+}
+
+int
+ScreenTypeForm::GetPackageAppInfoListCount(void)
+{
+ return __pPackageAppInfoList->GetCount();
+}
+
+Tizen::Base::String
+ScreenTypeForm::GetScreenType(void)
+{
+ String screenType;
+
+ switch (GetWallpaperIndex())
+ {
+ case ID_INDEX_HOME_SCREEN_WALLPAPER:
+ {
+ screenType = SETTING_INFO_KEY_SCREEN_TYPE_HOME;
+ }
+ break;
+
+ case ID_INDEX_LOCK_SCREEN_WALLPAPER:
+ {
+ screenType = SETTING_INFO_KEY_SCREEN_TYPE_LOCK;
+ }
+ break;
+
+ default:
+ {
+ AppLogDebug("Page index [%d]", GetWallpaperIndex());
+ }
+ break;
+ }
+ return screenType;
+}
+
+Tizen::Base::String
+ScreenTypeForm::GetItemString(int itemIndex)
+{
+ String displayName;
+ String returnValue;
+
+ PackageAppInfo* pPackageAppInfo = static_cast<PackageAppInfo*>(__pPackageAppInfoList->GetAt(itemIndex));
+ if (pPackageAppInfo)
+ {
+ displayName = pPackageAppInfo->GetAppDisplayName();
+
+ if (displayName.IsEmpty() == false)
+ {
+ if (displayName.Equals(L"Menu-screen", false))
+ {
+ if (GetWallpaperIndex() == 0)
+ {
+ returnValue = L"Default home screen";
+ }
+ else
+ {
+ returnValue = L"Default lock screen";
+ }
+ }
+ else
+ {
+ returnValue = displayName;
+ }
+ }
+ }
+
+ return returnValue;
+}
\ No newline at end of file
const wchar_t* SETTING_INFO_KEY_NETWORK_FLIGHTMODE = L"http://tizen.org/setting/network.flight_mode";
const wchar_t* SETTING_INFO_KEY_NETWORK_PACKETSERVICE = L"http://tizen.org/setting/network.telephony.packet_service";
const wchar_t* SETTING_INFO_KEY_NETWORK_ROAMING = L"http://tizen.org/setting/network.telephony.roaming";
+const wchar_t* SETTING_INFO_KEY_SCREEN_TYPE_HOME = L"http://tizen.org/setting/application.home";
+const wchar_t* SETTING_INFO_KEY_SCREEN_TYPE_LOCK = L"http://tizen.org/setting/application.lock";
const wchar_t* SETTING_INFO_KEY_SCREEN_WALLPAPER = L"http://tizen.org/setting/screen.wallpaper";
const wchar_t* SETTING_INFO_KEY_SCREEN_ROTAION_AUTO = L"http://tizen.org/setting/screen.rotation.auto";
const wchar_t* SETTING_INFO_KEY_SCREEN_WALLPAPER_LOCK = L"http://tizen.org/setting/screen.wallpaper.lock";