Merge " Fixed issue 52825" into tizen_2.2
[apps/osp/Gallery.git] / src / GlSettingMainForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                GlSettingMainForm.cpp
19  * @brief               This is the implementation file for SettingMainForm class.
20  */
21
22 #include "GlDropDownCustomItem.h"
23 #include "GlFileListPresentationModel.h"
24 #include "GlGalleryApp.h"
25 #include "GlRadioCustomItem.h"
26 #include "GlResourceManager.h"
27 #include "GlSettingMainForm.h"
28 #include "GlSettingPresentationModel.h"
29 #include "GlSettingToggleCustomItem.h"
30 #include "GlTypes.h"
31
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Content;
36 using namespace Tizen::Graphics;
37 using namespace Tizen::System;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
41
42 SettingMainForm::SettingMainForm(void)
43         : __pList(null)
44         , __pPresentationModel(null)
45         , __contentUpdated(false)
46 {
47         AppLogDebug("ENTER");
48         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
49 }
50
51 SettingMainForm::~SettingMainForm(void)
52 {
53         AppLogDebug("ENTER");
54         if (pGroupItemCount)
55         {
56                 delete[] pGroupItemCount;
57         }
58         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
59 }
60
61 result
62 SettingMainForm::Initialize(void)
63 {
64         AppLogDebug("ENTER");
65         result r = Form::Construct(IDL_FORM_SETTING_MAIN);
66         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
67
68         return r;
69 }
70
71 result
72 SettingMainForm::OnInitializing(void)
73 {
74         AppLogDebug("ENTER");
75         __pPresentationModel = SettingPresentationModel::GetInstance();
76         SettingInfo::AddSettingEventListener(*this);
77
78         Header* pHeader = GetHeader();
79         AppAssert(pHeader);
80         pHeader->SetStyle(HEADER_STYLE_TITLE);
81         pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_GALLERY"));
82
83         __pList = static_cast<GroupedListView*>(GetControl(L"IDC_SETTING_LIST"));
84
85         if (__pList != null)
86         {
87                 __pList->SetItemProvider(*this);
88                 __pList->AddGroupedListViewItemEventListener(*this);
89         }
90
91         SetFormBackEventListener(this);
92         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
93
94         return E_SUCCESS;
95 }
96
97 result
98 SettingMainForm::OnTerminating(void)
99 {
100         AppLogDebug("ENTER");
101         SettingInfo::RemoveSettingEventListener(*this);
102         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
103
104         return E_SUCCESS;
105 }
106
107 void
108 SettingMainForm::OnActionPerformed(const Control& source, int actionId)
109 {
110         AppLogDebug("ENTER");
111         SceneManager* pSceneManager = SceneManager::GetInstance();
112         AppAssert(pSceneManager);
113
114         switch (actionId)
115         {
116         default:
117         {
118                 break;
119         }
120         }
121         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
122 }
123
124 void
125 SettingMainForm::OnFormBackRequested(Form& source)
126 {
127         AppLogDebug("ENTER");
128
129         GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
130         if (pApp != null)
131         {
132                 if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_CONFIGURE)
133                 {
134                         if (pApp->GetFrameActivated() == true)
135                         {
136                                 pApp->SendAppControlResult(APP_CTRL_RESULT_TERMINATED, null);
137                                 pApp->Terminate();
138                         }
139                 }
140                 else
141                 {
142                         SceneManager* pSceneManager = SceneManager::GetInstance();
143                         if (__contentUpdated)
144                         {
145                                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
146                         }
147                         else
148                         {
149                                 pSceneManager->GoBackward(BackwardSceneTransition());
150                         }
151                 }
152         }
153
154         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
155 }
156
157 void
158 SettingMainForm::OnContentUpdated(void)
159 {
160         AppLogDebug("ENTER");
161         __contentUpdated = true;
162         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
163 }
164
165 void
166 SettingMainForm::OnSceneActivatedN(const SceneId& previousSceneId,
167                 const SceneId& currentSceneId, IList* pArgs)
168 {
169         AppLogDebug("ENTER");
170         FileListPresentationModel::GetInstance()->AddContentEventListener(this);
171         __pPresentationModel->CreateDefaultRegistry();
172         InitializeSettingValues();
173         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
174 }
175
176 void
177 SettingMainForm::OnSceneDeactivated(const SceneId& currentSceneId,
178                 const SceneId& nextSceneId)
179 {
180         AppLogDebug("ENTER");
181         __pPresentationModel->DeleteRegistry();
182         FileListPresentationModel::GetInstance()->RemoveContentEventListener(this);
183         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
184 }
185
186 void
187 SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListItemStatus status)
188 {
189         int effectiveIndex = 0;
190         int inputValue = 0;
191
192         effectiveIndex = effectiveIndex + itemIndex;
193
194         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
195         {
196                 AppLogDebug("refreshing data child count is %d", settingInfo[effectiveIndex].childCount);
197                 if (settingInfo[effectiveIndex].isOpen == false)
198                 {
199                         settingInfo[effectiveIndex].isOpen = true;
200                         settingInfo[effectiveIndex].childCount = 0;
201                         for (int iter = effectiveIndex + 1; iter < SETTING_MAX; ++iter)
202                         {
203                                 if (settingInfo[iter].itemType == ITEM_TYPE_RADIO)
204                                 {
205                                         ++settingInfo[effectiveIndex].childCount;
206                                 }
207                                 else
208                                 {
209                                         break;
210                                 }
211                         }
212                         listView.UpdateList();
213                 }
214                 else
215                 {
216                         settingInfo[effectiveIndex].isOpen = false;
217                         listView.UpdateList();
218                 }
219         }
220         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
221         {
222                 int parentIndex = 0;
223                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
224                 {
225                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
226                         {
227                                 break;
228                         }
229                 }
230                 settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText;
231
232                 for (int iter = 0; iter < settingInfo[parentIndex].childCount; ++iter)
233                 {
234                         if (parentIndex + iter + 1 != effectiveIndex)
235                         {
236                                 AppLogDebug("long effectiveIndex %d set to false", itemIndex - (effectiveIndex - parentIndex) + iter + 1);
237                                 settingInfo[parentIndex + iter + 1].isSelected = false;
238                         }
239                         else
240                         {
241                                 AppLogDebug("effectiveIndex %d set to true", effectiveIndex);
242                                 settingInfo[effectiveIndex].isSelected = true;
243                         }
244                 }
245
246                 Invalidate(true);
247         }
248         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
249         {
250                 if (settingInfo[effectiveIndex].isSelected == true)
251                 {
252                         settingInfo[effectiveIndex].isSelected = false;
253                 }
254                 else
255                 {
256                         settingInfo[effectiveIndex].isSelected = true;
257                 }
258                 if (__pList != null)
259                 {
260                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
261                 }
262         }
263
264         switch (effectiveIndex)
265         {
266         case SETTING_INTERVAL_2:
267         {
268                 inputValue = 2;
269                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL,
270                                 inputValue);
271                 listView.UpdateList();
272         }
273         break;
274
275         case SETTING_INTERVAL_3:
276         {
277                 inputValue = 3;
278                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
279                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
280                 listView.UpdateList();
281         }
282         break;
283
284         case SETTING_INTERVAL_5:
285         {
286                 inputValue = 5;
287                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
288                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
289                 listView.UpdateList();
290         }
291         break;
292
293         case SETTING_INTERVAL_10:
294         {
295                 inputValue = 10;
296                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
297                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
298                 listView.UpdateList();
299         }
300         break;
301
302         case SETTING_INTERVAL_20:
303         {
304                 inputValue = 20;
305                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
306                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
307                 listView.UpdateList();
308         }
309         break;
310
311         case SETTING_TRANSITION_PAGE:
312         {
313                 inputValue = 0;
314                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
315                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, inputValue);
316                 listView.UpdateList();
317         }
318         break;
319
320         case SETTING_TRANSITION_DISSOLVE:
321         {
322                 inputValue = 1;
323                 result r = __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
324                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, inputValue);
325                 if (r == E_SUCCESS)
326                 {
327                         AppLogDebug(" Passed");
328                 }
329
330                 listView.UpdateList();
331         }
332         break;
333
334         case SETTING_TRANSITION_ZOOM:
335         {
336                 inputValue = 2;
337                  __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
338                                 ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, inputValue);
339                 listView.UpdateList();
340         }
341         break;
342
343         case SETTING_REPEAT:
344         {
345                 int repeatValue = 0;
346
347                 __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
348                                 ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
349
350                 if (repeatValue == 0)
351                 {
352                         inputValue = 1;
353                 }
354                 else
355                 {
356                         inputValue = 0;
357                 }
358
359                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
360                                 ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, inputValue);
361         }
362         break;
363
364         case SETTING_SHUFFLE:
365         {
366                 int shuffleValue = 0;
367
368                 __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
369                                 ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffleValue);
370
371                 if (shuffleValue == 0)
372                 {
373                         inputValue = 1;
374                 }
375                 else
376                 {
377                         inputValue = 0;
378                 }
379
380                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
381                                 ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, inputValue);
382         }
383         break;
384
385         default:
386                 break;
387         }
388 }
389
390 GroupItem*
391 SettingMainForm::CreateGroupItem(int groupIndex, int itemWidth)
392 {
393         GroupItem* pItem = new (std::nothrow) GroupItem();
394         if (pItem == null)
395         {
396                 return null;
397         }
398         result r = pItem->Construct(Dimension(itemWidth, 46));
399         if (IsFailed(r))
400         {
401                 delete pItem;
402                 return null;
403         }
404
405         String text;
406         switch (groupIndex)
407         {
408         case 0:
409                 text = ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW");
410         break;
411
412         default:
413                 break;
414         }
415
416         pItem->SetElement(text, null);
417
418         AppLogDebug("background color set result %s", GetErrorMessage(r));
419
420         pItem->SetTextColor(CUSTOM_COLOR_SETTINGS_GROUPTITLE);
421         return pItem;
422 }
423
424 ListItemBase*
425 SettingMainForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
426 {
427         AppLog("SettingMainForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d ", groupIndex, itemIndex,
428                         itemWidth);
429
430         result r = E_SUCCESS;
431         int effectiveIndex = 0;
432         const Color ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND;
433         const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
434         const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED;
435
436         effectiveIndex = effectiveIndex + itemIndex;
437         AppLogDebug("SettingMainForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
438
439         String fontSizeStr;
440         int fontSize = 0;
441         int itemHeight = 0;
442         int defaultHeight = 112;
443         int defaultFontSize = 44;
444
445         SettingInfo::GetValue("http://tizen.org/setting/font.size", fontSizeStr);
446         AppLog("the font value is %S",fontSizeStr.GetPointer());
447
448         if(fontSizeStr == "medium")
449         {
450                 fontSize = 44;
451                 itemHeight = defaultHeight + (fontSize - defaultFontSize);
452         }
453         else if(fontSizeStr == "huge")
454         {
455                 fontSize =  81;
456                 itemHeight = defaultHeight + (fontSize - defaultFontSize);
457         }
458         else if(fontSizeStr == "giant")
459         {
460                 fontSize = 98;
461                 itemHeight = defaultHeight + (fontSize - defaultFontSize);
462         }
463         else if(fontSizeStr == "small")
464         {
465                 fontSize = 36;
466                 itemHeight = defaultHeight + (fontSize - defaultFontSize);
467         }
468         else if(fontSizeStr == "large")
469         {
470                 fontSize = 64;
471                 itemHeight = defaultHeight + (fontSize - defaultFontSize);
472         }
473         else
474         {
475                 fontSize = 44;
476                 itemHeight = defaultHeight;
477         }
478
479
480         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
481         {
482                 SettingToggleCustomItem* pItem = new (std::nothrow) SettingToggleCustomItem();
483                 r = pItem->Construct(itemWidth, itemHeight);
484
485                 if (IsFailed(r))
486                 {
487                         delete pItem;
488                         return null;
489                 }
490
491                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_BACKGROUND_COLOR);
492                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
493
494                 if (__pList != null)
495                 {
496                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
497                 }
498
499                 pItem->SetText(settingInfo[effectiveIndex].titleText);
500                 pItem->Make(fontSize);
501
502                 return pItem;
503         }
504         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
505         {
506                 DropDownCustomItem* pItem = new (std::nothrow) DropDownCustomItem();
507                 r = pItem->Construct(itemWidth,itemHeight);
508                 if (IsFailed(r))
509                 {
510                         delete pItem;
511                         return null;
512                 }
513
514                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_BACKGROUND_COLOR);
515                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
516
517                 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
518                 pItem->SetSubText(settingInfo[effectiveIndex].subText);
519                 if (settingInfo[effectiveIndex].isOpen)
520                 {
521                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
522                 }
523                 else
524                 {
525                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_CLOSED);
526                 }
527
528                 r = pItem->Make(fontSize,itemHeight);
529
530                 if (IsFailed(r))
531                 {
532                         delete pItem;
533                         return null;
534                 }
535
536                 return pItem;
537         }
538         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
539         {
540                 RadioCustomItem* pItem = new (std::nothrow) RadioCustomItem();
541                 int parentIndex = 0;
542
543                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
544                 {
545                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
546                                 break;
547                 }
548
549                 if (settingInfo[parentIndex].isOpen == false)
550                 {
551                         r = pItem->Construct(itemWidth, 0);
552                         __pList->SetItemEnabled(groupIndex, itemIndex,false);
553                         AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
554                         return pItem;
555                 }
556                 else
557                 {
558                         pItem->Construct(itemWidth, itemHeight);
559                         __pList->SetItemEnabled(groupIndex, itemIndex, true);
560                 }
561
562                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_RADIO_ITEM_BACKGROUND_COLOR);
563                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
564
565                 pItem->SetText(settingInfo[effectiveIndex].titleText);
566                 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
567
568                 __pList->SetItemChecked(groupIndex,itemIndex,settingInfo[effectiveIndex].isSelected);
569                 pItem->Make(fontSize);
570
571                 return pItem;
572         }
573         else
574         {
575                 return null;
576         }
577 }
578
579 bool
580 SettingMainForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
581 {
582         delete pItem;
583         return true;
584 }
585
586 bool
587 SettingMainForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
588 {
589         delete pItem;
590         return true;
591 }
592
593 int
594 SettingMainForm::GetGroupCount(void)
595 {
596         int groupCount = 1;
597
598         return groupCount;
599 }
600
601 int
602 SettingMainForm::GetItemCount(int groupIndex)
603 {
604         AppLog(" SettingMainForm::GetItemCount --> groupIndex : %d,", groupIndex);
605         return pGroupItemCount[groupIndex];
606 }
607
608 void
609 SettingMainForm::InitializeSettingValues(void)
610 {
611         pGroupItemCount = new (std::nothrow) int[1];
612         pGroupItemCount[0] = 12;
613         int interval = 0;
614         int transitionValue = 0;
615         int repeatValue = 0;
616         int shuffletValue = 0;
617         String selectedInterval;
618         String selectedTransition;
619
620         for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; ++iter)
621         {
622                 settingInfo[iter].isSelected = false;
623         }
624
625         result r =__pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL,
626                         interval);
627
628         if (r == E_SUCCESS)
629         {
630                 switch (interval)
631                 {
632                 case 2:
633                 {
634                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
635                         settingInfo[SETTING_INTERVAL_2].isSelected = true;
636                 }
637                 break;
638
639                 case 3:
640                 {
641                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_OPT_3_SECONDS");
642                         settingInfo[SETTING_INTERVAL_3].isSelected = true;
643                 }
644                 break;
645
646                 case 5:
647                 {
648                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_5_SECONDS");
649                         settingInfo[SETTING_INTERVAL_5].isSelected = true;
650                 }
651                 break;
652
653                 case 10:
654                 {
655                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_10_SECONDS");
656                         settingInfo[SETTING_INTERVAL_10].isSelected = true;
657                 }
658                 break;
659
660                 case 20:
661                 {
662                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_20_SECONDS");
663                         settingInfo[SETTING_INTERVAL_20].isSelected = true;
664                 }
665                 break;
666
667                 default:
668                         break;
669                 }
670         }
671
672         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
673                         ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, transitionValue);
674
675         if (r == E_SUCCESS)
676         {
677                 switch (transitionValue)
678                 {
679                 case 0:
680                 {
681                         selectedTransition = ResourceManager::GetString(L"IDS_EBOOK_BODY_PAGE");
682                         settingInfo[SETTING_TRANSITION_PAGE].isSelected = true;
683                 }
684                 break;
685
686                 case 1:
687                 {
688                         selectedTransition = ResourceManager::GetString(L"IDS_MEDIABR_BODY_DISSOLVE");
689                         settingInfo[SETTING_TRANSITION_DISSOLVE].isSelected = true;
690                 }
691                 break;
692
693                 case 2:
694                 {
695                         selectedTransition = ResourceManager::GetString(L"IDS_IV_OPT_ZOOM");
696                         settingInfo[SETTING_TRANSITION_ZOOM].isSelected = true;
697                 }
698                 break;
699
700                 default:
701                         break;
702                 }
703         }
704
705         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_SLIDESHOW_INTERVAL");
706         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].subText = selectedInterval;
707         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].itemType = ITEM_TYPE_DROPDOWN;
708
709         settingInfo[SETTING_INTERVAL_2].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
710         settingInfo[SETTING_INTERVAL_2].subText = L"";
711         settingInfo[SETTING_INTERVAL_2].itemType = ITEM_TYPE_RADIO;
712
713         settingInfo[SETTING_INTERVAL_3].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_3_SECONDS");
714         settingInfo[SETTING_INTERVAL_3].subText = L"";
715         settingInfo[SETTING_INTERVAL_3].itemType = ITEM_TYPE_RADIO;
716
717         settingInfo[SETTING_INTERVAL_5].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_5_SECONDS");
718         settingInfo[SETTING_INTERVAL_5].subText = L"";
719         settingInfo[SETTING_INTERVAL_5].itemType = ITEM_TYPE_RADIO;
720
721         settingInfo[SETTING_INTERVAL_10].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_10_SECONDS");
722         settingInfo[SETTING_INTERVAL_10].subText = L"";
723         settingInfo[SETTING_INTERVAL_10].itemType = ITEM_TYPE_RADIO;
724
725         settingInfo[SETTING_INTERVAL_20].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_20_SECONDS");
726         settingInfo[SETTING_INTERVAL_20].subText = L"";
727         settingInfo[SETTING_INTERVAL_20].itemType = ITEM_TYPE_RADIO;
728
729         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
730
731         settingInfo[SETTING_REPEAT].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_REPEAT");
732         settingInfo[SETTING_REPEAT].itemType = ITEM_TYPE_TOGGLE;
733
734         if (repeatValue == 0)
735         {
736                 settingInfo[SETTING_REPEAT].isSelected = false;
737         }
738         else
739         {
740                 settingInfo[SETTING_REPEAT].isSelected = true;
741         }
742
743         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
744                         ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffletValue);
745
746         settingInfo[SETTING_SHUFFLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_SHUFFLE");
747         settingInfo[SETTING_SHUFFLE].itemType = ITEM_TYPE_TOGGLE;
748
749         if (shuffletValue == 0)
750         {
751                 settingInfo[SETTING_SHUFFLE].isSelected = false;
752         }
753         else
754         {
755                 settingInfo[SETTING_SHUFFLE].isSelected = true;
756         }
757
758         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_TRANSITION_EFFECT");
759         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].subText = selectedTransition;
760         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].itemType = ITEM_TYPE_DROPDOWN;
761
762         settingInfo[SETTING_TRANSITION_PAGE].titleText = ResourceManager::GetString(L"IDS_EBOOK_BODY_PAGE");
763         settingInfo[SETTING_TRANSITION_PAGE].subText = L"";
764         settingInfo[SETTING_TRANSITION_PAGE].itemType = ITEM_TYPE_RADIO;
765
766         settingInfo[SETTING_TRANSITION_DISSOLVE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_DISSOLVE");
767         settingInfo[SETTING_TRANSITION_DISSOLVE].subText = L"";
768         settingInfo[SETTING_TRANSITION_DISSOLVE].itemType = ITEM_TYPE_RADIO;
769
770         settingInfo[SETTING_TRANSITION_ZOOM].titleText = ResourceManager::GetString(L"IDS_IV_OPT_ZOOM");
771         settingInfo[SETTING_TRANSITION_ZOOM].subText = L"";
772         settingInfo[SETTING_TRANSITION_ZOOM].itemType = ITEM_TYPE_RADIO;
773 }
774
775 SettingMainForm::SettingItemInfo::SettingItemInfo(void)
776         : childCount(0)
777         , isOpen(false)
778         , isSelected(false)
779 {
780 }
781
782
783 void
784 SettingMainForm::OnSettingChanged(String& key)
785 {
786         AppLogDebug("ENTER");
787         if (key == L"http://tizen.org/setting/font.size")
788         {
789                 __pList->UpdateList();
790         }
791         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
792 }