SlideShow menu implementation
[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         }
346         break;
347
348 //      case SETTING_SHUFFLE:
349 //      {
350 //              int shuffleValue = 0;
351 //
352 //              __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
353 //                              ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffleValue);
354 //
355 //              if (shuffleValue == 0)
356 //              {
357 //                      inputValue = 1;
358 //              }
359 //              else
360 //              {
361 //                      inputValue = 0;
362 //              }
363 //
364 //              __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
365 //                              ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, inputValue);
366 //      }
367 //      break;
368
369         default:
370                 break;
371         }
372 }
373 void
374 SettingMainForm::OnGroupedListViewItemSwept(GroupedListView& listView, int groupIndex, int itemIndex,
375                 SweepDirection direction)
376 {
377 }
378
379 GroupItem*
380 SettingMainForm::CreateGroupItem(int groupIndex, int itemWidth)
381 {
382         result r = E_FAILURE;
383         String text(L"");
384         GroupItem* pItem = null;
385         const Color ITEM_TEXT_COLOR = CUSTOM_COLOR_SETTINGS_GROUPTITLE;
386
387         pItem = new(std::nothrow) GroupItem();
388         if (pItem == null)
389         {
390                 return null;
391         }
392         r = pItem->Construct(Dimension(itemWidth, 46));
393         if (IsFailed(r))
394         {
395                 delete pItem;
396                 return null;
397         }
398
399         switch (groupIndex)
400         {
401         case 0:
402                 text = ResourceManager::GetString(L"IDS_MEDIABR_BUTTON_SLIDE_SHOW");  // IDS_SLIDESHOW
403                 break;
404
405         default:
406                 break;
407         }
408
409         pItem->SetElement(text, null);
410
411         AppLogDebug("background color set result %s", GetErrorMessage(r));
412
413         pItem->SetTextColor(ITEM_TEXT_COLOR);
414         return pItem;
415 }
416
417 ListItemBase*
418 SettingMainForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
419 {
420         AppLog("SettingMainForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d ", groupIndex, itemIndex,
421                         itemWidth);
422
423         result r = E_SUCCESS;
424         int effectiveIndex = 0;
425         const Color ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND;
426         const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
427
428         effectiveIndex = effectiveIndex + itemIndex;
429         AppLogDebug("SettingMainForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
430
431         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
432         {
433                 SettingToggleCustomItem* pItem = new(std::nothrow) SettingToggleCustomItem();
434                 r = pItem->Construct(itemWidth, 112);
435
436                 if (IsFailed(r))
437                 {
438                         delete pItem;
439                         return null;
440                 }
441
442                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
443                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR);
444
445                 if (__pList != null)
446                 {
447                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
448                 }
449
450                 pItem->SetText(settingInfo[effectiveIndex].titleText);
451                 pItem->Make();
452
453                 return pItem;
454         }
455         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
456         {
457                 DropDownCustomItem* pItem = new(std::nothrow) DropDownCustomItem();
458                 r = pItem->Construct(itemWidth);
459                 if (IsFailed(r))
460                 {
461                         delete pItem;
462                         return null;
463                 }
464
465                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
466                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR);
467
468                 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
469                 pItem->SetSubText(settingInfo[effectiveIndex].subText);
470                 if (settingInfo[effectiveIndex].isOpen)
471                 {
472                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
473                 }
474                 else
475                 {
476                         pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED);
477                 }
478
479                 r = pItem->Make();
480
481                 if (IsFailed(r))
482                 {
483                         delete pItem;
484                         return null;
485                 }
486
487                 return pItem;
488         }
489         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
490         {
491                 RadioCustomItem* pItem = new(std::nothrow) RadioCustomItem();
492                 int parentIndex = 0;
493
494                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
495                 {
496                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
497                                 break;
498                 }
499
500                 if (settingInfo[parentIndex].isOpen == false)
501                 {
502                         r = pItem->Construct(itemWidth, 0);
503                         AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
504                         return pItem;
505                 }
506                 else
507                 {
508                         pItem->Construct(itemWidth, 112);
509                 }
510
511                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
512                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
513
514                 pItem->SetText(settingInfo[effectiveIndex].titleText);
515                 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
516
517                 pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
518                 pItem->Make();
519
520                 return pItem;
521         }
522         else
523         {
524                 return null;
525         }
526 }
527
528 bool
529 SettingMainForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
530 {
531         delete pItem;
532         return true;
533 }
534
535 bool
536 SettingMainForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
537 {
538         delete pItem;
539         return true;
540 }
541
542 int
543 SettingMainForm::GetGroupCount(void)
544 {
545         int groupCount = 1 ;
546
547         return groupCount;
548 }
549
550 int
551 SettingMainForm::GetItemCount(int groupIndex)
552 {
553         AppLog(" SettingMainForm::GetItemCount --> groupIndex : %d,", groupIndex);
554         return pGroupItemCount[groupIndex];
555 }
556
557 void
558 SettingMainForm::InitializeSettingValues(void)
559 {
560         pGroupItemCount = new(std::nothrow) int[1];
561         pGroupItemCount[0] = 12;
562         int interval = 0;
563         int transitionValue = 0;
564         int repeatValue = 0;
565         //int shuffletValue = 0;
566         String selectedInterval;
567         String selectedTransition;
568
569         for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; ++iter)
570         {
571                 settingInfo[iter].isSelected = false;
572         }
573
574         result r =__pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL,
575                         interval);
576
577         if (r == E_SUCCESS)
578         {
579                 switch (interval)
580                 {
581                 case 2:
582                 {
583                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
584                         settingInfo[SETTING_INTERVAL_2].isSelected = true;
585                 }
586                 break;
587
588                 case 3:
589                 {
590                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_OPT_3_SECONDS");
591                         settingInfo[SETTING_INTERVAL_3].isSelected = true;
592                 }
593                 break;
594
595                 case 5:
596                 {
597                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_5_SECONDS");
598                         settingInfo[SETTING_INTERVAL_5].isSelected = true;
599                 }
600                 break;
601
602                 case 10:
603                 {
604                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_10_SECONDS");
605                         settingInfo[SETTING_INTERVAL_10].isSelected = true;
606                 }
607                 break;
608
609                 case 20:
610                 {
611                         selectedInterval = ResourceManager::GetString(L"IDS_MEDIABR_BODY_20_SECONDS");
612                         settingInfo[SETTING_INTERVAL_20].isSelected = true;
613                 }
614                 break;
615
616                 default:
617                         break;
618                 }
619         }
620
621         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
622                         ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, transitionValue);
623
624         if (r == E_SUCCESS)
625         {
626                 switch (transitionValue)
627                 {
628                 case 0:
629                 {
630                         selectedTransition = ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDE");
631                         settingInfo[SETTING_TRANSITION_SLIDE].isSelected = true;
632                 }
633                 break;
634
635                 case 1:
636                 {
637                         selectedTransition = ResourceManager::GetString(L"IDS_MEDIABR_BODY_DISSOLVE");
638                         settingInfo[SETTING_TRANSITION_DISSOLVE].isSelected = true;
639                 }
640                 break;
641
642                 case 2:
643                 {
644                         selectedTransition = ResourceManager::GetString(L"IDS_IV_OPT_ZOOM");
645                         settingInfo[SETTING_TRANSITION_ZOOM].isSelected = true;
646                 }
647                 break;
648
649                 default:
650                         break;
651                 }
652         }
653
654         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_SLIDESHOW_INTERVAL");
655         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].subText = selectedInterval ;
656         settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].itemType = ITEM_TYPE_DROPDOWN;
657
658         settingInfo[SETTING_INTERVAL_2].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
659         settingInfo[SETTING_INTERVAL_2].subText = L"";
660         settingInfo[SETTING_INTERVAL_2].itemType = ITEM_TYPE_RADIO;
661
662         settingInfo[SETTING_INTERVAL_3].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_3_SECONDS");
663         settingInfo[SETTING_INTERVAL_3].subText = L"";
664         settingInfo[SETTING_INTERVAL_3].itemType = ITEM_TYPE_RADIO;
665
666         settingInfo[SETTING_INTERVAL_5].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_5_SECONDS");
667         settingInfo[SETTING_INTERVAL_5].subText = L"";
668         settingInfo[SETTING_INTERVAL_5].itemType = ITEM_TYPE_RADIO;
669
670         settingInfo[SETTING_INTERVAL_10].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_10_SECONDS");
671         settingInfo[SETTING_INTERVAL_10].subText = L"";
672         settingInfo[SETTING_INTERVAL_10].itemType = ITEM_TYPE_RADIO;
673
674         settingInfo[SETTING_INTERVAL_20].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_20_SECONDS");
675         settingInfo[SETTING_INTERVAL_20].subText = L"";
676         settingInfo[SETTING_INTERVAL_20].itemType = ITEM_TYPE_RADIO;
677
678         r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
679
680         settingInfo[SETTING_REPEAT].titleText = L"Repeat";
681         settingInfo[SETTING_REPEAT].itemType = ITEM_TYPE_TOGGLE;
682
683         if (repeatValue == 0)
684         {
685                 settingInfo[SETTING_REPEAT].isSelected = false ;
686         }
687         else
688         {
689                 settingInfo[SETTING_REPEAT].isSelected = true ;
690         }
691
692 //      r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
693 //                      ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffletValue);
694 //
695 //      settingInfo[SETTING_SHUFFLE].titleText = L"Shuffle";
696 //      settingInfo[SETTING_SHUFFLE].itemType = ITEM_TYPE_TOGGLE;
697 //
698 //      if ( shuffletValue == 0)
699 //      {
700 //              settingInfo[SETTING_SHUFFLE].isSelected = false ;
701 //      }
702 //      else
703 //      {
704 //              settingInfo[SETTING_SHUFFLE].isSelected = true ;
705 //      }
706
707         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_TRANSITION_EFFECT");
708         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].subText = selectedTransition;
709         settingInfo[SETTING_TRANSITION_EFFECT_TITLE].itemType = ITEM_TYPE_DROPDOWN;
710
711         settingInfo[SETTING_TRANSITION_SLIDE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDE");
712         settingInfo[SETTING_TRANSITION_SLIDE].subText = L"";
713         settingInfo[SETTING_TRANSITION_SLIDE].itemType = ITEM_TYPE_RADIO;
714
715         settingInfo[SETTING_TRANSITION_DISSOLVE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_DISSOLVE");
716         settingInfo[SETTING_TRANSITION_DISSOLVE].subText = L"";
717         settingInfo[SETTING_TRANSITION_DISSOLVE].itemType = ITEM_TYPE_RADIO;
718
719         settingInfo[SETTING_TRANSITION_ZOOM].titleText = ResourceManager::GetString(L"IDS_IV_OPT_ZOOM");
720         settingInfo[SETTING_TRANSITION_ZOOM].subText = L"";
721         settingInfo[SETTING_TRANSITION_ZOOM].itemType = ITEM_TYPE_RADIO;
722
723 }
724
725 SettingMainForm::SettingItemInfo::SettingItemInfo(void)
726 {
727         titleText = L"";
728         subText = L"";
729         childCount = 0;
730         isOpen = false;
731         isSelected = false ;
732 }