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