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.
17 //!Internet SettingForm class
18 /*@file: IntSettingForm.cpp
19 *@brief: The SettingForm
23 #include <FGraphics.h>
26 #include "IntCommonLib.h"
27 #include "IntConfirmationPopup.h"
28 #include "IntDefaultCustomItem.h"
29 #include "IntDropDownCustomItem.h"
30 #include "IntHistoryPresentationModel.h"
31 #include "IntInternetApp.h"
32 #include "IntMultipleWindowPresentationModel.h"
33 #include "IntNotificationPanel.h"
34 #include "IntRadioCustomItem.h"
35 #include "IntSceneRegister.h"
36 #include "IntSettingForm.h"
37 #include "IntSettingPresentationModel.h"
38 #include "IntSettingToggleCustomItem.h"
41 using namespace Tizen::App;
42 using namespace Tizen::Base;
43 using namespace Tizen::Base::Collection;
44 using namespace Tizen::Graphics;
45 using namespace Tizen::System;
46 using namespace Tizen::Ui;
47 using namespace Tizen::Ui::Controls;
48 using namespace Tizen::Ui::Scenes;
52 SettingForm::SettingForm(void)
53 : __fontValue(0),__pResetPopup(null),__pWindowInfo(null) , __pConfirmationPopup(null),__pNotification(null)
57 InitializeSettingValues();
61 SettingForm::~SettingForm(void)
65 delete[] pGroupItemCount;
66 pGroupItemCount = null;
71 SettingForm::InitializeSettingValues(void)
73 AppLog("SettingForm::InitializeSettingValues homepage %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
75 pGroupItemCount = new(std::nothrow) int[5];
76 pGroupItemCount[0] = 5; //Homepage
77 pGroupItemCount[1] = 6; //Page content settings
78 pGroupItemCount[2] = 9; //Private and Security
79 pGroupItemCount[3] = 4; //Search
80 pGroupItemCount[4] = 1; //Website settings and Reset
82 for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; iter++)
84 settingInfo[iter].isSelected = false;
87 AppLogDebug("image display %d", (int) SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled());
88 settingInfo[SETTING_HOMEPAGE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE");
89 settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
90 settingInfo[SETTING_HOMEPAGE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
92 settingInfo[SETTING_CURRENT_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CURRENT_PAGE");
93 settingInfo[SETTING_CURRENT_PAGE].subText = L"";
94 settingInfo[SETTING_CURRENT_PAGE].itemType = ITEM_TYPE_RADIO;
96 settingInfo[SETTING_BLANK_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLANK_PAGE");
97 settingInfo[SETTING_BLANK_PAGE].subText = L"";
98 settingInfo[SETTING_BLANK_PAGE].itemType = ITEM_TYPE_RADIO;
99 if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
101 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
104 settingInfo[SETTING_MOST_VISITED_SITE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_MOST_VISITED_SITES");
105 settingInfo[SETTING_MOST_VISITED_SITE].subText = L"";
106 settingInfo[SETTING_MOST_VISITED_SITE].itemType = ITEM_TYPE_RADIO;
107 if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
109 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
111 WindowInfo* pWindowInfo = null;
112 String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
113 AppLog("SettingForm::OnSceneActivatedN check1");
115 settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
116 if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
118 SettingPresentationModel::GetInstance()->SetFavoriteValue(L"http://www.tizen.org");
120 settingInfo[SETTING_FAVORITE_URL].subText = L"";
121 settingInfo[SETTING_FAVORITE_URL].itemType = ITEM_TYPE_RADIO;
123 String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
124 if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
126 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
127 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
128 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
129 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
130 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
132 else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
134 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
135 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
136 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
137 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
138 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
142 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
143 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
144 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
145 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
148 settingInfo[SETTING_DEFAULT_VIEW_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_DEFAULT_VIEW");
149 settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText = CommonUtil::GetString(SettingPresentationModel::GetInstance()->GetDefaultView());
150 settingInfo[SETTING_DEFAULT_VIEW_TITLE].itemType = ITEM_TYPE_DROPDOWN;
152 settingInfo[SETTING_FIT_TO_WIDTH].titleText = CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH");
153 settingInfo[SETTING_FIT_TO_WIDTH].subText = L"";
154 settingInfo[SETTING_FIT_TO_WIDTH].itemType = ITEM_TYPE_RADIO;
155 settingInfo[SETTING_FIT_TO_WIDTH].isSelected = !(String::Compare(settingInfo[SETTING_FIT_TO_WIDTH].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
157 settingInfo[SETTING_READABLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_READABLE");
158 settingInfo[SETTING_READABLE].subText = L"";
159 settingInfo[SETTING_READABLE].itemType = ITEM_TYPE_RADIO;
160 settingInfo[SETTING_READABLE].isSelected = !(String::Compare(settingInfo[SETTING_READABLE].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
162 settingInfo[SETTING_RUN_JAVASCRIPT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RUN_JAVASCRIPT");
163 settingInfo[SETTING_RUN_JAVASCRIPT].subText = L"";
164 settingInfo[SETTING_RUN_JAVASCRIPT].itemType = ITEM_TYPE_TOGGLE;
165 settingInfo[SETTING_RUN_JAVASCRIPT].isSelected = SettingPresentationModel::GetInstance()->IsRunJavascriptEnabled();
167 settingInfo[SETTING_DISPLAY_IMAGES].titleText = CommonUtil::GetString(L"IDS_BR_OPT_LOAD_IMAGES");
168 settingInfo[SETTING_DISPLAY_IMAGES].subText = L"";
169 settingInfo[SETTING_DISPLAY_IMAGES].itemType = ITEM_TYPE_TOGGLE;
170 settingInfo[SETTING_DISPLAY_IMAGES].isSelected = SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled();
172 settingInfo[SETTING_BLOCK_POPUP].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLOCK_POP_UPS_ABB");
173 settingInfo[SETTING_BLOCK_POPUP].subText = L"";
174 settingInfo[SETTING_BLOCK_POPUP].itemType = ITEM_TYPE_TOGGLE;
175 settingInfo[SETTING_BLOCK_POPUP].isSelected = !SettingPresentationModel::GetInstance()->IsBlockPopUp();
177 settingInfo[SETTING_CLEAR_CACHE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_CACHE");
178 settingInfo[SETTING_CLEAR_CACHE].subText = L"";
179 settingInfo[SETTING_CLEAR_CACHE].itemType = ITEM_TYPE_NORMAL;
181 settingInfo[SETTING_CLEAR_HISTORY].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_HISTORY");
182 settingInfo[SETTING_CLEAR_HISTORY].subText = L"";
183 settingInfo[SETTING_CLEAR_HISTORY].itemType = ITEM_TYPE_NORMAL;
185 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SHOW_SECURITY_WARNINGS");
186 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].subText = L"";
187 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].itemType = ITEM_TYPE_TOGGLE;
188 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected = SettingPresentationModel::GetInstance()->IsSecurityWarningsEnabled();
190 settingInfo[SETTING_ACCEPT_COOKIES].titleText = CommonUtil::GetString(L"IDS_BR_BODY_ACCEPT_COOKIES");
191 settingInfo[SETTING_ACCEPT_COOKIES].subText = L"";
192 settingInfo[SETTING_ACCEPT_COOKIES].itemType = ITEM_TYPE_TOGGLE;
193 settingInfo[SETTING_ACCEPT_COOKIES].isSelected = SettingPresentationModel::GetInstance()->IsCookiesEnabled();
195 settingInfo[SETTING_CLEAR_COOKIE_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA");
196 settingInfo[SETTING_CLEAR_COOKIE_DATA].subText = CommonUtil::GetString(L"IDS_BR_BODY_COOKIES");
197 settingInfo[SETTING_CLEAR_COOKIE_DATA].itemType = ITEM_TYPE_NORMAL;
199 settingInfo[SETTING_REMEMBER_FORM_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_REMEMBER_FORM_DATA");
200 settingInfo[SETTING_REMEMBER_FORM_DATA].subText = L"";
201 settingInfo[SETTING_REMEMBER_FORM_DATA].itemType = ITEM_TYPE_TOGGLE;
202 settingInfo[SETTING_REMEMBER_FORM_DATA].isSelected = SettingPresentationModel::GetInstance()->IsRememberFormData();
204 settingInfo[SETTING_CLEAR_FORM_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_FORM_DATA");
205 settingInfo[SETTING_CLEAR_FORM_DATA].subText = CommonUtil::GetString(L"IDS_BR_HEADER_FORM_DATA");
206 settingInfo[SETTING_CLEAR_FORM_DATA].itemType = ITEM_TYPE_NORMAL;
208 settingInfo[SETTING_REMEMBER_PASSWORD].titleText = CommonUtil::GetString(L"IDS_BR_BODY_REMEMBER_PASSWORDS");
209 settingInfo[SETTING_REMEMBER_PASSWORD].subText = L"";
210 settingInfo[SETTING_REMEMBER_PASSWORD].itemType = ITEM_TYPE_TOGGLE;
211 settingInfo[SETTING_REMEMBER_PASSWORD].isSelected = SettingPresentationModel::GetInstance()->IsRememberPassword();
214 settingInfo[SETTING_CLEAR_PASSWORDS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_PASSWORDS");
215 settingInfo[SETTING_CLEAR_PASSWORDS].subText = L"";
216 settingInfo[SETTING_CLEAR_PASSWORDS].itemType = ITEM_TYPE_NORMAL;
218 settingInfo[SETTING_SEARCH_ENGINE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH_ENGINE");
219 settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText = SettingPresentationModel::GetInstance()->GetSearchEngine();
220 settingInfo[SETTING_SEARCH_ENGINE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
222 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText = L"Yahoo"; //CommonUtil::GetString(L"IDS_BR_BODY_YAHOO");
223 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].subText = L"";
224 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].itemType = ITEM_TYPE_RADIO;
225 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
227 settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText = L"Naver"; //CommonUtil::GetString(L"IDS_BR_BODY_NAVER");
228 settingInfo[SETTING_SEARCH_ENGINE_NAVER].subText = L"";
229 settingInfo[SETTING_SEARCH_ENGINE_NAVER].itemType = ITEM_TYPE_RADIO;
230 settingInfo[SETTING_SEARCH_ENGINE_NAVER].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
232 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText = L"Google";//CommonUtil::GetString(L"IDS_COM_BODY_GOOGLE");
233 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].subText = L"";
234 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].itemType = ITEM_TYPE_RADIO;
235 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
237 settingInfo[SETTING_RESET_TO_DEFAULT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RESET_TO_DEFAULT");
238 settingInfo[SETTING_RESET_TO_DEFAULT].subText = L"";
239 settingInfo[SETTING_RESET_TO_DEFAULT].itemType = ITEM_TYPE_NORMAL;
243 SettingForm::Initialize(void)
245 result r = E_FAILURE;
247 r = Construct(L"IDL_SETTING_FORM");
256 SettingForm::OnInitializing(void)
258 result r = E_FAILURE;
259 Footer* pFooter = NULL;
260 SceneManager* pSceneManager = NULL;
262 __fontSize = CommonUtil::GetFontSize();
264 bool isHwKeySupported = false;
266 //SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR);
267 __pList = static_cast< GroupedListView* >(GetControl(L"IDC_SETTING_LIST"));
268 if ( __pList != NULL )
271 r = __pList->SetItemProvider(*this);
272 TryCatch(!IsFailed(r),,"setItemProvider failed with error %s",GetErrorMessage(r));
273 __pList->AddGroupedListViewItemEventListener(*this);
276 // pFooter = GetFooter();
279 // AppLogDebug("setting back button");
280 // pFooter->SetBackButtonEnabled(true);
282 SetFormBackEventListener(this);
283 AppLog("SetFormBackEventListener result %s",GetErrorMessage(GetLastResult()));
284 pSceneManager = SceneManager::GetInstance();
285 if (pSceneManager != null)
287 r = pSceneManager->AddSceneEventListener(IDSCN_SETTINGS, *this);
288 TryCatch(!IsFailed(r),,"AddSceneEventListener failed with error %s",GetErrorMessage(r));
290 AddOrientationEventListener(*this);
297 SettingForm::OnGroupedListViewContextItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListContextItemStatus status)
303 SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListItemStatus status)
305 int effectiveIndex = 0;
306 SettingPresentationModel* pSettingMgr = SettingPresentationModel::GetInstance();
308 if (pSettingMgr == null)
311 for (int i = 0; i < groupIndex; i++)
312 effectiveIndex = effectiveIndex + pGroupItemCount[i];
313 effectiveIndex = effectiveIndex + itemIndex;
315 if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
317 AppLogDebug("refreshing data child count is %d", settingInfo[effectiveIndex].childCount);
318 if (settingInfo[effectiveIndex].isOpen == false)
320 settingInfo[effectiveIndex].isOpen = true;
321 settingInfo[effectiveIndex].childCount = 0;
322 for (int iter = effectiveIndex + 1; iter < SETTING_MAX; iter++)
324 if (settingInfo[iter].itemType == ITEM_TYPE_RADIO)
325 settingInfo[effectiveIndex].childCount++;
330 listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
331 for(int iter = 0; iter < settingInfo[effectiveIndex].childCount; iter++)
333 listView.RefreshList(groupIndex, itemIndex + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
336 listView.UpdateList();
340 settingInfo[effectiveIndex].isOpen = false;
342 listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
343 for(int iter = 0; iter < settingInfo[effectiveIndex].childCount; iter++)
345 listView.RefreshList(groupIndex, itemIndex + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
348 listView.UpdateList();
351 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
354 switch (effectiveIndex)
356 case SETTING_CURRENT_PAGE:
357 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
358 AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
359 if (__currentURL.CompareTo(L"") != 0)
361 AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
362 SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
363 SettingPresentationModel::GetInstance()->SetFavoriteValue(__currentURL);
364 settingInfo[SETTING_FAVORITE_URL].titleText = __currentURL;
365 // listView.RefreshList(groupIndex, effectiveIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
366 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
367 // listView.UpdateList();
370 case SETTING_BLANK_PAGE:
371 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_BLANK_PAGE].titleText);
372 SettingPresentationModel::GetInstance()->SetHomepage((L"IDS_BR_BODY_BLANK_PAGE"));
373 AppLog("GetHomepage() %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
374 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
375 // listView.UpdateList();
378 case SETTING_MOST_VISITED_SITE:
379 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
380 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
381 // listView.UpdateList();
384 case SETTING_FAVORITE_URL:
385 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
386 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EDIT_HOMEPAGE_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
389 case SETTING_FIT_TO_WIDTH:
390 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_FIT_TO_WIDTH");
391 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
392 // listView.UpdateList();
395 case SETTING_READABLE:
396 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_READABLE");
397 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
398 // listView.UpdateList();
401 case SETTING_SEARCH_ENGINE_YAHOO:
402 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText);
403 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
404 // listView.UpdateList();
407 case SETTING_SEARCH_ENGINE_NAVER:
408 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText);
409 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
410 // listView.UpdateList();
413 case SETTING_SEARCH_ENGINE_GOOGLE:
414 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText);
415 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
416 // listView.UpdateList();
423 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
425 if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
428 settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText;
430 listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex), LIST_REFRESH_TYPE_ITEM_MODIFY);
431 listView.RefreshList(groupIndex, parentIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
432 for (int iter = 0; iter < settingInfo[parentIndex].childCount; iter++)
434 if (parentIndex + iter + 1 != effectiveIndex)
436 AppLogDebug("long effectiveIndex %d set to false", itemIndex - (effectiveIndex - parentIndex) + iter + 1);
437 settingInfo[parentIndex + iter + 1].isSelected = false;
441 AppLogDebug("effectiveIndex %d set to true", effectiveIndex);
442 settingInfo[effectiveIndex].isSelected = true;
444 if (effectiveIndex == SETTING_CURRENT_PAGE)
446 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
447 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
449 listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
451 // listView.UpdateList();
452 //listView.ScrollToItem(groupIndex, itemIndex, LIST_SCROLL_ITEM_ALIGNMENT_TOP);
455 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
457 if (settingInfo[effectiveIndex].isSelected == true)
459 settingInfo[effectiveIndex].isSelected = false;
463 settingInfo[effectiveIndex].isSelected = true;
465 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
468 __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
472 switch (effectiveIndex)
475 case SETTING_RUN_JAVASCRIPT:
476 SettingPresentationModel::GetInstance()->SetRunJavascriptEnabled(settingInfo[SETTING_RUN_JAVASCRIPT].isSelected);
479 case SETTING_DISPLAY_IMAGES:
480 SettingPresentationModel::GetInstance()->SetDisplayImagesEnabled(settingInfo[SETTING_DISPLAY_IMAGES].isSelected);
483 case SETTING_BLOCK_POPUP:
484 SettingPresentationModel::GetInstance()->SetBlockPopUp(!settingInfo[SETTING_BLOCK_POPUP].isSelected);
487 case SETTING_CLEAR_CACHE:
491 case SETTING_CLEAR_HISTORY:
495 case SETTING_SHOW_SECURITY_WARNINGS:
496 SettingPresentationModel::GetInstance()->SetSecurityWarningsEnabled(settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected);
499 case SETTING_ACCEPT_COOKIES:
500 SettingPresentationModel::GetInstance()->SetCookiesEnabled(settingInfo[SETTING_ACCEPT_COOKIES].isSelected);
503 case SETTING_CLEAR_COOKIE_DATA:
507 case SETTING_REMEMBER_FORM_DATA:
508 SettingPresentationModel::GetInstance()->SetRememberFormData(settingInfo[SETTING_REMEMBER_FORM_DATA].isSelected);
511 case SETTING_CLEAR_FORM_DATA:
515 case SETTING_CLEAR_PASSWORDS:
519 case SETTING_REMEMBER_PASSWORD:
520 SettingPresentationModel::GetInstance()->SetRememberPassword(settingInfo[SETTING_REMEMBER_PASSWORD].isSelected);
524 case SETTING_RESET_TO_DEFAULT:
535 SettingForm::OnGroupedListViewItemSwept(GroupedListView& listView, int groupIndex, int itemIndex, SweepDirection direction)
541 SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
543 result r = E_FAILURE;
545 GroupItem* pItem = null;
546 const Color ITEM_TEXT_COLOR = CUSTOM_COLOR_SETTINGS_GROUPTITLE;
548 pItem = new(std::nothrow) GroupItem();
553 r = pItem->Construct(Dimension(itemWidth, 76));
563 text = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE"); // IDS_HOMEPAGE
564 settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
568 text = CommonUtil::GetString(L"IDS_BR_MBODY_PAGE_CONTENT_SETTINGS"); // IDS_BR_MBODY_PAGE_CONTENT_SETTINGS
572 text = CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"); // IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB
576 text = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH"); // IDS_BR_BODY_SEARCH
581 __pList->SetItemEnabled(groupIndex,-1,false);
588 pItem->SetElement(text, null);
590 AppLogDebug("background color set result %s", GetErrorMessage(r));
592 pItem->SetTextColor(ITEM_TEXT_COLOR);
597 SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
599 AppLog("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d ", groupIndex, itemIndex, itemWidth);
601 result r = E_SUCCESS;
602 int effectiveIndex = 0;
603 const Color ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND;
604 const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
605 const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED;
607 for (int i = 0; i < groupIndex; i++)
608 effectiveIndex = effectiveIndex + pGroupItemCount[i];
609 effectiveIndex = effectiveIndex + itemIndex;
610 AppLogDebug("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
612 if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
614 SettingToggleCustomItem* pItem = new(std::nothrow) SettingToggleCustomItem();
615 r = pItem->Construct(itemWidth, 112 + (__fontSize - 44));
622 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
623 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
624 // if(__pList != null)
626 // __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
629 ArrayList *pList = new(std::nothrow) ArrayList();
631 Integer *pGroupIndex = new Integer(groupIndex);
632 Integer *pItemIndex = new Integer(itemIndex);
633 pList->Add(pGroupIndex);
634 pList->Add(pItemIndex);
635 AppLog("sending event UPDATE_LIST_COMPLETE");
636 SendUserEvent(UPDATE_LIST_COMPLETE,pList);
638 pItem->SetText(settingInfo[effectiveIndex].titleText);
644 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
646 DropDownCustomItem* pItem = new(std::nothrow) DropDownCustomItem();
647 r = pItem->Construct(itemWidth);
654 /* Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,128);
655 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
657 if (pNormalBackgroundBitmap != NULL)
659 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
660 delete pNormalBackgroundBitmap;
663 if (pPressedBackgroundBitmap != NULL)
665 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
666 delete pPressedBackgroundBitmap;
669 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
670 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
672 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
673 if(settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_BLANK_PAGE") == 0 || settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_MOST_VISITED_SITES") == 0 || settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_FIT_TO_WIDTH") == 0 || settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_READABLE") == 0)
675 pItem->SetSubText(CommonUtil::GetString(settingInfo[effectiveIndex].subText));
679 pItem->SetSubText(settingInfo[effectiveIndex].subText);
681 if (settingInfo[effectiveIndex].isOpen)
683 pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
687 pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED);
690 // if (pBitmap != null)
691 // pItem->AddElement(Rectangle(0, 0, 10, 128), IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN, *pBitmap, null);
701 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
703 RadioCustomItem* pItem = new(std::nothrow) RadioCustomItem();
705 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
707 if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
710 if (settingInfo[parentIndex].isOpen == false || (__isCurrentPageDisable == true && groupIndex == 0 && itemIndex == 1))
712 r = pItem->Construct(itemWidth, 0);
713 __pList->SetItemEnabled(groupIndex,itemIndex,false);
714 AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
719 __pList->SetItemEnabled(groupIndex,itemIndex,true);
720 pItem->Construct(itemWidth, 112 + (__fontSize - 44));
723 Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
724 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
726 if (pNormalBackgroundBitmap != NULL)
728 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
729 delete pNormalBackgroundBitmap;
732 if (pPressedBackgroundBitmap != NULL)
734 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
735 delete pPressedBackgroundBitmap;
738 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
739 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
742 pItem->SetText(settingInfo[effectiveIndex].titleText);
743 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
745 //if (pBitmap != null)
746 // pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
748 // pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
749 // __pList->SetItemChecked(groupIndex,itemIndex,settingInfo[effectiveIndex].isSelected);
750 ArrayList *pList = new(std::nothrow) ArrayList();
752 Integer *pGroupIndex = new Integer(groupIndex);
753 Integer *pItemIndex = new Integer(itemIndex);
754 pList->Add(pGroupIndex);
755 pList->Add(pItemIndex);
756 AppLog("sending event UPDATE_LIST_COMPLETE");
757 SendUserEvent(UPDATE_LIST_COMPLETE,pList);
762 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_NORMAL)
764 DefaultCustomItem* pItem = new(std::nothrow) DefaultCustomItem();
766 r = pItem->Construct(itemWidth, 112 + (__fontSize - 44));
774 // Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
775 // Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
777 // if (pNormalBackgroundBitmap != NULL)
779 // pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
780 // delete pNormalBackgroundBitmap;
783 // if (pPressedBackgroundBitmap != NULL)
785 // pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
786 // delete pPressedBackgroundBitmap;
789 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
790 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
793 pItem->SetText(settingInfo[effectiveIndex].titleText);
795 //if (pBitmap != null)
796 // pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
813 SettingForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
821 SettingForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
829 SettingForm::GetGroupCount(void)
835 SettingForm::GetItemCount(int groupIndex)
837 AppLog(" SettingForm::GetItemCount --> groupIndex : %d,", groupIndex);
838 return pGroupItemCount[groupIndex];
842 SettingForm::OnFormBackRequested(Form& source)
844 AppLog("SettingForm::OnFormBackRequested entered");
845 String* pSelectedScene = NULL;
846 Object* value = NULL;
847 MultipleWindowPresentationModel::GetInstance()->GetValue(SELECTED_SCENE_ID, &value);
848 pSelectedScene = (String*) value;
851 SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(*pSelectedScene, SCENE_TRANSITION_ANIMATION_TYPE_NONE));
852 // delete pSelectedScene;
853 // pSelectedScene = null;
858 SettingForm::OnActionPerformed(const Control& source, int actionId)
863 if(__pConfirmationPopup)
865 __pConfirmationPopup->SetShowState(false);
866 __pConfirmationPopup->Show();
867 delete __pConfirmationPopup;
868 __pConfirmationPopup = null;
873 if(__pConfirmationPopup)
875 String message = L"";
876 __pConfirmationPopup->SetShowState(false);
877 __pConfirmationPopup->Show();
878 if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO"))
880 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
881 SettingPresentationModel::GetInstance()->ClearCookie();
883 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_FORM_DATA_Q"))
885 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
886 SettingPresentationModel::GetInstance()->ClearFormData();
888 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_PASSWORDS_Q"))
890 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
891 SettingPresentationModel::GetInstance()->ClearPasswords();
893 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q"))
895 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
896 SettingPresentationModel::GetInstance()->ClearCache();
898 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q"))
900 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
901 HistoryPresentationModel::GetInstance()->ClearHistory();
903 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_ALL_SETTINGS_TO_DEFAULT_CONTINUE_Q"))
905 message = CommonUtil::GetString(L"IDS_BR_SK_DONE");
906 SettingPresentationModel::GetInstance()->ResetRegistry();
907 InitializeSettingValues();
910 __pList->UpdateList();
913 delete __pConfirmationPopup;
914 __pConfirmationPopup = null;
916 if (__pNotification != null)
918 RemoveControl(__pNotification);
919 __pNotification = null;
921 __pNotification = new (std::nothrow) NotificationPanel(*this);
923 //NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
924 __pNotification->SetText(message);
925 __pNotification->SetPositionDiff(0);
926 __pNotification->ShowNotification();
936 SettingForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
938 Rectangle rect = GetClientAreaBounds();
940 if (__pNotification != null && __pNotification->GetShowState() == true)
942 __pNotification->OrientationChanged();
949 __pList->SetBounds(rect.x,rect.y,rect.width-16,rect.height);
950 // __pList->UpdateList();//removed for issue 53768
953 SettingForm::SettingItemInfo::SettingItemInfo(void)
962 SettingForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
964 WindowInfo* pWindowInfo = null;
965 String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
967 pWindowInfo = MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo();
969 if (previousSceneId == IDSCN_EDIT_HOMEPAGE_VIEW)
973 String* pValue = NULL;
974 pValue = dynamic_cast<String*>(pArgs->GetAt(0));
977 if (pValue->CompareTo(L"Done") == 0)
979 // SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
981 else if (pValue->CompareTo(L"Cancel") == 0)
983 String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
984 if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
986 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
987 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
988 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
989 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
990 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
993 else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
995 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
996 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
997 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
998 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
999 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
1003 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
1004 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
1005 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
1006 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
1014 if (pWindowInfo != null)
1016 __currentURL.Clear();
1017 __currentURL.Append(pWindowInfo->pageUrl);
1018 AppLog("current url is %ls",__currentURL.GetPointer());
1020 if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
1022 if (pWindowInfo->pageUrl.CompareTo(L"") == 0)
1024 //settingInfo[SETTING_FAVORITE_URL].titleText = CommonUtil::GetString(L"IDS_SET_HOMEPAGE");
1025 settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
1029 settingInfo[SETTING_FAVORITE_URL].titleText = pWindowInfo->pageUrl;
1034 settingInfo[SETTING_FAVORITE_URL].titleText = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
1038 if (__pList != null)
1040 __pList->UpdateList();
1041 if (pWindowInfo && pWindowInfo->pageUrl.CompareTo(L"") == 0)
1043 __isCurrentPageDisable = true;
1044 AppLog("set item enabled is false");
1045 __pList->SetItemEnabled(0, 1, false);
1049 __isCurrentPageDisable = false;
1050 AppLog("set item enabled is true");
1051 if (settingInfo[0].isOpen == false)
1053 __pList->SetItemEnabled(0,1,false);
1057 __pList->SetItemEnabled(0,1,true);
1060 for(int grpindex = 0; grpindex < groupCount; grpindex++)
1062 for(int index = 0; index < *(pGroupItemCount+groupCount); index++)
1064 int effectiveIndex = 0;
1065 for (int i = 0; i < grpindex; i++)
1066 effectiveIndex = effectiveIndex + pGroupItemCount[i];
1067 effectiveIndex = effectiveIndex + index;
1069 if(effectiveIndex >= SETTING_MAX)
1073 if(settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE || settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO )
1075 __pList->SetItemChecked(grpindex, index, settingInfo[effectiveIndex].isSelected);
1084 SettingForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1090 SettingForm::ClearHistory(void)
1092 if(__pConfirmationPopup)
1094 __pConfirmationPopup->SetShowState(false);
1095 __pConfirmationPopup->Show();
1096 delete __pConfirmationPopup;
1097 __pConfirmationPopup = null;
1099 String message = CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q");
1100 if(!__pConfirmationPopup)
1102 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1103 __pConfirmationPopup->Initialize();
1104 __pConfirmationPopup->RemoveActionListener(*this);
1105 __pConfirmationPopup->AddActionListener(*this);
1106 __pConfirmationPopup->setMessage(message);
1107 __pConfirmationPopup->Show();
1112 SettingForm::ClearCache(void)
1114 if(__pConfirmationPopup)
1116 __pConfirmationPopup->SetShowState(false);
1117 __pConfirmationPopup->Show();
1118 delete __pConfirmationPopup;
1119 __pConfirmationPopup = null;
1121 String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q");
1122 if(!__pConfirmationPopup)
1124 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1125 __pConfirmationPopup->Initialize();
1126 __pConfirmationPopup->RemoveActionListener(*this);
1127 __pConfirmationPopup->AddActionListener(*this);
1128 __pConfirmationPopup->setMessage(message);
1129 __pConfirmationPopup->Show();
1134 SettingForm::ClearCookie(void)
1136 if(__pConfirmationPopup)
1138 __pConfirmationPopup->SetShowState(false);
1139 __pConfirmationPopup->Show();
1140 delete __pConfirmationPopup;
1141 __pConfirmationPopup = null;
1143 String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO");
1144 if(!__pConfirmationPopup)
1146 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1147 __pConfirmationPopup->Initialize();
1148 __pConfirmationPopup->RemoveActionListener(*this);
1149 __pConfirmationPopup->AddActionListener(*this);
1150 __pConfirmationPopup->setMessage(message);
1151 __pConfirmationPopup->Show();
1156 SettingForm::ClearFormData(void)
1158 if(__pConfirmationPopup)
1160 __pConfirmationPopup->SetShowState(false);
1161 __pConfirmationPopup->Show();
1162 delete __pConfirmationPopup;
1163 __pConfirmationPopup = null;
1165 String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_FORM_DATA_Q");
1166 if(!__pConfirmationPopup)
1168 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1169 __pConfirmationPopup->Initialize();
1170 __pConfirmationPopup->RemoveActionListener(*this);
1171 __pConfirmationPopup->AddActionListener(*this);
1172 __pConfirmationPopup->setMessage(message);
1173 __pConfirmationPopup->Show();
1178 SettingForm::ClearPasswords(void)
1180 if(__pConfirmationPopup)
1182 __pConfirmationPopup->SetShowState(false);
1183 __pConfirmationPopup->Show();
1184 delete __pConfirmationPopup;
1185 __pConfirmationPopup = null;
1187 String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_PASSWORDS_Q");
1188 if(!__pConfirmationPopup)
1190 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1191 __pConfirmationPopup->Initialize();
1192 __pConfirmationPopup->RemoveActionListener(*this);
1193 __pConfirmationPopup->AddActionListener(*this);
1194 __pConfirmationPopup->setMessage(message);
1195 __pConfirmationPopup->Show();
1201 SettingForm::ResetToDefault()
1203 if(__pConfirmationPopup)
1205 __pConfirmationPopup->SetShowState(false);
1206 __pConfirmationPopup->Show();
1207 delete __pConfirmationPopup;
1208 __pConfirmationPopup = null;
1210 String message = CommonUtil::GetString(L"IDS_BR_POP_ALL_SETTINGS_TO_DEFAULT_CONTINUE_Q");
1211 if(!__pConfirmationPopup)
1213 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1214 __pConfirmationPopup->Initialize();
1215 __pConfirmationPopup->RemoveActionListener(*this);
1216 __pConfirmationPopup->AddActionListener(*this);
1217 __pConfirmationPopup->setMessage(message);
1218 __pConfirmationPopup->Show();
1223 SettingForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
1225 AppLog("receiving userevent for appcontrol %d",requestId);
1226 if (requestId == APPCONTROL_LAUNCH_MAX_LIMIT_REACHED)
1228 AppLog("receiving userevent for appcontrol %d ",requestId);
1229 if(__pConfirmationPopup)
1231 __pConfirmationPopup->SetShowState(false);
1232 delete __pConfirmationPopup;
1233 __pConfirmationPopup = null;
1236 else if (requestId == UPDATE_LIST_COMPLETE)
1238 AppLog("receiving event UPDATE_LIST_COMPLETE");
1239 Integer *pGroupIndex = static_cast<Integer*>(pArgs->GetAt(0));
1240 Integer *pItemIndex = static_cast<Integer*>(pArgs->GetAt(1));
1241 int groupIndex = pGroupIndex->ToInt();
1242 int itemIndex = pItemIndex->ToInt();
1244 int effectiveIndex = 0;
1245 for (int i = 0; i < groupIndex; i++)
1246 effectiveIndex = effectiveIndex + pGroupItemCount[i];
1247 effectiveIndex = effectiveIndex + itemIndex;
1250 if(settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE || settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO )
1252 AppLog("UPDATE_LIST_COMPLETE SetItemChecked %d, %d, %d",groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
1253 __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
1254 __pList->Invalidate(true);