2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file StMainMenuForm.cpp
19 * @brief This is the implementation file for MainMenuForm class.
22 #include "StBluetoothPresentationModel.h"
23 #include "StMainMenuForm.h"
24 #include "StNfcPresentationModel.h"
25 #include "StResourceManager.h"
26 #include "StSettingScenesList.h"
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::Graphics;
33 using namespace Tizen::Net::Bluetooth;
34 using namespace Tizen::System;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
37 using namespace Tizen::Ui::Scenes;
39 static const int W_RESIZE_LABEL_GAP = 110;
41 static const int H_GROUP_FONT_SIZE_GIANT = 146;
42 static const int H_GROUP_FONT_SIZE_HUGE = 128;
43 static const int H_GROUP_FONT_SIZE_LARGE = 110;
44 static const int H_GROUP_FONT_SIZE_DEFAULT = 80;
45 static const int H_GROUP_TITLE_TEXT = (H_GROUP_INDEX_TITLE_TEXT / 4);
46 static const int MAIN_RELATIVE_LAYOUT_RIGHT_MARGIN = 60;
48 static const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE = L"http://tizen.org/appcontrol/operation/configure";
49 static const wchar_t* APPCONTROL_PROVIDER_ID_PHONE = L"tizen.phone";
50 static const wchar_t* APPCONTROL_PROVIDER_ID_ACCOUNT = L"ZsnYtAdjl2.Account";
52 static const int ID_GROUP_CONNECTIVITY = 0;
53 static const int ID_ITEM_CONNECTIVITY_WIFI = 0;
54 static const int ID_ITEM_CONNECTIVITY_BLUETOOTH = 1;
55 static const int ID_ITEM_CONNECTIVITY_NETWORK = 2;
56 static const int ID_ITEM_CONNECTIVITY_NFC = 3;
57 static const int ID_GROUP_CONNECTIVITY_ITEM_COUNT = 4;
59 static const int ID_GROUP_MODE = 1;
60 static const int ID_ITEM_MODE_FLIGHT_MODE = 0;
61 static const int ID_GROUP_MODE_ITEM_COUNT = 1;
63 static const int ID_GROUP_PERSONAL = 2;
64 static const int ID_ITEM_PERSONAL_HOME_SCREEN = 0;
65 static const int ID_ITEM_PERSONAL_LOCK_SCREEN = 1;
66 static const int ID_ITEM_PERSONAL_ACCOUNTS = 2;
67 static const int ID_ITEM_PERSONAL_PRIVACY = 3;
68 static const int ID_GROUP_PERSONAL_ITEM_COUNT = 4;
70 static const int ID_GROUP_DEVICE = 3;
71 static const int ID_ITEM_DEVICE_DISPLAY = 0;
72 static const int ID_ITEM_DEVICE_SOUND = 1;
73 static const int ID_ITEM_DEVICE_LOCATION = 2;
74 static const int ID_ITEM_DEVICE_CALL_SETTING = 3;
75 static const int ID_ITEM_DEVICE_ACCESSIBILITY = 4;
76 static const int ID_ITEM_DEVICE_DATE_TIME = 5;
77 static const int ID_ITEM_DEVICE_LANGUAGE_KEYBOARD = 6;
78 static const int ID_GROUP_DEVICE_ITEM_COUNT = 7;
80 static const int ID_GROUP_SYSTEM = 4;
81 static const int ID_ITEM_SYSTEM_MANAGE_APPLICATION = 0;
82 static const int ID_ITEM_SYSTEM_DOWNLOADED_APPLICATION = 1;
83 static const int ID_ITEM_SYSTEM_STORAGE = 2;
84 static const int ID_ITEM_SYSTEM_DEVELOPER_OPTION = 3;
85 static const int ID_ITEM_SYSTEM_ABOUT_PHONE = 4;
86 static const int ID_GROUP_SYSTEM_ITEM_COUNT = 5;
88 static const int ID_GROUP_APPSETTING = 5;
89 static const int ID_GROUP_NO_APPSETTING = 4;
90 static const int ID_MAIN_MENU_DEFAULT_COUNT = 1;
91 static const int EMULATOR_DEFAULT_COUNT = 1;
94 IFlightModeSetValueAsyncResultListener::OnResultReceivedForSetValueAsync(const Tizen::Base::String& key, result r)
96 AppLogDebug("key(%ls) r(%s)", key.GetPointer(), GetErrorMessage(r));
100 MainMenuForm* pMainMenuForm = dynamic_cast<MainMenuForm*>(SceneManager::GetInstance()->GetCurrentScene()->GetForm());
103 bool flightModeEnableStatus = false;
104 if (SettingInfo::GetValue(SETTING_INFO_KEY_NETWORK_FLIGHTMODE, flightModeEnableStatus) == E_SUCCESS)
106 pMainMenuForm->__pTableView->SetItemChecked(ID_GROUP_MODE, ID_ITEM_MODE_FLIGHT_MODE, flightModeEnableStatus);
107 pMainMenuForm->__pTableView->RefreshItem(ID_GROUP_MODE, ID_ITEM_MODE_FLIGHT_MODE, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
113 MainMenuForm::MainMenuForm(void)
114 : __currentTableViewList(0)
115 , __isNfcSupported(false)
116 , __isRunningAppControl(false)
117 , __pFlightModeSetValueAsyncResultListener(null)
121 MainMenuForm::~MainMenuForm(void)
126 MainMenuForm::CreateFooter(void)
128 Footer* pFooter = GetFooter();
131 pFooter->AddActionEventListener(*this);
135 MainMenuForm::OnInitializing(void)
137 AppLogDebug("ENTER");
139 CreateHeader(ResourceManager::GetString(L"IDS_COM_BODY_SETTINGS"));
141 __isEmulator = IsEmulator();
143 __isNfcSupported = IsNfcSupported();
144 AddFocusEventListener(*this);
149 MainMenuForm::OnTerminating(void)
152 RemoveFocusEventListener(*this);
153 SetFormBackEventListener(null);
158 MainMenuForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
160 Header* pHeader = GetHeader();
161 pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_SETTINGS"));
163 __pTableView->UpdateTableView();
165 bool flightModeEnableStatus = false;
166 if (SettingInfo::GetValue(SETTING_INFO_KEY_NETWORK_FLIGHTMODE, flightModeEnableStatus) == E_SUCCESS)
168 __pTableView->SetItemChecked(ID_GROUP_MODE, ID_ITEM_MODE_FLIGHT_MODE, flightModeEnableStatus);
173 MainMenuForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
178 MainMenuForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
180 if (__isRunningAppControl)
182 AppLogDebug("busy status");
186 UiApp* pApp = UiApp::GetInstance();
192 MainMenuForm::GetGroupCount(void)
194 int groupItemCount = ID_GROUP_NO_APPSETTING;
196 if (__isEmulator == false)
198 groupItemCount += ID_MAIN_MENU_DEFAULT_COUNT;
201 return groupItemCount;
205 MainMenuForm::GetItemCount(int groupIndex)
207 AppLogDebug("ENTER");
209 if ((__isEmulator == true)
210 && (groupIndex >= ID_GROUP_MODE))
212 groupIndex += EMULATOR_DEFAULT_COUNT;
219 case ID_GROUP_CONNECTIVITY:
221 itemCount = ID_GROUP_CONNECTIVITY_ITEM_COUNT;
227 itemCount = ID_GROUP_MODE_ITEM_COUNT;
231 case ID_GROUP_DEVICE:
233 itemCount = ID_GROUP_DEVICE_ITEM_COUNT;
237 case ID_GROUP_PERSONAL:
239 itemCount = ID_GROUP_PERSONAL_ITEM_COUNT;
243 case ID_GROUP_SYSTEM:
245 itemCount = ID_GROUP_SYSTEM_ITEM_COUNT;
249 case ID_GROUP_APPSETTING:
251 itemCount = ID_MAIN_MENU_DEFAULT_COUNT;
263 MainMenuForm::CreateGroupItem(int groupIndex, int itemWidth)
265 AppLogDebug("ENTER");
267 int itemHeight = H_GROUP_INDEX_DEFAULT;
268 LabelTextStyle style = LABEL_TEXT_STYLE_BOLD;
269 Rectangle itemRectangle;
271 Label* pLabel = null;
272 int fontSize = GetFontSize();
274 if ((__isEmulator == true)
275 && (groupIndex >= ID_GROUP_MODE))
277 groupIndex += EMULATOR_DEFAULT_COUNT;
282 case ID_GROUP_CONNECTIVITY:
284 groupText = ResourceManager::GetString(L"IDS_ST_BODY_CONNECTIVITY");
290 groupText = ResourceManager::GetString(L"IDS_ST_BODY_MODE");
294 case ID_GROUP_PERSONAL:
296 groupText = ResourceManager::GetString(L"IDS_ST_BODY_PERSONAL");
300 case ID_GROUP_DEVICE:
302 groupText = ResourceManager::GetString(L"IDS_ST_BODY_DEVICE");
306 case ID_GROUP_SYSTEM:
308 groupText = ResourceManager::GetString(L"IDS_ST_BODY_SYSTEM");
312 case ID_GROUP_APPSETTING:
314 groupText = ResourceManager::GetString(L"IDS_ST_BODY_DOWNLOADED_APPLICATIONS");
322 TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
324 itemRectangle.x = X_GROUP_ITEM_DEFAULT_LABEL;
325 itemRectangle.y = H_GROUP_TITLE_TEXT;
326 itemRectangle.width = itemWidth - itemRectangle.x;
328 if (fontSize == FONT_MAIN_TEXT_SIZE_GIANT)
330 itemHeight = itemRectangle.height = H_GROUP_FONT_SIZE_GIANT;
332 else if (fontSize == FONT_MAIN_TEXT_SIZE_HUGE)
334 itemHeight = itemRectangle.height = H_GROUP_FONT_SIZE_HUGE;
336 else if (fontSize == FONT_MAIN_TEXT_SIZE_LARGE)
338 itemHeight = itemRectangle.height = H_GROUP_FONT_SIZE_LARGE;
342 itemHeight = itemRectangle.height = H_GROUP_FONT_SIZE_DEFAULT;
345 RelativeLayout relativeLayout;
346 relativeLayout.Construct();
348 pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight));
349 pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT);
351 pLabel = new (std::nothrow) Label();
352 pLabel->Construct(itemRectangle, groupText);
353 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
354 pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
355 pLabel->SetTextConfig(fontSize, style);
356 pLabel->SetTextColor(COLOR_GROUP_TITLE_TEXT);
358 pItem->AddControl(pLabel);
359 relativeLayout.SetMargin(*pLabel, itemRectangle.x, 0, 0, 0);
360 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
361 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
362 pItem->SetEnabled(false);
368 MainMenuForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
370 AppLogDebug("group[%d] item[%d]", groupIndex, itemIndex);
372 if ((__isEmulator == true)
373 && (groupIndex >= ID_GROUP_MODE))
375 groupIndex += EMULATOR_DEFAULT_COUNT;
378 int fontSize = GetFontSize();
380 unsigned int itemHeight = 0;
381 bool isDrawBitmapIcon = true;
382 Rectangle itemIconRectangle;
383 Rectangle itemMainRectangle;
384 Rectangle itemSubRectangle;
386 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
387 Bitmap* pBitmap = null;
388 Label* pLabel = null;
390 ItemTypeIconAndOneLine(itemIconRectangle, itemMainRectangle);
391 itemHeight = itemMainRectangle.height;
395 case ID_GROUP_CONNECTIVITY:
399 case ID_ITEM_CONNECTIVITY_WIFI:
407 pBitmap = ResourceManager::GetBitmapN(IDB_WIFI);
408 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_WI_FI");
413 case ID_ITEM_CONNECTIVITY_BLUETOOTH:
421 ItemTypeIconAndOneLine(itemIconRectangle, itemMainRectangle);
422 itemHeight = itemMainRectangle.height;
424 pBitmap = ResourceManager::GetBitmapN(IDB_BLUETOOTH);
425 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_BLUETOOTH");
430 case ID_ITEM_CONNECTIVITY_NETWORK:
432 pBitmap = ResourceManager::GetBitmapN(IDB_NETWORK);
433 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_NETWORK");
437 case ID_ITEM_CONNECTIVITY_NFC:
439 if (!__isNfcSupported)
445 ItemTypeIconAndOneLine(itemIconRectangle, itemMainRectangle);
446 itemHeight = (itemMainRectangle.height + itemSubRectangle.height);
448 pBitmap = ResourceManager::GetBitmapN(IDB_NFC);
449 itemMainText = ResourceManager::GetString(L"IDS_NFC_BODY_NFC");
462 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
463 itemMainRectangle.width -= W_RESIZE_LABEL_GAP;
464 pBitmap = ResourceManager::GetBitmapN(IDB_FLIGHT_MODE);
465 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_FLIGHT_MODE");
469 case ID_GROUP_PERSONAL:
473 case ID_ITEM_PERSONAL_HOME_SCREEN:
475 pBitmap = ResourceManager::GetBitmapN(IDB_HOME_SCREEN);
476 itemMainText = ResourceManager::GetString(L"IDS_ST_HEADER_HOME_SCREEN");
480 case ID_ITEM_PERSONAL_LOCK_SCREEN:
482 pBitmap = ResourceManager::GetBitmapN(IDB_LOCK_SCREEN);
483 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_LOCK_SCREEN");
487 case ID_ITEM_PERSONAL_ACCOUNTS:
489 pBitmap = ResourceManager::GetBitmapN(IDB_ACCOUNTS);
490 itemMainText = ResourceManager::GetString(L"IDS_COM_BODY_ACCOUNTS");
494 case ID_ITEM_PERSONAL_PRIVACY:
496 pBitmap = ResourceManager::GetBitmapN(IDB_PRIVACY);
497 itemMainText = ResourceManager::GetString(L"IDS_COM_BODY_PRIVACY");
507 case ID_GROUP_DEVICE:
511 case ID_ITEM_DEVICE_DISPLAY:
513 pBitmap = ResourceManager::GetBitmapN(IDB_DISPLAY);
514 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_DISPLAY");
518 case ID_ITEM_DEVICE_SOUND:
520 pBitmap = ResourceManager::GetBitmapN(IDB_SOUND);
521 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_SOUNDS");
525 case ID_ITEM_DEVICE_LOCATION:
527 pBitmap = ResourceManager::GetBitmapN(IDB_LOCATION);
528 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_LOCATIONS");
532 case ID_ITEM_DEVICE_CALL_SETTING:
534 pBitmap = ResourceManager::GetBitmapN(IDB_PHONE);
535 itemMainText = ResourceManager::GetString(L"IDS_CST_BODY_CALL_SETTINGS");
539 case ID_ITEM_DEVICE_ACCESSIBILITY:
541 pBitmap = ResourceManager::GetBitmapN(IDB_ACCESSIBILITY);
542 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_ACCESSIBILITY");
546 case ID_ITEM_DEVICE_DATE_TIME:
548 pBitmap = ResourceManager::GetBitmapN(IDB_DATE_AND_TIME);
549 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_DATE_AND_TIME");
553 case ID_ITEM_DEVICE_LANGUAGE_KEYBOARD:
555 pBitmap = ResourceManager::GetBitmapN(IDB_LANGUAGE_KEYBOARD);
556 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_LANGUAGE_AND_KEYBOARD");
566 case ID_GROUP_SYSTEM:
570 case ID_ITEM_SYSTEM_MANAGE_APPLICATION:
572 pBitmap = ResourceManager::GetBitmapN(IDB_MANAGE_APPLICATION);
573 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_MANAGE_APPLICATIONS");
577 case ID_ITEM_SYSTEM_DOWNLOADED_APPLICATION:
579 pBitmap = ResourceManager::GetBitmapN(IDB_DEFAULT_ICON);
580 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_DOWNLOADED_APPLICATIONS");
584 case ID_ITEM_SYSTEM_STORAGE:
586 pBitmap = ResourceManager::GetBitmapN(IDB_STORAGE);
587 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_STORAGE");
591 case ID_ITEM_SYSTEM_DEVELOPER_OPTION:
599 pBitmap = ResourceManager::GetBitmapN(IDB_DEVELOPER_OPTION);
600 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_DEVELOPER_OPTIONS");
605 case ID_ITEM_SYSTEM_ABOUT_PHONE:
607 pBitmap = ResourceManager::GetBitmapN(IDB_ABOUT_PHONE);
608 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_ABOUT_PHONE");
622 TableViewItem* pItem = new (std::nothrow) TableViewItem();
626 RelativeLayout relativeLayout;
627 relativeLayout.Construct();
629 pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight), style);
630 pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
632 if (isDrawBitmapIcon)
634 pLabel = new (std::nothrow) Label();
635 pLabel->Construct(itemIconRectangle, L"");
636 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
637 pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
638 pLabel->SetBackgroundBitmap(*pBitmap);
640 pItem->AddControl(pLabel);
643 pLabel = new (std::nothrow) Label();
644 pLabel->Construct(itemMainRectangle, itemMainText);
645 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
646 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
647 pLabel->SetTextColor(COLOR_MAIN_TEXT);
649 pItem->AddControl(pLabel);
650 if (style == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING)
652 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN_ONOFF_SLIDING, 0, 0);
656 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, MAIN_RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
658 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
659 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
663 pItem->SetShowState(false);
664 pItem->SetEnabled(false);
677 MainMenuForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
679 AppLogDebug("ENTER");
688 MainMenuForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
690 AppLogDebug("ENTER");
699 MainMenuForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
701 if (__isRunningAppControl)
703 AppLogDebug("busy status");
707 SceneManager* pSceneManager = SceneManager::GetInstance();
708 AppAssert(pSceneManager);
710 if ((__isEmulator == true)
711 && (groupIndex >= ID_GROUP_MODE))
713 groupIndex += EMULATOR_DEFAULT_COUNT;
715 ArrayList* pArgs = null;
716 const wchar_t* pSceneName = null;
718 AppLogDebug("Group(%d) index(%d)", groupIndex, itemIndex);
722 case ID_GROUP_CONNECTIVITY:
724 pSceneName = GroupConnectivitySceneConnect(__currentTableViewList, itemIndex, status);
726 AppControl* pAppControl = null;
728 if (pSceneName == IDSCN_WIFI)
730 pAppControl = AppManager::GetInstance()->FindAppControlN(L"wifi-efl-ug", L"");
732 else if (pSceneName == IDSCN_BLUETOOTH)
734 pAppControl = AppManager::GetInstance()->FindAppControlN(L"ug-bluetooth-efl", L"");
739 AppLog("pAppControl is not null");
740 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
741 pExtraData->Construct();
743 pExtraData->Add(new (std::nothrow) String(L"caller"), new (std::nothrow) String(L"osp-setting"));
745 if (pAppControl->Start(null, null, pExtraData, null) == E_SUCCESS)
747 __isRunningAppControl = true;
759 if (itemIndex == ID_ITEM_MODE_FLIGHT_MODE)
761 bool flightModeStatus = tableView.IsItemChecked(groupIndex, itemIndex);
762 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
764 flightModeStatus = (!(flightModeStatus));
767 SetIFlightModeSetValueAsyncResultListener();
768 if (SettingInfo::SetValueAsyncForPrivilegedKey(SETTING_INFO_KEY_NETWORK_FLIGHTMODE, flightModeStatus, __pFlightModeSetValueAsyncResultListener) == E_SUCCESS)
770 tableView.SetItemChecked(groupIndex, itemIndex, flightModeStatus);
771 AppLogDebug("flightmode(%d) GetLastResult(%s)", flightModeStatus, GetErrorMessage(GetLastResult()));
775 AppLogDebug("flightmode(%d) GetLastResult(%s)", flightModeStatus, GetErrorMessage(GetLastResult()));
781 case ID_GROUP_PERSONAL:
783 pSceneName = GroupPersonalSceneConnect(__currentTableViewList, itemIndex, status);
785 if ((itemIndex != ID_ITEM_PERSONAL_HOME_SCREEN)
786 && (itemIndex != ID_ITEM_PERSONAL_LOCK_SCREEN))
791 pArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
794 AppLogDebug("pArgs is null");
798 result r = pArgs->Construct();
801 AppLogDebug("Construct fail [%s]", GetErrorMessage(r));
807 case ID_ITEM_PERSONAL_HOME_SCREEN:
809 pArgs->Add(new (std::nothrow) String(Integer::ToString(itemIndex)));
813 case ID_ITEM_PERSONAL_LOCK_SCREEN:
815 pArgs->Add(new (std::nothrow) String(Integer::ToString(itemIndex)));
822 case ID_GROUP_DEVICE:
824 pSceneName = GroupDeviceSceneConnect(__currentTableViewList, itemIndex, status);
828 case ID_GROUP_SYSTEM:
830 pSceneName = GroupSystemSceneConnect(__currentTableViewList, itemIndex, status);
838 AppLog("pAppControl is null");
839 if (pSceneName != IDSCN_NULL)
841 AppLogDebug("pSceneName[%ls]", pSceneName);
842 pSceneManager->GoForward(ForwardSceneTransition(pSceneName, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
847 MainMenuForm::GroupConnectivitySceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status)
849 const wchar_t* pScene = null;
853 case ID_ITEM_CONNECTIVITY_WIFI:
855 // if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
862 case ID_ITEM_CONNECTIVITY_BLUETOOTH:
864 // if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
866 pScene = IDSCN_BLUETOOTH;
871 case ID_ITEM_CONNECTIVITY_NETWORK:
873 pScene = IDSCN_NETWORK;
877 case ID_ITEM_CONNECTIVITY_NFC:
894 MainMenuForm::GroupPersonalSceneConnect (int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status)
896 const wchar_t* pScene = null;
900 case ID_ITEM_PERSONAL_HOME_SCREEN:
902 pScene = IDSCN_HOME_AND_LOCK_SCREEN;
906 case ID_ITEM_PERSONAL_LOCK_SCREEN:
908 pScene = IDSCN_HOME_AND_LOCK_SCREEN;
912 case ID_ITEM_PERSONAL_ACCOUNTS:
916 FindAppControlScene(itemIndex);
920 case ID_ITEM_PERSONAL_PRIVACY:
922 pScene = IDSCN_PRIVACY;
936 MainMenuForm::GroupDeviceSceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status)
938 const wchar_t* pScene = null;
942 case ID_ITEM_DEVICE_DISPLAY:
944 pScene = IDSCN_DISPLAY;
948 case ID_ITEM_DEVICE_SOUND:
950 pScene = IDSCN_SOUNDS;
954 case ID_ITEM_DEVICE_LOCATION:
956 pScene = IDSCN_LOCATION;
960 case ID_ITEM_DEVICE_CALL_SETTING:
964 FindAppControlScene(itemIndex);
968 case ID_ITEM_DEVICE_ACCESSIBILITY:
970 pScene = IDSCN_ACCESSIBILITY;
974 case ID_ITEM_DEVICE_DATE_TIME:
976 pScene = IDSCN_DATE_TIME;
980 case ID_ITEM_DEVICE_LANGUAGE_KEYBOARD:
982 pScene = IDSCN_LOCALE;
996 MainMenuForm::GroupSystemSceneConnect(int viewMode, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status)
998 const wchar_t* pScene = null;
1002 case ID_ITEM_SYSTEM_MANAGE_APPLICATION:
1004 pScene = IDSCN_MANAGE_APPLICATION;
1008 case ID_ITEM_SYSTEM_DOWNLOADED_APPLICATION:
1010 pScene = IDSCN_DOWNLOADED_APPLICATION;
1014 case ID_ITEM_SYSTEM_STORAGE:
1016 pScene = IDSCN_MEMORY_STATUS;
1020 case ID_ITEM_SYSTEM_DEVELOPER_OPTION:
1022 pScene = IDSCN_DEVELOPER_OPTION;
1026 case ID_ITEM_SYSTEM_ABOUT_PHONE:
1028 pScene = IDSCN_PHONE_INFO;
1034 pScene = IDSCN_NULL;
1042 MainMenuForm::IsEmulator(void)
1045 if (SystemInfo::GetValue(SYSTEM_INFO_KEY_MODELNAME, modelName) != E_SUCCESS)
1047 AppLogDebug("GetValue is error %s", GetErrorMessage(GetLastResult()));
1051 return modelName.Equals(L"Emulator", false);
1055 MainMenuForm::IsNfcSupported(void)
1057 bool isNfcSupported = false;
1058 if (SystemInfo::GetValue(SYSTEM_INFO_KEY_NFC, isNfcSupported) != E_SUCCESS)
1060 AppLogDebug("GetValue is error %s", GetErrorMessage(GetLastResult()));
1063 AppLog("isNfcSupported = %d", isNfcSupported);
1064 return isNfcSupported;
1068 MainMenuForm::FindAppControlScene(int itemIndex)
1070 if (__isRunningAppControl)
1072 AppLogDebug("busy status");
1077 String operationId = APPCONTROL_OPERATION_ID_CONFIGURE;
1079 ArrayList* pDataList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1081 pDataList->Construct();
1085 case ID_ITEM_PERSONAL_ACCOUNTS:
1087 providerId = APPCONTROL_PROVIDER_ID_ACCOUNT;
1091 case ID_ITEM_DEVICE_CALL_SETTING:
1093 providerId = APPCONTROL_PROVIDER_ID_PHONE;
1101 if (providerId != L"")
1103 AppControl* pAppControl = AppManager::FindAppControlN(providerId, operationId);
1107 if (pAppControl->Start(pDataList, null) == E_SUCCESS)
1110 __isRunningAppControl = true;
1121 MainMenuForm::GetDefaultGroupItemHeight(void)
1123 return H_GROUP_INDEX_NO_TITLE_DEFAULT;
1127 MainMenuForm::GetDefaultItemHeight(void)
1129 return H_GROUP_ITEM_DEFAULT;
1133 MainMenuForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
1138 MainMenuForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
1143 MainMenuForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
1148 MainMenuForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
1153 MainMenuForm::OnResultReceivedForSetValueAsync(const Tizen::Base::String& key, result r)
1155 AppLogDebug("ENTER");
1159 MainMenuForm::SetIFlightModeSetValueAsyncResultListener(void)
1161 __pFlightModeSetValueAsyncResultListener = new (std::nothrow) IFlightModeSetValueAsyncResultListener();
1165 MainMenuForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
1171 MainMenuForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
1173 if (requestId == REFRESH_REQUEST_EVENT)
1176 __isRunningAppControl = false;
1181 MainMenuForm::OnFocusLost(const Tizen::Ui::Control& source)
1187 MainMenuForm::OnFocusGained(const Tizen::Ui::Control& source)
1190 __isRunningAppControl = false;