NSE_41049
[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 {
46         AppLogDebug("ENTER");
47         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
48 }
49
50 SettingMainForm::~SettingMainForm(void)
51 {
52         AppLogDebug("ENTER");
53         if (pGroupItemCount)
54         {
55                 delete[] pGroupItemCount;
56         }
57         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
58 }
59
60 result
61 SettingMainForm::Initialize(void)
62 {
63         AppLogDebug("ENTER");
64         result r = Form::Construct(IDL_FORM_SETTING_MAIN);
65         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
66
67         return r;
68 }
69
70 result
71 SettingMainForm::OnInitializing(void)
72 {
73         AppLogDebug("ENTER");
74         __pPresentationModel = SettingPresentationModel::GetInstance();
75
76         InitializeSettingValues();
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         Footer* pFooter = GetFooter();
92         if (pFooter)
93         {
94                 AppLogDebug("setting back button");
95                 pFooter->SetBackButtonEnabled(true);
96         }
97
98         SetFormBackEventListener(this);
99         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
100
101         return E_SUCCESS;
102 }
103
104 result
105 SettingMainForm::OnTerminating(void)
106 {
107         AppLogDebug("ENTER");
108         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
109
110         return E_SUCCESS;
111 }
112
113 void
114 SettingMainForm::OnActionPerformed(const Control& source, int actionId)
115 {
116         AppLogDebug("ENTER");
117         SceneManager* pSceneManager = SceneManager::GetInstance();
118         AppAssert(pSceneManager);
119
120         switch (actionId)
121         {
122         default:
123         {
124                 break;
125         }
126         }
127         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
128 }
129
130 void
131 SettingMainForm::OnFormBackRequested(Form& source)
132 {
133         AppLogDebug("ENTER");
134
135         GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
136         if (pApp != null)
137         {
138                 if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_CONFIGURE)
139                 {
140                         pApp->SendAppControlResult(APP_CTRL_RESULT_TERMINATED, null);
141                         pApp->Terminate();
142                 }
143                 else
144                 {
145                         SceneManager* pSceneManager = SceneManager::GetInstance();
146                         if (__contentUpdated)
147                         {
148                                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
149                         }
150                         else
151                         {
152                                 pSceneManager->GoBackward(BackwardSceneTransition());
153                         }
154                 }
155         }
156
157         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
158 }
159
160 void
161 SettingMainForm::OnContentUpdated(void)
162 {
163         AppLogDebug("ENTER");
164         __contentUpdated = true;
165         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
166 }
167
168 void
169 SettingMainForm::OnSceneActivatedN(const SceneId& previousSceneId,
170                 const SceneId& currentSceneId, IList* pArgs)
171 {
172         AppLogDebug("ENTER");
173         FileListPresentationModel::GetInstance()->AddContentEventListener(this);
174         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
175 }
176
177 void
178 SettingMainForm::OnSceneDeactivated(const SceneId& currentSceneId,
179                 const SceneId& nextSceneId)
180 {
181         AppLogDebug("ENTER");
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_BUTTON_SLIDE_SHOW");
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         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
440         {
441                 SettingToggleCustomItem* pItem = new (std::nothrow) SettingToggleCustomItem();
442                 r = pItem->Construct(itemWidth, 112);
443
444                 if (IsFailed(r))
445                 {
446                         delete pItem;
447                         return null;
448                 }
449
450                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_BACKGROUND_COLOR);
451                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
452
453                 if (__pList != null)
454                 {
455                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
456                 }
457
458                 pItem->SetText(settingInfo[effectiveIndex].titleText);
459                 pItem->Make();
460
461                 return pItem;
462         }
463         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
464         {
465                 DropDownCustomItem* pItem = new (std::nothrow) DropDownCustomItem();
466                 r = pItem->Construct(itemWidth);
467                 if (IsFailed(r))
468                 {
469                         delete pItem;
470                         return null;
471                 }
472
473                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_BACKGROUND_COLOR);
474                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
475
476                 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
477                 pItem->SetSubText(settingInfo[effectiveIndex].subText);
478                 if (settingInfo[effectiveIndex].isOpen)
479                 {
480                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
481                 }
482                 else
483                 {
484                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_CLOSED);
485                 }
486
487                 r = pItem->Make();
488
489                 if (IsFailed(r))
490                 {
491                         delete pItem;
492                         return null;
493                 }
494
495                 return pItem;
496         }
497         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
498         {
499                 RadioCustomItem* pItem = new (std::nothrow) RadioCustomItem();
500                 int parentIndex = 0;
501
502                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
503                 {
504                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
505                                 break;
506                 }
507
508                 if (settingInfo[parentIndex].isOpen == false)
509                 {
510                         r = pItem->Construct(itemWidth, 0);
511                         AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
512                         return pItem;
513                 }
514                 else
515                 {
516                         pItem->Construct(itemWidth, 112);
517                 }
518
519                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_RADIO_ITEM_BACKGROUND_COLOR);
520                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
521
522                 pItem->SetText(settingInfo[effectiveIndex].titleText);
523                 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
524
525                 pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
526                 pItem->Make();
527
528                 return pItem;
529         }
530         else
531         {
532                 return null;
533         }
534 }
535
536 bool
537 SettingMainForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
538 {
539         delete pItem;
540         return true;
541 }
542
543 bool
544 SettingMainForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
545 {
546         delete pItem;
547         return true;
548 }
549
550 int
551 SettingMainForm::GetGroupCount(void)
552 {
553         int groupCount = 1 ;
554
555         return groupCount;
556 }
557
558 int
559 SettingMainForm::GetItemCount(int groupIndex)
560 {
561         AppLog(" SettingMainForm::GetItemCount --> groupIndex : %d,", groupIndex);
562         return pGroupItemCount[groupIndex];
563 }
564
565 void
566 SettingMainForm::InitializeSettingValues(void)
567 {
568         pGroupItemCount = new (std::nothrow) int[1];
569         pGroupItemCount[0] = 13;
570         int interval = 0;
571         int transitionValue = 0;
572         int repeatValue = 0;
573         int shuffletValue = 0;
574         String selectedInterval;
575         String selectedTransition;
576
577         for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; ++iter)
578         {
579                 settingInfo[iter].isSelected = false;
580         }
581
582         result r =__pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL,
583                         interval);
584
585         if (r == E_SUCCESS)
586         {
587                 switch (interval)
588                 {
589                 case 2:
590                 {
591                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
592                         settingInfo[SETTING_INTERVAL_2].isSelected = true;
593                 }
594                 break;
595
596                 case 3:
597                 {
598                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_OPT_3_SECONDS");
599                         settingInfo[SETTING_INTERVAL_3].isSelected = true;
600                 }
601                 break;
602
603                 case 5:
604                 {
605                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_5_SECONDS");
606                         settingInfo[SETTING_INTERVAL_5].isSelected = true;
607                 }
608                 break;
609
610                 case 10:
611                 {
612                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_10_SECONDS");
613                         settingInfo[SETTING_INTERVAL_10].isSelected = true;
614                 }
615                 break;
616
617                 case 20:
618                 {
619                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_20_SECONDS");
620                         settingInfo[SETTING_INTERVAL_20].isSelected = true;
621                 }
622                 break;
623
624                 default:
625                         break;
626                 }
627         }
628
629         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
630                         ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, transitionValue);
631
632         if (r == E_SUCCESS)
633         {
634                 switch (transitionValue)
635                 {
636                 case 0:
637                 {
638                         selectedTransition = ResourceManager::GetString(L"IDS_EBOOK_BODY_PAGE");
639                         settingInfo[SETTING_TRANSITION_PAGE].isSelected = true;
640                 }
641                 break;
642
643                 case 1:
644                 {
645                         selectedTransition = ResourceManager::GetString(L"IDS_MEDIABR_BODY_DISSOLVE");
646                         settingInfo[SETTING_TRANSITION_DISSOLVE].isSelected = true;
647                 }
648                 break;
649
650                 case 2:
651                 {
652                         selectedTransition = ResourceManager::GetString(L"IDS_IV_OPT_ZOOM");
653                         settingInfo[SETTING_TRANSITION_ZOOM].isSelected = true;
654                 }
655                 break;
656
657                 default:
658                         break;
659                 }
660         }
661
662         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_SLIDESHOW_INTERVAL");
663         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].subText = selectedInterval ;
664         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].itemType = ITEM_TYPE_DROPDOWN;
665
666         settingInfo[SETTING_INTERVAL_2].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
667         settingInfo[SETTING_INTERVAL_2].subText = L"";
668         settingInfo[SETTING_INTERVAL_2].itemType = ITEM_TYPE_RADIO;
669
670         settingInfo[SETTING_INTERVAL_3].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_3_SECONDS");
671         settingInfo[SETTING_INTERVAL_3].subText = L"";
672         settingInfo[SETTING_INTERVAL_3].itemType = ITEM_TYPE_RADIO;
673
674         settingInfo[SETTING_INTERVAL_5].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_5_SECONDS");
675         settingInfo[SETTING_INTERVAL_5].subText = L"";
676         settingInfo[SETTING_INTERVAL_5].itemType = ITEM_TYPE_RADIO;
677
678         settingInfo[SETTING_INTERVAL_10].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_10_SECONDS");
679         settingInfo[SETTING_INTERVAL_10].subText = L"";
680         settingInfo[SETTING_INTERVAL_10].itemType = ITEM_TYPE_RADIO;
681
682         settingInfo[SETTING_INTERVAL_20].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_20_SECONDS");
683         settingInfo[SETTING_INTERVAL_20].subText = L"";
684         settingInfo[SETTING_INTERVAL_20].itemType = ITEM_TYPE_RADIO;
685
686         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
687
688         settingInfo[SETTING_REPEAT].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_REPEAT");
689         settingInfo[SETTING_REPEAT].itemType = ITEM_TYPE_TOGGLE;
690
691         if (repeatValue == 0)
692         {
693                 settingInfo[SETTING_REPEAT].isSelected = false ;
694         }
695         else
696         {
697                 settingInfo[SETTING_REPEAT].isSelected = true ;
698         }
699
700         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
701                         ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffletValue);
702
703         settingInfo[SETTING_SHUFFLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_SHUFFLE");
704         settingInfo[SETTING_SHUFFLE].itemType = ITEM_TYPE_TOGGLE;
705
706         if (shuffletValue == 0)
707         {
708                 settingInfo[SETTING_SHUFFLE].isSelected = false ;
709         }
710         else
711         {
712                 settingInfo[SETTING_SHUFFLE].isSelected = true ;
713         }
714
715         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_TRANSITION_EFFECT");
716         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].subText = selectedTransition;
717         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].itemType = ITEM_TYPE_DROPDOWN;
718
719         settingInfo[SETTING_TRANSITION_PAGE].titleText = ResourceManager::GetString(L"IDS_EBOOK_BODY_PAGE");
720         settingInfo[SETTING_TRANSITION_PAGE].subText = L"";
721         settingInfo[SETTING_TRANSITION_PAGE].itemType = ITEM_TYPE_RADIO;
722
723         settingInfo[SETTING_TRANSITION_DISSOLVE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_DISSOLVE");
724         settingInfo[SETTING_TRANSITION_DISSOLVE].subText = L"";
725         settingInfo[SETTING_TRANSITION_DISSOLVE].itemType = ITEM_TYPE_RADIO;
726
727         settingInfo[SETTING_TRANSITION_ZOOM].titleText = ResourceManager::GetString(L"IDS_IV_OPT_ZOOM");
728         settingInfo[SETTING_TRANSITION_ZOOM].subText = L"";
729         settingInfo[SETTING_TRANSITION_ZOOM].itemType = ITEM_TYPE_RADIO;
730 }
731
732 SettingMainForm::SettingItemInfo::SettingItemInfo(void)
733         : childCount(0)
734         , isOpen(false)
735         , isSelected(false)
736 {
737 }