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