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