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