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