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