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