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