Fixed Nabi issues N_SE-39262, N_SE-39349, N_SE-38797
[apps/osp/Internet.git] / src / IntSettingForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 //!Internet SettingForm class
18 /*@file:        IntSettingForm.cpp
19  *@brief:       The SettingForm
20  */
21
22 #include <FApp.h>
23 #include <FGraphics.h>
24 #include <FUi.h>
25
26 #include "IntCommonLib.h"
27 #include "IntConfirmationPopup.h"
28 #include "IntDefaultCustomItem.h"
29 #include "IntDropDownCustomItem.h"
30 #include "IntHistoryPresentationModel.h"
31 #include "IntMultipleWindowPresentationModel.h"
32 #include "IntNotificationPanel.h"
33 #include "IntRadioCustomItem.h"
34 #include "IntSceneRegister.h"
35 #include "IntSettingForm.h"
36 #include "IntSettingPresentationModel.h"
37 #include "IntSettingToggleCustomItem.h"
38
39
40 using namespace Tizen::App;
41 using namespace Tizen::Base;
42 using namespace Tizen::Base::Collection;
43 using namespace Tizen::Graphics;
44 using namespace Tizen::Ui;
45 using namespace Tizen::Ui::Controls;
46 using namespace Tizen::Ui::Scenes;
47
48
49 SettingForm::SettingForm(void)
50 : __fontValue(0),__pResetPopup(null),__pWindowInfo(null) , __pConfirmationPopup(null)
51 {
52         __currentURL = L"";
53         __pList = null;
54         InitializeSettingValues();
55 }
56
57 SettingForm::~SettingForm(void)
58 {
59         if (pGroupItemCount)
60         {
61                 delete[] pGroupItemCount;
62                 pGroupItemCount = null;
63         }
64 }
65
66 void
67 SettingForm::InitializeSettingValues(void)
68 {
69         AppLog("SettingForm::InitializeSettingValues homepage %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
70         groupCount = 5;
71         pGroupItemCount = new(std::nothrow) int[5];
72         pGroupItemCount[0] = 5;  //Homepage
73         pGroupItemCount[1] = 6;  //Page content settings
74         pGroupItemCount[2] = 7;  //Private and Security
75         pGroupItemCount[3] = 4;  //Search
76         pGroupItemCount[4] = 1;  //Website settings and Reset
77
78         for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; iter++)
79         {
80                 settingInfo[iter].isSelected = false;
81         }
82
83         AppLogDebug("image display %d", (int) SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled());
84         settingInfo[SETTING_HOMEPAGE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE");
85         settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
86         settingInfo[SETTING_HOMEPAGE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
87
88         settingInfo[SETTING_CURRENT_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CURRENT_PAGE");
89         settingInfo[SETTING_CURRENT_PAGE].subText = L"";
90         settingInfo[SETTING_CURRENT_PAGE].itemType = ITEM_TYPE_RADIO;
91
92         settingInfo[SETTING_BLANK_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLANK_PAGE");
93         settingInfo[SETTING_BLANK_PAGE].subText = L"";
94         settingInfo[SETTING_BLANK_PAGE].itemType = ITEM_TYPE_RADIO;
95         if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
96         {
97                 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
98         }
99
100         settingInfo[SETTING_MOST_VISITED_SITE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_MOST_VISITED_SITES");
101         settingInfo[SETTING_MOST_VISITED_SITE].subText = L"";
102         settingInfo[SETTING_MOST_VISITED_SITE].itemType = ITEM_TYPE_RADIO;
103         if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
104         {
105                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
106         }
107         WindowInfo* pWindowInfo = null;
108         String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
109         AppLog("SettingForm::OnSceneActivatedN check1");
110
111         settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
112         if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
113         {
114                 SettingPresentationModel::GetInstance()->SetFavoriteValue(L"http://www.tizen.org");
115         }
116         settingInfo[SETTING_FAVORITE_URL].subText = L"";
117         settingInfo[SETTING_FAVORITE_URL].itemType = ITEM_TYPE_RADIO;
118
119         String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
120         if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
121         {
122                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
123                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
124                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
125                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
126                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
127         }
128         else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
129         {
130                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
131                 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
132                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
133                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
134                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
135         }
136         else
137         {
138                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
139                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
140                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
141                 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
142         }
143
144         settingInfo[SETTING_DEFAULT_VIEW_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_DEFAULT_VIEW");
145         settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText = CommonUtil::GetString(SettingPresentationModel::GetInstance()->GetDefaultView());
146         settingInfo[SETTING_DEFAULT_VIEW_TITLE].itemType = ITEM_TYPE_DROPDOWN;
147
148         settingInfo[SETTING_FIT_TO_WIDTH].titleText = CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH");
149         settingInfo[SETTING_FIT_TO_WIDTH].subText = L"";
150         settingInfo[SETTING_FIT_TO_WIDTH].itemType = ITEM_TYPE_RADIO;
151         settingInfo[SETTING_FIT_TO_WIDTH].isSelected = !(String::Compare(settingInfo[SETTING_FIT_TO_WIDTH].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
152
153         settingInfo[SETTING_READABLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_READABLE");
154         settingInfo[SETTING_READABLE].subText = L"";
155         settingInfo[SETTING_READABLE].itemType = ITEM_TYPE_RADIO;
156         settingInfo[SETTING_READABLE].isSelected = !(String::Compare(settingInfo[SETTING_READABLE].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
157
158         settingInfo[SETTING_RUN_JAVASCRIPT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RUN_JAVASCRIPT");
159         settingInfo[SETTING_RUN_JAVASCRIPT].subText = L"";
160         settingInfo[SETTING_RUN_JAVASCRIPT].itemType = ITEM_TYPE_TOGGLE;
161         settingInfo[SETTING_RUN_JAVASCRIPT].isSelected = SettingPresentationModel::GetInstance()->IsRunJavascriptEnabled();
162
163         settingInfo[SETTING_DISPLAY_IMAGES].titleText = CommonUtil::GetString(L"IDS_BR_BODY_DISPLAY_IMAGES");
164         settingInfo[SETTING_DISPLAY_IMAGES].subText = L"";
165         settingInfo[SETTING_DISPLAY_IMAGES].itemType = ITEM_TYPE_TOGGLE;
166         settingInfo[SETTING_DISPLAY_IMAGES].isSelected = SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled();
167
168         settingInfo[SETTING_BLOCK_POPUP].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLOCK_POP_UPS_ABB");
169         settingInfo[SETTING_BLOCK_POPUP].subText = L"";
170         settingInfo[SETTING_BLOCK_POPUP].itemType = ITEM_TYPE_TOGGLE;
171         settingInfo[SETTING_BLOCK_POPUP].isSelected = !SettingPresentationModel::GetInstance()->IsBlockPopUp();
172
173         settingInfo[SETTING_CLEAR_CACHE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_CACHE");
174         settingInfo[SETTING_CLEAR_CACHE].subText = L"";
175         settingInfo[SETTING_CLEAR_CACHE].itemType = ITEM_TYPE_NORMAL;
176
177         settingInfo[SETTING_CLEAR_HISTORY].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_HISTORY");
178         settingInfo[SETTING_CLEAR_HISTORY].subText = L"";
179         settingInfo[SETTING_CLEAR_HISTORY].itemType = ITEM_TYPE_NORMAL;
180
181         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SHOW_SECURITY_WARNINGS");
182         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].subText = L"";
183         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].itemType = ITEM_TYPE_TOGGLE;
184         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected = SettingPresentationModel::GetInstance()->IsSecurityWarningsEnabled();
185
186         settingInfo[SETTING_ACCEPT_COOKIES].titleText = CommonUtil::GetString(L"IDS_BR_BODY_ACCEPT_COOKIES");
187         settingInfo[SETTING_ACCEPT_COOKIES].subText = L"";
188         settingInfo[SETTING_ACCEPT_COOKIES].itemType = ITEM_TYPE_TOGGLE;
189         settingInfo[SETTING_ACCEPT_COOKIES].isSelected = SettingPresentationModel::GetInstance()->IsCookiesEnabled();
190
191         settingInfo[SETTING_CLEAR_COOKIE_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA");
192         settingInfo[SETTING_CLEAR_COOKIE_DATA].subText = CommonUtil::GetString(L"IDS_BR_HEADER_COOKIES");
193         settingInfo[SETTING_CLEAR_COOKIE_DATA].itemType = ITEM_TYPE_NORMAL;
194
195         settingInfo[SETTING_REMEMBER_FORM_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_REMEMBER_FORM_DATA");
196         settingInfo[SETTING_REMEMBER_FORM_DATA].subText = L"";
197         settingInfo[SETTING_REMEMBER_FORM_DATA].itemType = ITEM_TYPE_TOGGLE;
198         settingInfo[SETTING_REMEMBER_FORM_DATA].isSelected = SettingPresentationModel::GetInstance()->IsRememberFormData();
199
200         settingInfo[SETTING_CLEAR_FORM_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_FORM_DATA");
201         settingInfo[SETTING_CLEAR_FORM_DATA].subText = CommonUtil::GetString(L"IDS_BR_HEADER_FORM_DATA");
202         settingInfo[SETTING_CLEAR_FORM_DATA].itemType = ITEM_TYPE_NORMAL;
203
204         settingInfo[SETTING_REMEMBER_PASSWORD].titleText = CommonUtil::GetString(L"IDS_BR_BODY_REMEMBER_PASSWORDS");
205         settingInfo[SETTING_REMEMBER_PASSWORD].subText = L"";
206         settingInfo[SETTING_REMEMBER_PASSWORD].itemType = ITEM_TYPE_TOGGLE;
207         settingInfo[SETTING_REMEMBER_PASSWORD].isSelected = SettingPresentationModel::GetInstance()->IsRememberPassword();
208
209
210         settingInfo[SETTING_CLEAR_PASSWORDS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_PASSWORDS");
211         settingInfo[SETTING_CLEAR_PASSWORDS].subText = L"";
212         settingInfo[SETTING_CLEAR_PASSWORDS].itemType = ITEM_TYPE_NORMAL;
213
214         settingInfo[SETTING_SEARCH_ENGINE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH_ENGINE");
215         settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText = SettingPresentationModel::GetInstance()->GetSearchEngine();
216         settingInfo[SETTING_SEARCH_ENGINE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
217
218         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText = CommonUtil::GetString(L"IDS_BR_BODY_YAHOO");
219         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].subText = L"";
220         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].itemType = ITEM_TYPE_RADIO;
221         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
222
223         settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText = CommonUtil::GetString(L"IDS_BR_BODY_NAVER");
224         settingInfo[SETTING_SEARCH_ENGINE_NAVER].subText = L"";
225         settingInfo[SETTING_SEARCH_ENGINE_NAVER].itemType = ITEM_TYPE_RADIO;
226         settingInfo[SETTING_SEARCH_ENGINE_NAVER].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
227
228         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText = CommonUtil::GetString(L"IDS_COM_BODY_GOOGLE");
229         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].subText = L"";
230         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].itemType = ITEM_TYPE_RADIO;
231         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
232
233         settingInfo[SETTING_RESET_TO_DEFAULT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RESET_TO_DEFAULT");
234         settingInfo[SETTING_RESET_TO_DEFAULT].subText = L"";
235         settingInfo[SETTING_RESET_TO_DEFAULT].itemType = ITEM_TYPE_NORMAL;
236 }
237
238 bool
239 SettingForm::Initialize(void)
240 {
241         result r = E_FAILURE;
242
243         r = Construct(L"IDL_SETTING_FORM");
244         if (IsFailed(r))
245         {
246                 return false;
247         }
248         return true;
249 }
250
251 result
252 SettingForm::OnInitializing(void)
253 {
254         result r = E_FAILURE;
255         Footer* pFooter = NULL;
256         SceneManager* pSceneManager = NULL;
257
258         __pList = static_cast< GroupedListView* >(GetControl(L"IDC_SETTING_LIST"));
259         if ( __pList != NULL )
260         {
261
262                 r = __pList->SetItemProvider(*this);
263                 TryCatch(!IsFailed(r),,"setItemProvider failed with error %s",GetErrorMessage(r));
264                 __pList->AddGroupedListViewItemEventListener(*this);
265         }
266
267         pFooter = GetFooter();
268         if (pFooter)
269         {
270                 AppLogDebug("setting back button");
271                 pFooter->SetBackButtonEnabled(true);
272                 SetFormBackEventListener(this);
273         }
274         pSceneManager = SceneManager::GetInstance();
275         if (pSceneManager != null)
276         {
277                 r = pSceneManager->AddSceneEventListener(IDSCN_SETTINGS, *this);
278                 TryCatch(!IsFailed(r),,"AddSceneEventListener failed with error %s",GetErrorMessage(r));
279         }
280         AddOrientationEventListener(*this);
281
282         CATCH:
283         return r;
284 }
285
286 void
287 SettingForm::OnGroupedListViewContextItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListContextItemStatus status)
288 {
289
290 }
291
292 void
293 SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListItemStatus status)
294 {
295         int effectiveIndex = 0;
296         SettingPresentationModel* pSettingMgr = SettingPresentationModel::GetInstance();
297
298         if (pSettingMgr == null)
299                 return;
300
301         for (int i = 0; i < groupIndex; i++)
302                 effectiveIndex = effectiveIndex + pGroupItemCount[i];
303         effectiveIndex = effectiveIndex + itemIndex;
304
305         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
306         {
307                 AppLogDebug("refreshing data child count is %d", settingInfo[effectiveIndex].childCount);
308                 if (settingInfo[effectiveIndex].isOpen == false)
309                 {
310                         settingInfo[effectiveIndex].isOpen = true;
311                         settingInfo[effectiveIndex].childCount = 0;
312                         for (int iter = effectiveIndex + 1; iter < SETTING_MAX; iter++)
313                         {
314                                 if (settingInfo[iter].itemType == ITEM_TYPE_RADIO)
315                                         settingInfo[effectiveIndex].childCount++;
316                                 else
317                                         break;
318                         }
319                         listView.UpdateList();
320                 }
321                 else
322                 {
323                         settingInfo[effectiveIndex].isOpen = false;
324                         listView.UpdateList();
325                 }
326         }
327         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
328         {
329                 int parentIndex = 0;
330                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
331                 {
332                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
333                                 break;
334                 }
335                 settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText;
336
337                 for (int iter = 0; iter < settingInfo[parentIndex].childCount; iter++)
338                 {
339                         if (parentIndex + iter + 1 != effectiveIndex)
340                         {
341                                 AppLogDebug("long effectiveIndex %d set to false", itemIndex - (effectiveIndex - parentIndex) + iter + 1);
342                                 settingInfo[parentIndex + iter + 1].isSelected = false;
343                         }
344                         else
345                         {
346                                 AppLogDebug("effectiveIndex %d set to true", effectiveIndex);
347                                 settingInfo[effectiveIndex].isSelected = true;
348                         }
349                         if (effectiveIndex == SETTING_CURRENT_PAGE)
350                         {
351                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
352                                 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
353                         }
354                         //listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
355                 }
356 //              listView.UpdateList();
357                 //listView.ScrollToItem(groupIndex, itemIndex, LIST_SCROLL_ITEM_ALIGNMENT_TOP);
358                 Invalidate(true);
359         }
360         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
361         {
362                 if (settingInfo[effectiveIndex].isSelected == true)
363                 {
364                         settingInfo[effectiveIndex].isSelected = false;
365                 }
366                 else
367                 {
368                         settingInfo[effectiveIndex].isSelected = true;
369                 }
370 //              listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
371                 if(__pList != null)
372                 {
373                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
374                 }
375         }
376
377         switch (effectiveIndex)
378         {
379         case SETTING_CURRENT_PAGE:
380                 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
381                 AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
382                 if (__currentURL.CompareTo(L"") != 0)
383                 {
384                         AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
385                         SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
386                         SettingPresentationModel::GetInstance()->SetFavoriteValue(__currentURL);
387                         settingInfo[SETTING_FAVORITE_URL].titleText = __currentURL;
388 //                      listView.RefreshList(groupIndex, effectiveIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
389                         listView.UpdateList();
390                 }
391                 break;
392         case SETTING_BLANK_PAGE:
393                 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_BLANK_PAGE].titleText);
394                 SettingPresentationModel::GetInstance()->SetHomepage((L"IDS_BR_BODY_BLANK_PAGE"));
395                 AppLog("GetHomepage() %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
396                 listView.UpdateList();
397
398                 break;
399         case SETTING_MOST_VISITED_SITE:
400                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
401                 listView.UpdateList();
402                 break;
403
404         case SETTING_FAVORITE_URL:
405                 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
406                 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EDIT_HOMEPAGE_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
407                 break;
408
409         case SETTING_FIT_TO_WIDTH:
410                 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_FIT_TO_WIDTH");
411                 listView.UpdateList();
412                 break;
413
414         case SETTING_READABLE:
415                 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_READABLE");
416                 listView.UpdateList();
417                 break;
418
419         case SETTING_RUN_JAVASCRIPT:
420                 SettingPresentationModel::GetInstance()->SetRunJavascriptEnabled(settingInfo[SETTING_RUN_JAVASCRIPT].isSelected);
421                 break;
422
423         case SETTING_DISPLAY_IMAGES:
424                 SettingPresentationModel::GetInstance()->SetDisplayImagesEnabled(settingInfo[SETTING_DISPLAY_IMAGES].isSelected);
425                 break;
426
427         case SETTING_BLOCK_POPUP:
428                 SettingPresentationModel::GetInstance()->SetBlockPopUp(!settingInfo[SETTING_BLOCK_POPUP].isSelected);
429                 break;
430
431         case SETTING_CLEAR_CACHE:
432                 ClearCache();
433                 break;
434
435         case SETTING_CLEAR_HISTORY:
436                 ClearHistory();
437                 break;
438
439         case SETTING_SHOW_SECURITY_WARNINGS:
440                 SettingPresentationModel::GetInstance()->SetSecurityWarningsEnabled(settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected);
441                 break;
442
443         case SETTING_ACCEPT_COOKIES:
444                 SettingPresentationModel::GetInstance()->SetCookiesEnabled(settingInfo[SETTING_ACCEPT_COOKIES].isSelected);
445                 break;
446
447         case SETTING_CLEAR_COOKIE_DATA:
448                 ClearCookie();
449                 break;
450
451         case SETTING_REMEMBER_FORM_DATA:
452                 SettingPresentationModel::GetInstance()->SetRememberFormData(settingInfo[SETTING_REMEMBER_FORM_DATA].isSelected);
453                 break;
454
455         case SETTING_CLEAR_FORM_DATA:
456                 ClearFormData();
457                 break;
458
459         case SETTING_CLEAR_PASSWORDS:
460                 ClearPasswords();
461                 break;
462
463         case SETTING_REMEMBER_PASSWORD:
464                 SettingPresentationModel::GetInstance()->SetRememberPassword(settingInfo[SETTING_REMEMBER_PASSWORD].isSelected);
465                 break;
466
467         case SETTING_SEARCH_ENGINE_YAHOO:
468                 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText);
469                 listView.UpdateList();
470                 break;
471
472         case SETTING_SEARCH_ENGINE_NAVER:
473                 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText);
474                 listView.UpdateList();
475                 break;
476
477         case SETTING_SEARCH_ENGINE_GOOGLE:
478                 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText);
479                 listView.UpdateList();
480                 break;
481
482         case SETTING_RESET_TO_DEFAULT:
483                 //OpenResetPopup();
484                 ResetToDefault();
485                 break;
486
487         default:
488                 break;
489         }
490 }
491
492 void
493 SettingForm::OnGroupedListViewItemSwept(GroupedListView& listView, int groupIndex, int itemIndex, SweepDirection direction)
494 {
495
496 }
497
498 GroupItem*
499 SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
500 {
501         result r = E_FAILURE;
502         String text(L"");
503         GroupItem* pItem = null;
504         const Color ITEM_TEXT_COLOR = CUSTOM_COLOR_SETTINGS_GROUPTITLE;
505
506         pItem = new(std::nothrow) GroupItem();
507         if (pItem == null)
508         {
509                 return null;
510         }
511         r = pItem->Construct(Dimension(itemWidth, 46));
512         if (IsFailed(r))
513         {
514                 delete pItem;
515                 return null;
516         }
517
518         switch (groupIndex)
519         {
520         case 0:
521                 text = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE"); // IDS_HOMEPAGE
522                 settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
523                 break;
524
525         case 1:
526                 text = CommonUtil::GetString(L"IDS_BR_MBODY_PAGE_CONTENT_SETTINGS"); // IDS_BR_MBODY_PAGE_CONTENT_SETTINGS
527                 break;
528
529         case 2:
530                 text = CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB");  // IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB
531                 break;
532
533         case 3:
534                 text = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH");    // IDS_BR_BODY_SEARCH
535                 break;
536
537         case 4:
538                 text = L"";
539                 break;
540
541         default:
542                 break;
543         }
544
545         pItem->SetElement(text, null);
546
547         AppLogDebug("background color set result %s", GetErrorMessage(r));
548
549         pItem->SetTextColor(ITEM_TEXT_COLOR);
550         return pItem;
551 }
552
553 ListItemBase*
554 SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
555 {
556         AppLog("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d ", groupIndex, itemIndex, itemWidth);
557
558         result r = E_SUCCESS;
559         int effectiveIndex = 0;
560         const Color ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND;
561         const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
562         const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED;
563
564         for (int i = 0; i < groupIndex; i++)
565                 effectiveIndex = effectiveIndex + pGroupItemCount[i];
566         effectiveIndex = effectiveIndex + itemIndex;
567         AppLogDebug("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
568
569         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
570         {
571                 SettingToggleCustomItem* pItem = new(std::nothrow) SettingToggleCustomItem();
572                 r = pItem->Construct(itemWidth, 112);
573                 if (IsFailed(r))
574                 {
575                         delete pItem;
576                         return null;
577                 }
578
579                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
580                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
581                 if(__pList != null)
582                 {
583                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
584                 }
585
586                 pItem->SetText(settingInfo[effectiveIndex].titleText);
587                 pItem->Make();
588
589                 return pItem;
590
591         }
592         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
593         {
594                 DropDownCustomItem* pItem = new(std::nothrow) DropDownCustomItem();
595                 r = pItem->Construct(itemWidth);
596                 if (IsFailed(r))
597                 {
598                         delete pItem;
599                         return null;
600                 }
601
602 /*              Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,128);
603                 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
604
605                 if (pNormalBackgroundBitmap != NULL)
606                 {
607                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
608                         delete pNormalBackgroundBitmap;
609                 }
610
611                 if (pPressedBackgroundBitmap != NULL)
612                 {
613                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
614                         delete pPressedBackgroundBitmap;
615                 }*/
616
617                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
618                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
619
620                 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
621                 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)
622                 {
623                         pItem->SetSubText(CommonUtil::GetString(settingInfo[effectiveIndex].subText));
624                 }
625                 else
626                 {
627                         pItem->SetSubText(settingInfo[effectiveIndex].subText);
628                 }
629                 if (settingInfo[effectiveIndex].isOpen)
630                 {
631                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
632                 }
633                 else
634                 {
635                         pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED);
636                 }
637                 r = pItem->Make();
638                 //      if (pBitmap != null)
639                 //              pItem->AddElement(Rectangle(0, 0, 10, 128), IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN, *pBitmap, null);
640
641                 if (IsFailed(r))
642                 {
643                         delete pItem;
644                         return null;
645                 }
646
647                 return pItem;
648         }
649         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
650         {
651
652
653                 RadioCustomItem* pItem = new(std::nothrow) RadioCustomItem();
654                 int parentIndex = 0;
655                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
656                 {
657                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
658                                 break;
659                 }
660                 if (settingInfo[parentIndex].isOpen == false || (__isCurrentPageDisable == true && groupIndex == 0 && itemIndex == 1))
661                 {
662                         r = pItem->Construct(itemWidth, 0);
663                         AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
664                         return pItem;
665                 }
666                 else
667                 {
668                         pItem->Construct(itemWidth, 112);
669                 }
670 /*
671                 Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
672                 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
673
674                 if (pNormalBackgroundBitmap != NULL)
675                 {
676                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
677                         delete pNormalBackgroundBitmap;
678                 }
679
680                 if (pPressedBackgroundBitmap != NULL)
681                 {
682                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
683                         delete pPressedBackgroundBitmap;
684                 }*/
685
686                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
687                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
688
689
690                 pItem->SetText(settingInfo[effectiveIndex].titleText);
691                 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
692
693                 //if (pBitmap != null)
694                 //      pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
695
696                 pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
697                 pItem->Make();
698
699                 return pItem;
700         }
701         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_NORMAL)
702         {
703                 DefaultCustomItem* pItem = new(std::nothrow) DefaultCustomItem();
704
705                 r = pItem->Construct(itemWidth, 112);
706                 if (IsFailed(r))
707                 {
708                         delete pItem;
709                         return null;
710                 }
711
712
713 //              Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
714 //              Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
715 //
716 //              if (pNormalBackgroundBitmap != NULL)
717 //              {
718 //                      pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
719 //                      delete pNormalBackgroundBitmap;
720 //              }
721 //
722 //              if (pPressedBackgroundBitmap != NULL)
723 //              {
724 //                      pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
725 //                      delete pPressedBackgroundBitmap;
726 //              }
727
728                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
729                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
730
731                 pItem->SetText(settingInfo[effectiveIndex].titleText);
732
733                 //if (pBitmap != null)
734                 //      pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
735
736                 r = pItem->Make();
737                 if (IsFailed(r))
738                 {
739                         delete pItem;
740                         return null;
741                 }
742                 return pItem;
743         }
744         else
745         {
746                 return null;
747         }
748 }
749
750 bool
751 SettingForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
752 {
753         delete pItem;
754         pItem = null;
755         return true;
756 }
757
758 bool
759 SettingForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
760 {
761         delete pItem;
762         pItem = null;
763         return true;
764 }
765
766 int
767 SettingForm::GetGroupCount(void)
768 {
769         return groupCount;
770 }
771
772 int
773 SettingForm::GetItemCount(int groupIndex)
774 {
775         AppLog(" SettingForm::GetItemCount --> groupIndex : %d,", groupIndex);
776         return pGroupItemCount[groupIndex];
777 }
778
779 void
780 SettingForm::OnFormBackRequested(Form& source)
781 {
782         String* pSelectedScene = NULL;
783         Object* value = NULL;
784         MultipleWindowPresentationModel::GetInstance()->GetValue(SELECTED_SCENE_ID, &value);
785         pSelectedScene = (String*) value;
786         if (pSelectedScene)
787         {
788                 SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(*pSelectedScene, SCENE_TRANSITION_ANIMATION_TYPE_NONE));
789 //              delete pSelectedScene;
790 //              pSelectedScene = null;
791         }
792 }
793
794 void
795 SettingForm::OnActionPerformed(const Control& source, int actionId)
796 {
797         switch (actionId)
798         {
799         case IDA_BUTTON_NO:
800                 if(__pConfirmationPopup)
801                 {
802                         __pConfirmationPopup->SetShowState(false);
803                         __pConfirmationPopup->Show();
804                         delete __pConfirmationPopup;
805                         __pConfirmationPopup = null;
806                 }
807                 break;
808
809         case IDA_BUTTON_YES:
810                 if(__pConfirmationPopup)
811                 {
812                         String message = L"";
813                         __pConfirmationPopup->SetShowState(false);
814                         __pConfirmationPopup->Show();
815                         if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO"))
816                         {
817                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
818                                 SettingPresentationModel::GetInstance()->ClearCookie();
819                         }
820                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_EMPTY_FORM_DATA_BNO"))
821                         {
822                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
823                                 SettingPresentationModel::GetInstance()->ClearFormData();
824                         }
825                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_EMPTY_PASSWORDS_BNO"))
826                         {
827                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
828                                 SettingPresentationModel::GetInstance()->ClearPasswords();
829                         }
830                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q"))
831                         {
832                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
833                                 SettingPresentationModel::GetInstance()->ClearCache();
834                         }
835                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q"))
836                         {
837                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
838                                 HistoryPresentationModel::GetInstance()->ClearHistory();
839                         }
840                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_RESET_ALL_SETTINGS_TO_DEFAULT_Q"))
841                         {
842                                 message = CommonUtil::GetString(L"IDS_BR_SK_DONE");
843                                 SettingPresentationModel::GetInstance()->ResetRegistry();
844                                 InitializeSettingValues();
845                                 if(__pList != null)
846                                 {
847                                         __pList->UpdateList();
848                                 }
849                         }
850                         delete __pConfirmationPopup;
851                         __pConfirmationPopup = null;
852
853                         NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
854                         pNotification->SetText(message);
855                         pNotification->SetPositionDiff(0);
856                         pNotification->ShowNotification();
857                 }
858                 break;
859
860         default:
861                 break;
862         }
863 }
864
865 void
866 SettingForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
867 {
868         Rectangle rect = GetClientAreaBounds();
869         if(__pList == null)
870         {
871                 return;
872         }
873         __pList->SetBounds(rect.x,rect.y,rect.width-16,rect.height);
874         __pList->UpdateList();
875 }
876
877 SettingForm::SettingItemInfo::SettingItemInfo(void)
878 {
879         titleText = L"";
880         subText = L"";
881         childCount = 0;
882         isOpen = false;
883         isSelected = false ;
884 }
885 void
886 SettingForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
887 {
888         WindowInfo* pWindowInfo = null;
889         String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
890
891         pWindowInfo = MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo();
892
893         if (previousSceneId == IDSCN_EDIT_HOMEPAGE_VIEW)
894         {
895                 if (pArgs != null)
896                 {
897                         String* pValue = NULL;
898                         pValue = dynamic_cast<String*>(pArgs->GetAt(0));
899                         if( pValue != NULL )
900                         {
901                                 if (pValue->CompareTo(L"Done") == 0)
902                                 {
903                                 //      SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
904                                 }
905                                 else if (pValue->CompareTo(L"Cancel") == 0)
906                                 {
907                                         String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
908                                         if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
909                                         {
910                                                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
911                                                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
912                                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
913                                                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
914                                                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
915
916                                         }
917                                         else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
918                                         {
919                                                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
920                                                 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
921                                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
922                                                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
923                                                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
924                                         }
925                                         else
926                                         {
927                                                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
928                                                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
929                                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
930                                                 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
931                                         }
932
933                                 }
934                         }
935                 }
936         }
937
938         if (pWindowInfo != null)
939         {
940                 __currentURL.Clear();
941                 __currentURL.Append(pWindowInfo->pageUrl);
942                 AppLog("current url is %ls",__currentURL.GetPointer());
943
944                 if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
945                 {
946                         if (pWindowInfo->pageUrl.CompareTo(L"") == 0)
947                         {
948                                 //settingInfo[SETTING_FAVORITE_URL].titleText = CommonUtil::GetString(L"IDS_SET_HOMEPAGE");
949                                 settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
950                         }
951                         else
952                         {
953                                 settingInfo[SETTING_FAVORITE_URL].titleText = pWindowInfo->pageUrl;
954                         }
955                 }
956                 else
957                 {
958                         settingInfo[SETTING_FAVORITE_URL].titleText = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
959                 }
960         }
961
962         if (__pList != null)
963         {
964                 __pList->UpdateList();
965                 if (pWindowInfo && pWindowInfo->pageUrl.CompareTo(L"") == 0)
966                 {
967                         __isCurrentPageDisable = true;
968                         AppLog("set item enabled is false");
969                         __pList->SetItemEnabled(0, 1, false);
970                 }
971                 else
972                 {
973                         __isCurrentPageDisable = false;
974                         AppLog("set item enabled is true");
975                         __pList->SetItemEnabled(0, 1, true);
976                 }
977                 for(int grpindex = 0; grpindex < groupCount; grpindex++)
978                 {
979                         for(int index = 0; index < *(pGroupItemCount+groupCount); index++)
980                         {
981                                 int effectiveIndex = 0;
982                                 for (int i = 0; i < grpindex; i++)
983                                                 effectiveIndex = effectiveIndex + pGroupItemCount[i];
984                                         effectiveIndex = effectiveIndex + index;
985
986                                         if(effectiveIndex >= SETTING_MAX)
987                                         {
988                                                 continue;
989                                         }
990                                 if(settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE || settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO )
991                                 {
992                                         __pList->SetItemChecked(grpindex, index, settingInfo[effectiveIndex].isSelected);
993                                 }
994                         }
995                 }
996         }
997         return;
998 }
999
1000 void
1001 SettingForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1002 {
1003         return;
1004 }
1005
1006 void
1007 SettingForm::ClearHistory(void)
1008 {
1009         String message = CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q");
1010         if(!__pConfirmationPopup)
1011         {
1012                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1013                 __pConfirmationPopup->Initialize();
1014                 __pConfirmationPopup->RemoveActionListener(*this);
1015                 __pConfirmationPopup->AddActionListener(*this);
1016                 __pConfirmationPopup->setMessage(message);
1017                 __pConfirmationPopup->Show();
1018         }
1019 }
1020
1021 void
1022 SettingForm::ClearCache(void)
1023 {
1024         String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q");
1025         if(!__pConfirmationPopup)
1026         {
1027                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1028                 __pConfirmationPopup->Initialize();
1029                 __pConfirmationPopup->RemoveActionListener(*this);
1030                 __pConfirmationPopup->AddActionListener(*this);
1031                 __pConfirmationPopup->setMessage(message);
1032                 __pConfirmationPopup->Show();
1033         }
1034 }
1035
1036 void
1037 SettingForm::ClearCookie(void)
1038 {
1039         String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO");
1040         if(!__pConfirmationPopup)
1041         {
1042                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1043                 __pConfirmationPopup->Initialize();
1044                 __pConfirmationPopup->RemoveActionListener(*this);
1045                 __pConfirmationPopup->AddActionListener(*this);
1046                 __pConfirmationPopup->setMessage(message);
1047                 __pConfirmationPopup->Show();
1048         }
1049 }
1050
1051 void
1052 SettingForm::ClearFormData(void)
1053 {
1054         String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_FORM_DATA_BNO");
1055         if(!__pConfirmationPopup)
1056         {
1057                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1058                 __pConfirmationPopup->Initialize();
1059                 __pConfirmationPopup->RemoveActionListener(*this);
1060                 __pConfirmationPopup->AddActionListener(*this);
1061                 __pConfirmationPopup->setMessage(message);
1062                 __pConfirmationPopup->Show();
1063         }
1064 }
1065
1066 void
1067 SettingForm::ClearPasswords(void)
1068 {
1069         String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_PASSWORDS_BNO");
1070         if(!__pConfirmationPopup)
1071         {
1072                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1073                 __pConfirmationPopup->Initialize();
1074                 __pConfirmationPopup->RemoveActionListener(*this);
1075                 __pConfirmationPopup->AddActionListener(*this);
1076                 __pConfirmationPopup->setMessage(message);
1077                 __pConfirmationPopup->Show();
1078         }
1079 }
1080
1081
1082 void
1083 SettingForm::ResetToDefault()
1084 {
1085         String message = CommonUtil::GetString(L"IDS_BR_POP_RESET_ALL_SETTINGS_TO_DEFAULT_Q");
1086         if(!__pConfirmationPopup)
1087         {
1088                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1089                 __pConfirmationPopup->Initialize();
1090                 __pConfirmationPopup->RemoveActionListener(*this);
1091                 __pConfirmationPopup->AddActionListener(*this);
1092                 __pConfirmationPopup->setMessage(message);
1093                 __pConfirmationPopup->Show();
1094         }
1095 }