2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 //!Internet SettingForm class
18 /*@file: IntSettingForm.cpp
19 *@brief: The SettingForm
23 #include <FGraphics.h>
26 #include "IntCommonLib.h"
27 #include "IntConfirmationPopup.h"
28 #include "IntDefaultCustomItem.h"
29 #include "IntDropDownCustomItem.h"
30 #include "IntHistoryPresentationModel.h"
31 #include "IntInternetApp.h"
32 #include "IntMultipleWindowPresentationModel.h"
33 #include "IntNotificationPanel.h"
34 #include "IntRadioCustomItem.h"
35 #include "IntSceneRegister.h"
36 #include "IntSettingForm.h"
37 #include "IntSettingPresentationModel.h"
38 #include "IntSettingToggleCustomItem.h"
41 using namespace Tizen::App;
42 using namespace Tizen::Base;
43 using namespace Tizen::Base::Collection;
44 using namespace Tizen::Graphics;
45 using namespace Tizen::System;
46 using namespace Tizen::Ui;
47 using namespace Tizen::Ui::Controls;
48 using namespace Tizen::Ui::Scenes;
52 SettingForm::SettingForm(void)
53 : __fontValue(0),__pResetPopup(null),__pWindowInfo(null) , __pConfirmationPopup(null),__pNotification(null)
57 InitializeSettingValues();
61 SettingForm::~SettingForm(void)
65 delete[] pGroupItemCount;
66 pGroupItemCount = null;
71 SettingForm::InitializeSettingValues(void)
73 AppLog("SettingForm::InitializeSettingValues homepage %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
75 pGroupItemCount = new(std::nothrow) int[5];
76 pGroupItemCount[0] = 5; //Homepage
77 pGroupItemCount[1] = 6; //Page content settings
78 pGroupItemCount[2] = 9; //Private and Security
79 pGroupItemCount[3] = 4; //Search
80 pGroupItemCount[4] = 1; //Website settings and Reset
82 for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; iter++)
84 settingInfo[iter].isSelected = false;
87 AppLogDebug("image display %d", (int) SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled());
88 settingInfo[SETTING_HOMEPAGE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE");
89 settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
90 settingInfo[SETTING_HOMEPAGE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
92 settingInfo[SETTING_CURRENT_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CURRENT_PAGE");
93 settingInfo[SETTING_CURRENT_PAGE].subText = L"";
94 settingInfo[SETTING_CURRENT_PAGE].itemType = ITEM_TYPE_RADIO;
96 settingInfo[SETTING_BLANK_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLANK_PAGE");
97 settingInfo[SETTING_BLANK_PAGE].subText = L"";
98 settingInfo[SETTING_BLANK_PAGE].itemType = ITEM_TYPE_RADIO;
99 if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
101 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
104 settingInfo[SETTING_MOST_VISITED_SITE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_MOST_VISITED_SITES");
105 settingInfo[SETTING_MOST_VISITED_SITE].subText = L"";
106 settingInfo[SETTING_MOST_VISITED_SITE].itemType = ITEM_TYPE_RADIO;
107 if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
109 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
111 WindowInfo* pWindowInfo = null;
112 String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
113 AppLog("SettingForm::OnSceneActivatedN check1");
115 settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
116 if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
118 SettingPresentationModel::GetInstance()->SetFavoriteValue(L"http://www.tizen.org");
120 settingInfo[SETTING_FAVORITE_URL].subText = L"";
121 settingInfo[SETTING_FAVORITE_URL].itemType = ITEM_TYPE_RADIO;
123 String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
124 if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
126 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
127 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
128 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
129 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
130 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
132 else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
134 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
135 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
136 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
137 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
138 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
142 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
143 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
144 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
145 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
148 settingInfo[SETTING_DEFAULT_VIEW_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_DEFAULT_VIEW");
149 settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText = CommonUtil::GetString(SettingPresentationModel::GetInstance()->GetDefaultView());
150 settingInfo[SETTING_DEFAULT_VIEW_TITLE].itemType = ITEM_TYPE_DROPDOWN;
152 settingInfo[SETTING_FIT_TO_WIDTH].titleText = CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH");
153 settingInfo[SETTING_FIT_TO_WIDTH].subText = L"";
154 settingInfo[SETTING_FIT_TO_WIDTH].itemType = ITEM_TYPE_RADIO;
155 settingInfo[SETTING_FIT_TO_WIDTH].isSelected = !(String::Compare(settingInfo[SETTING_FIT_TO_WIDTH].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
157 settingInfo[SETTING_READABLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_READABLE");
158 settingInfo[SETTING_READABLE].subText = L"";
159 settingInfo[SETTING_READABLE].itemType = ITEM_TYPE_RADIO;
160 settingInfo[SETTING_READABLE].isSelected = !(String::Compare(settingInfo[SETTING_READABLE].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
162 settingInfo[SETTING_RUN_JAVASCRIPT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RUN_JAVASCRIPT");
163 settingInfo[SETTING_RUN_JAVASCRIPT].subText = L"";
164 settingInfo[SETTING_RUN_JAVASCRIPT].itemType = ITEM_TYPE_TOGGLE;
165 settingInfo[SETTING_RUN_JAVASCRIPT].isSelected = SettingPresentationModel::GetInstance()->IsRunJavascriptEnabled();
167 settingInfo[SETTING_DISPLAY_IMAGES].titleText = CommonUtil::GetString(L"IDS_BR_OPT_LOAD_IMAGES");
168 settingInfo[SETTING_DISPLAY_IMAGES].subText = L"";
169 settingInfo[SETTING_DISPLAY_IMAGES].itemType = ITEM_TYPE_TOGGLE;
170 settingInfo[SETTING_DISPLAY_IMAGES].isSelected = SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled();
172 settingInfo[SETTING_BLOCK_POPUP].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLOCK_POP_UPS_ABB");
173 settingInfo[SETTING_BLOCK_POPUP].subText = L"";
174 settingInfo[SETTING_BLOCK_POPUP].itemType = ITEM_TYPE_TOGGLE;
175 settingInfo[SETTING_BLOCK_POPUP].isSelected = !SettingPresentationModel::GetInstance()->IsBlockPopUp();
177 settingInfo[SETTING_CLEAR_CACHE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_CACHE");
178 settingInfo[SETTING_CLEAR_CACHE].subText = L"";
179 settingInfo[SETTING_CLEAR_CACHE].itemType = ITEM_TYPE_NORMAL;
181 settingInfo[SETTING_CLEAR_HISTORY].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_HISTORY");
182 settingInfo[SETTING_CLEAR_HISTORY].subText = L"";
183 settingInfo[SETTING_CLEAR_HISTORY].itemType = ITEM_TYPE_NORMAL;
185 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SHOW_SECURITY_WARNINGS");
186 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].subText = L"";
187 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].itemType = ITEM_TYPE_TOGGLE;
188 settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected = SettingPresentationModel::GetInstance()->IsSecurityWarningsEnabled();
190 settingInfo[SETTING_ACCEPT_COOKIES].titleText = CommonUtil::GetString(L"IDS_BR_BODY_ACCEPT_COOKIES");
191 settingInfo[SETTING_ACCEPT_COOKIES].subText = L"";
192 settingInfo[SETTING_ACCEPT_COOKIES].itemType = ITEM_TYPE_TOGGLE;
193 settingInfo[SETTING_ACCEPT_COOKIES].isSelected = SettingPresentationModel::GetInstance()->IsCookiesEnabled();
195 settingInfo[SETTING_CLEAR_COOKIE_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA");
196 settingInfo[SETTING_CLEAR_COOKIE_DATA].subText = CommonUtil::GetString(L"IDS_BR_BODY_COOKIES");
197 settingInfo[SETTING_CLEAR_COOKIE_DATA].itemType = ITEM_TYPE_NORMAL;
199 settingInfo[SETTING_REMEMBER_FORM_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_REMEMBER_FORM_DATA");
200 settingInfo[SETTING_REMEMBER_FORM_DATA].subText = L"";
201 settingInfo[SETTING_REMEMBER_FORM_DATA].itemType = ITEM_TYPE_TOGGLE;
202 settingInfo[SETTING_REMEMBER_FORM_DATA].isSelected = SettingPresentationModel::GetInstance()->IsRememberFormData();
204 settingInfo[SETTING_CLEAR_FORM_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_FORM_DATA");
205 settingInfo[SETTING_CLEAR_FORM_DATA].subText = CommonUtil::GetString(L"IDS_BR_HEADER_FORM_DATA");
206 settingInfo[SETTING_CLEAR_FORM_DATA].itemType = ITEM_TYPE_NORMAL;
208 settingInfo[SETTING_REMEMBER_PASSWORD].titleText = CommonUtil::GetString(L"IDS_BR_BODY_REMEMBER_PASSWORDS");
209 settingInfo[SETTING_REMEMBER_PASSWORD].subText = L"";
210 settingInfo[SETTING_REMEMBER_PASSWORD].itemType = ITEM_TYPE_TOGGLE;
211 settingInfo[SETTING_REMEMBER_PASSWORD].isSelected = SettingPresentationModel::GetInstance()->IsRememberPassword();
214 settingInfo[SETTING_CLEAR_PASSWORDS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_PASSWORDS");
215 settingInfo[SETTING_CLEAR_PASSWORDS].subText = L"";
216 settingInfo[SETTING_CLEAR_PASSWORDS].itemType = ITEM_TYPE_NORMAL;
218 settingInfo[SETTING_SEARCH_ENGINE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH_ENGINE");
219 settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText = SettingPresentationModel::GetInstance()->GetSearchEngine();
220 settingInfo[SETTING_SEARCH_ENGINE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
222 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText = L"Yahoo"; //CommonUtil::GetString(L"IDS_BR_BODY_YAHOO");
223 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].subText = L"";
224 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].itemType = ITEM_TYPE_RADIO;
225 settingInfo[SETTING_SEARCH_ENGINE_YAHOO].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
227 settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText = L"Naver"; //CommonUtil::GetString(L"IDS_BR_BODY_NAVER");
228 settingInfo[SETTING_SEARCH_ENGINE_NAVER].subText = L"";
229 settingInfo[SETTING_SEARCH_ENGINE_NAVER].itemType = ITEM_TYPE_RADIO;
230 settingInfo[SETTING_SEARCH_ENGINE_NAVER].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
232 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText = L"Google";//CommonUtil::GetString(L"IDS_COM_BODY_GOOGLE");
233 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].subText = L"";
234 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].itemType = ITEM_TYPE_RADIO;
235 settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
237 settingInfo[SETTING_RESET_TO_DEFAULT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RESET_TO_DEFAULT");
238 settingInfo[SETTING_RESET_TO_DEFAULT].subText = L"";
239 settingInfo[SETTING_RESET_TO_DEFAULT].itemType = ITEM_TYPE_NORMAL;
243 SettingForm::Initialize(void)
245 result r = E_FAILURE;
247 r = Construct(L"IDL_SETTING_FORM");
256 SettingForm::OnInitializing(void)
258 result r = E_FAILURE;
259 Footer* pFooter = NULL;
260 SceneManager* pSceneManager = NULL;
262 __fontSize = CommonUtil::GetFontSize();
264 bool isHwKeySupported = false;
266 //SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR);
267 __pList = static_cast< GroupedListView* >(GetControl(L"IDC_SETTING_LIST"));
268 if ( __pList != NULL )
271 r = __pList->SetItemProvider(*this);
272 TryCatch(!IsFailed(r),,"setItemProvider failed with error %s",GetErrorMessage(r));
273 __pList->AddGroupedListViewItemEventListener(*this);
276 // pFooter = GetFooter();
279 // AppLogDebug("setting back button");
280 // pFooter->SetBackButtonEnabled(true);
282 SetFormBackEventListener(this);
283 AppLog("SetFormBackEventListener result %s",GetErrorMessage(GetLastResult()));
284 pSceneManager = SceneManager::GetInstance();
285 if (pSceneManager != null)
287 r = pSceneManager->AddSceneEventListener(IDSCN_SETTINGS, *this);
288 TryCatch(!IsFailed(r),,"AddSceneEventListener failed with error %s",GetErrorMessage(r));
290 AddOrientationEventListener(*this);
297 SettingForm::OnGroupedListViewContextItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListContextItemStatus status)
303 SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListItemStatus status)
305 int effectiveIndex = 0;
306 SettingPresentationModel* pSettingMgr = SettingPresentationModel::GetInstance();
308 if (pSettingMgr == null)
311 for (int i = 0; i < groupIndex; i++)
312 effectiveIndex = effectiveIndex + pGroupItemCount[i];
313 effectiveIndex = effectiveIndex + itemIndex;
315 if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
317 AppLogDebug("refreshing data child count is %d", settingInfo[effectiveIndex].childCount);
318 if (settingInfo[effectiveIndex].isOpen == false)
320 settingInfo[effectiveIndex].isOpen = true;
321 settingInfo[effectiveIndex].childCount = 0;
322 for (int iter = effectiveIndex + 1; iter < SETTING_MAX; iter++)
324 if (settingInfo[iter].itemType == ITEM_TYPE_RADIO)
325 settingInfo[effectiveIndex].childCount++;
330 listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
331 for(int iter = 0; iter < settingInfo[effectiveIndex].childCount; iter++)
333 listView.RefreshList(groupIndex, itemIndex + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
336 listView.UpdateList();
340 settingInfo[effectiveIndex].isOpen = false;
342 listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
343 for(int iter = 0; iter < settingInfo[effectiveIndex].childCount; iter++)
345 listView.RefreshList(groupIndex, itemIndex + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
348 listView.UpdateList();
351 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
354 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
356 if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
359 settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText;
361 // listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex), LIST_REFRESH_TYPE_ITEM_MODIFY);
362 // listView.RefreshList(groupIndex, parentIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
363 for (int iter = 0; iter < settingInfo[parentIndex].childCount; iter++)
365 if (parentIndex + iter + 1 != effectiveIndex)
367 AppLogDebug("long effectiveIndex %d set to false", itemIndex - (effectiveIndex - parentIndex) + iter + 1);
368 settingInfo[parentIndex + iter + 1].isSelected = false;
372 AppLogDebug("effectiveIndex %d set to true", effectiveIndex);
373 settingInfo[effectiveIndex].isSelected = true;
375 if (effectiveIndex == SETTING_CURRENT_PAGE)
377 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
378 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
380 // listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
382 // listView.UpdateList();
383 //listView.ScrollToItem(groupIndex, itemIndex, LIST_SCROLL_ITEM_ALIGNMENT_TOP);
386 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
388 if (settingInfo[effectiveIndex].isSelected == true)
390 settingInfo[effectiveIndex].isSelected = false;
394 settingInfo[effectiveIndex].isSelected = true;
396 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
399 __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
403 switch (effectiveIndex)
405 case SETTING_CURRENT_PAGE:
406 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
407 AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
408 if (__currentURL.CompareTo(L"") != 0)
410 AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
411 SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
412 SettingPresentationModel::GetInstance()->SetFavoriteValue(__currentURL);
413 settingInfo[SETTING_FAVORITE_URL].titleText = __currentURL;
414 // listView.RefreshList(groupIndex, effectiveIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
415 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
416 listView.UpdateList();
419 case SETTING_BLANK_PAGE:
420 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_BLANK_PAGE].titleText);
421 SettingPresentationModel::GetInstance()->SetHomepage((L"IDS_BR_BODY_BLANK_PAGE"));
422 AppLog("GetHomepage() %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
423 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
424 listView.UpdateList();
427 case SETTING_MOST_VISITED_SITE:
428 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
429 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
430 listView.UpdateList();
433 case SETTING_FAVORITE_URL:
434 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
435 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EDIT_HOMEPAGE_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
438 case SETTING_FIT_TO_WIDTH:
439 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_FIT_TO_WIDTH");
440 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
441 listView.UpdateList();
444 case SETTING_READABLE:
445 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_READABLE");
446 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
447 listView.UpdateList();
450 case SETTING_RUN_JAVASCRIPT:
451 SettingPresentationModel::GetInstance()->SetRunJavascriptEnabled(settingInfo[SETTING_RUN_JAVASCRIPT].isSelected);
454 case SETTING_DISPLAY_IMAGES:
455 SettingPresentationModel::GetInstance()->SetDisplayImagesEnabled(settingInfo[SETTING_DISPLAY_IMAGES].isSelected);
458 case SETTING_BLOCK_POPUP:
459 SettingPresentationModel::GetInstance()->SetBlockPopUp(!settingInfo[SETTING_BLOCK_POPUP].isSelected);
462 case SETTING_CLEAR_CACHE:
466 case SETTING_CLEAR_HISTORY:
470 case SETTING_SHOW_SECURITY_WARNINGS:
471 SettingPresentationModel::GetInstance()->SetSecurityWarningsEnabled(settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected);
474 case SETTING_ACCEPT_COOKIES:
475 SettingPresentationModel::GetInstance()->SetCookiesEnabled(settingInfo[SETTING_ACCEPT_COOKIES].isSelected);
478 case SETTING_CLEAR_COOKIE_DATA:
482 case SETTING_REMEMBER_FORM_DATA:
483 SettingPresentationModel::GetInstance()->SetRememberFormData(settingInfo[SETTING_REMEMBER_FORM_DATA].isSelected);
486 case SETTING_CLEAR_FORM_DATA:
490 case SETTING_CLEAR_PASSWORDS:
494 case SETTING_REMEMBER_PASSWORD:
495 SettingPresentationModel::GetInstance()->SetRememberPassword(settingInfo[SETTING_REMEMBER_PASSWORD].isSelected);
498 case SETTING_SEARCH_ENGINE_YAHOO:
499 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText);
500 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
501 listView.UpdateList();
504 case SETTING_SEARCH_ENGINE_NAVER:
505 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText);
506 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
507 listView.UpdateList();
510 case SETTING_SEARCH_ENGINE_GOOGLE:
511 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText);
512 // listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
513 listView.UpdateList();
516 case SETTING_RESET_TO_DEFAULT:
527 SettingForm::OnGroupedListViewItemSwept(GroupedListView& listView, int groupIndex, int itemIndex, SweepDirection direction)
533 SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
535 result r = E_FAILURE;
537 GroupItem* pItem = null;
538 const Color ITEM_TEXT_COLOR = CUSTOM_COLOR_SETTINGS_GROUPTITLE;
540 pItem = new(std::nothrow) GroupItem();
545 r = pItem->Construct(Dimension(itemWidth, 76));
555 text = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE"); // IDS_HOMEPAGE
556 settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
560 text = CommonUtil::GetString(L"IDS_BR_MBODY_PAGE_CONTENT_SETTINGS"); // IDS_BR_MBODY_PAGE_CONTENT_SETTINGS
564 text = CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"); // IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB
568 text = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH"); // IDS_BR_BODY_SEARCH
579 pItem->SetElement(text, null);
581 AppLogDebug("background color set result %s", GetErrorMessage(r));
583 pItem->SetTextColor(ITEM_TEXT_COLOR);
588 SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
590 AppLog("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d ", groupIndex, itemIndex, itemWidth);
592 result r = E_SUCCESS;
593 int effectiveIndex = 0;
594 const Color ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND;
595 const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
596 const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED;
598 for (int i = 0; i < groupIndex; i++)
599 effectiveIndex = effectiveIndex + pGroupItemCount[i];
600 effectiveIndex = effectiveIndex + itemIndex;
601 AppLogDebug("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
603 if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
605 SettingToggleCustomItem* pItem = new(std::nothrow) SettingToggleCustomItem();
606 r = pItem->Construct(itemWidth, 112 + (__fontSize - 44));
613 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
614 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
617 __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
620 pItem->SetText(settingInfo[effectiveIndex].titleText);
626 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
628 DropDownCustomItem* pItem = new(std::nothrow) DropDownCustomItem();
629 r = pItem->Construct(itemWidth);
636 /* Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,128);
637 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
639 if (pNormalBackgroundBitmap != NULL)
641 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
642 delete pNormalBackgroundBitmap;
645 if (pPressedBackgroundBitmap != NULL)
647 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
648 delete pPressedBackgroundBitmap;
651 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
652 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
654 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
655 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)
657 pItem->SetSubText(CommonUtil::GetString(settingInfo[effectiveIndex].subText));
661 pItem->SetSubText(settingInfo[effectiveIndex].subText);
663 if (settingInfo[effectiveIndex].isOpen)
665 pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
669 pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED);
672 // if (pBitmap != null)
673 // pItem->AddElement(Rectangle(0, 0, 10, 128), IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN, *pBitmap, null);
683 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
685 RadioCustomItem* pItem = new(std::nothrow) RadioCustomItem();
687 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
689 if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
692 if (settingInfo[parentIndex].isOpen == false || (__isCurrentPageDisable == true && groupIndex == 0 && itemIndex == 1))
694 r = pItem->Construct(itemWidth, 0);
695 __pList->SetItemEnabled(groupIndex,itemIndex,false);
696 AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
701 __pList->SetItemEnabled(groupIndex,itemIndex,true);
702 pItem->Construct(itemWidth, 112 + (__fontSize - 44));
705 Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
706 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
708 if (pNormalBackgroundBitmap != NULL)
710 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
711 delete pNormalBackgroundBitmap;
714 if (pPressedBackgroundBitmap != NULL)
716 pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
717 delete pPressedBackgroundBitmap;
720 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
721 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
724 pItem->SetText(settingInfo[effectiveIndex].titleText);
725 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
727 //if (pBitmap != null)
728 // pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
730 // pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
731 __pList->SetItemChecked(groupIndex,itemIndex,settingInfo[effectiveIndex].isSelected);
736 else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_NORMAL)
738 DefaultCustomItem* pItem = new(std::nothrow) DefaultCustomItem();
740 r = pItem->Construct(itemWidth, 112 + (__fontSize - 44));
748 // Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
749 // Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
751 // if (pNormalBackgroundBitmap != NULL)
753 // pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
754 // delete pNormalBackgroundBitmap;
757 // if (pPressedBackgroundBitmap != NULL)
759 // pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
760 // delete pPressedBackgroundBitmap;
763 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
764 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
767 pItem->SetText(settingInfo[effectiveIndex].titleText);
769 //if (pBitmap != null)
770 // pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
787 SettingForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
795 SettingForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
803 SettingForm::GetGroupCount(void)
809 SettingForm::GetItemCount(int groupIndex)
811 AppLog(" SettingForm::GetItemCount --> groupIndex : %d,", groupIndex);
812 return pGroupItemCount[groupIndex];
816 SettingForm::OnFormBackRequested(Form& source)
818 AppLog("SettingForm::OnFormBackRequested entered");
819 String* pSelectedScene = NULL;
820 Object* value = NULL;
821 MultipleWindowPresentationModel::GetInstance()->GetValue(SELECTED_SCENE_ID, &value);
822 pSelectedScene = (String*) value;
825 SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(*pSelectedScene, SCENE_TRANSITION_ANIMATION_TYPE_NONE));
826 // delete pSelectedScene;
827 // pSelectedScene = null;
832 SettingForm::OnActionPerformed(const Control& source, int actionId)
837 if(__pConfirmationPopup)
839 __pConfirmationPopup->SetShowState(false);
840 __pConfirmationPopup->Show();
841 delete __pConfirmationPopup;
842 __pConfirmationPopup = null;
847 if(__pConfirmationPopup)
849 String message = L"";
850 __pConfirmationPopup->SetShowState(false);
851 __pConfirmationPopup->Show();
852 if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO"))
854 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
855 SettingPresentationModel::GetInstance()->ClearCookie();
857 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_FORM_DATA_Q"))
859 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
860 SettingPresentationModel::GetInstance()->ClearFormData();
862 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_PASSWORDS_Q"))
864 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
865 SettingPresentationModel::GetInstance()->ClearPasswords();
867 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q"))
869 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
870 SettingPresentationModel::GetInstance()->ClearCache();
872 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q"))
874 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
875 HistoryPresentationModel::GetInstance()->ClearHistory();
877 else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_ALL_SETTINGS_TO_DEFAULT_CONTINUE_Q"))
879 message = CommonUtil::GetString(L"IDS_BR_SK_DONE");
880 SettingPresentationModel::GetInstance()->ResetRegistry();
881 InitializeSettingValues();
884 __pList->UpdateList();
887 delete __pConfirmationPopup;
888 __pConfirmationPopup = null;
890 if (__pNotification != null)
892 RemoveControl(__pNotification);
893 __pNotification = null;
895 __pNotification = new (std::nothrow) NotificationPanel(*this);
897 //NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
898 __pNotification->SetText(message);
899 __pNotification->SetPositionDiff(0);
900 __pNotification->ShowNotification();
910 SettingForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
912 Rectangle rect = GetClientAreaBounds();
914 if (__pNotification != null && __pNotification->GetShowState() == true)
916 __pNotification->OrientationChanged();
923 __pList->SetBounds(rect.x,rect.y,rect.width-16,rect.height);
924 // __pList->UpdateList();//removed for issue 53768
927 SettingForm::SettingItemInfo::SettingItemInfo(void)
936 SettingForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
938 WindowInfo* pWindowInfo = null;
939 String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
941 pWindowInfo = MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo();
943 if (previousSceneId == IDSCN_EDIT_HOMEPAGE_VIEW)
947 String* pValue = NULL;
948 pValue = dynamic_cast<String*>(pArgs->GetAt(0));
951 if (pValue->CompareTo(L"Done") == 0)
953 // SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
955 else if (pValue->CompareTo(L"Cancel") == 0)
957 String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
958 if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
960 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
961 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
962 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
963 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
964 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
967 else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
969 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
970 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
971 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
972 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
973 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
977 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
978 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
979 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
980 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
988 if (pWindowInfo != null)
990 __currentURL.Clear();
991 __currentURL.Append(pWindowInfo->pageUrl);
992 AppLog("current url is %ls",__currentURL.GetPointer());
994 if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
996 if (pWindowInfo->pageUrl.CompareTo(L"") == 0)
998 //settingInfo[SETTING_FAVORITE_URL].titleText = CommonUtil::GetString(L"IDS_SET_HOMEPAGE");
999 settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
1003 settingInfo[SETTING_FAVORITE_URL].titleText = pWindowInfo->pageUrl;
1008 settingInfo[SETTING_FAVORITE_URL].titleText = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
1012 if (__pList != null)
1014 __pList->UpdateList();
1015 if (pWindowInfo && pWindowInfo->pageUrl.CompareTo(L"") == 0)
1017 __isCurrentPageDisable = true;
1018 AppLog("set item enabled is false");
1019 __pList->SetItemEnabled(0, 1, false);
1023 __isCurrentPageDisable = false;
1024 AppLog("set item enabled is true");
1025 if (settingInfo[0].isOpen == false)
1027 __pList->SetItemEnabled(0,1,false);
1031 __pList->SetItemEnabled(0,1,true);
1034 for(int grpindex = 0; grpindex < groupCount; grpindex++)
1036 for(int index = 0; index < *(pGroupItemCount+groupCount); index++)
1038 int effectiveIndex = 0;
1039 for (int i = 0; i < grpindex; i++)
1040 effectiveIndex = effectiveIndex + pGroupItemCount[i];
1041 effectiveIndex = effectiveIndex + index;
1043 if(effectiveIndex >= SETTING_MAX)
1047 if(settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE || settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO )
1049 __pList->SetItemChecked(grpindex, index, settingInfo[effectiveIndex].isSelected);
1058 SettingForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1064 SettingForm::ClearHistory(void)
1066 if(__pConfirmationPopup)
1068 __pConfirmationPopup->SetShowState(false);
1069 __pConfirmationPopup->Show();
1070 delete __pConfirmationPopup;
1071 __pConfirmationPopup = null;
1073 String message = CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q");
1074 if(!__pConfirmationPopup)
1076 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1077 __pConfirmationPopup->Initialize();
1078 __pConfirmationPopup->RemoveActionListener(*this);
1079 __pConfirmationPopup->AddActionListener(*this);
1080 __pConfirmationPopup->setMessage(message);
1081 __pConfirmationPopup->Show();
1086 SettingForm::ClearCache(void)
1088 if(__pConfirmationPopup)
1090 __pConfirmationPopup->SetShowState(false);
1091 __pConfirmationPopup->Show();
1092 delete __pConfirmationPopup;
1093 __pConfirmationPopup = null;
1095 String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q");
1096 if(!__pConfirmationPopup)
1098 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1099 __pConfirmationPopup->Initialize();
1100 __pConfirmationPopup->RemoveActionListener(*this);
1101 __pConfirmationPopup->AddActionListener(*this);
1102 __pConfirmationPopup->setMessage(message);
1103 __pConfirmationPopup->Show();
1108 SettingForm::ClearCookie(void)
1110 if(__pConfirmationPopup)
1112 __pConfirmationPopup->SetShowState(false);
1113 __pConfirmationPopup->Show();
1114 delete __pConfirmationPopup;
1115 __pConfirmationPopup = null;
1117 String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO");
1118 if(!__pConfirmationPopup)
1120 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1121 __pConfirmationPopup->Initialize();
1122 __pConfirmationPopup->RemoveActionListener(*this);
1123 __pConfirmationPopup->AddActionListener(*this);
1124 __pConfirmationPopup->setMessage(message);
1125 __pConfirmationPopup->Show();
1130 SettingForm::ClearFormData(void)
1132 if(__pConfirmationPopup)
1134 __pConfirmationPopup->SetShowState(false);
1135 __pConfirmationPopup->Show();
1136 delete __pConfirmationPopup;
1137 __pConfirmationPopup = null;
1139 String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_FORM_DATA_Q");
1140 if(!__pConfirmationPopup)
1142 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1143 __pConfirmationPopup->Initialize();
1144 __pConfirmationPopup->RemoveActionListener(*this);
1145 __pConfirmationPopup->AddActionListener(*this);
1146 __pConfirmationPopup->setMessage(message);
1147 __pConfirmationPopup->Show();
1152 SettingForm::ClearPasswords(void)
1154 if(__pConfirmationPopup)
1156 __pConfirmationPopup->SetShowState(false);
1157 __pConfirmationPopup->Show();
1158 delete __pConfirmationPopup;
1159 __pConfirmationPopup = null;
1161 String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_PASSWORDS_Q");
1162 if(!__pConfirmationPopup)
1164 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1165 __pConfirmationPopup->Initialize();
1166 __pConfirmationPopup->RemoveActionListener(*this);
1167 __pConfirmationPopup->AddActionListener(*this);
1168 __pConfirmationPopup->setMessage(message);
1169 __pConfirmationPopup->Show();
1175 SettingForm::ResetToDefault()
1177 if(__pConfirmationPopup)
1179 __pConfirmationPopup->SetShowState(false);
1180 __pConfirmationPopup->Show();
1181 delete __pConfirmationPopup;
1182 __pConfirmationPopup = null;
1184 String message = CommonUtil::GetString(L"IDS_BR_POP_ALL_SETTINGS_TO_DEFAULT_CONTINUE_Q");
1185 if(!__pConfirmationPopup)
1187 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1188 __pConfirmationPopup->Initialize();
1189 __pConfirmationPopup->RemoveActionListener(*this);
1190 __pConfirmationPopup->AddActionListener(*this);
1191 __pConfirmationPopup->setMessage(message);
1192 __pConfirmationPopup->Show();
1197 SettingForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
1199 AppLog("receiving userevent for appcontrol %d",requestId);
1200 if (requestId == APPCONTROL_LAUNCH_MAX_LIMIT_REACHED)
1202 AppLog("receiving userevent for appcontrol %d ",requestId);
1203 if(__pConfirmationPopup)
1205 __pConfirmationPopup->SetShowState(false);
1206 delete __pConfirmationPopup;
1207 __pConfirmationPopup = null;