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