2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 * @file StDisplayForm.cpp
19 * @brief This is the implementation file for DisplayForm class.
23 #include "StDisplayForm.h"
24 #include "StResourceManager.h"
25 #include "StSettingScenesList.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::System;
31 using namespace Tizen::Ui;
32 using namespace Tizen::Ui::Controls;
33 using namespace Tizen::Ui::Scenes;
35 static const int W_RESIZE_LABEL_GAP = 110;
36 static const int RELATIVE_LAYOUT_ITEM_RIGHT_MARGIN = 140;
38 static const int BACKLIGHT_TIME_15_SECONDS = 15;
39 static const int BACKLIGHT_TIME_30_SECONDS = 30;
40 static const int BACKLIGHT_TIME_1_MINUTE = 60;
41 static const int BACKLIGHT_TIME_2_MINUTES = 120;
42 static const int BACKLIGHT_TIME_5_MINUTES = 300;
43 static const int BACKLIGHT_TIME_10_MINUTES = 600;
45 static const int ID_GROUP_AUTO_ROTATE_SCREEN = 0;
46 static const int ID_ITEM_AUTO_ROTATE_SCREEN = 0;
48 static const int ID_GROUP_BACKLIGHT_TIME = 1;
49 static const int ID_ITEM_BACKLIGHT_TIME = 0;
51 static const int ID_GROUP_BACKLIGHT_TIME_LIST = 2;
52 static const int ID_GROUP_BACKLIGHT_TIME_LIST_ITEM_COUNT = 6;
53 static const int ID_ITEM_BACKLIGHT_TIME_15_SECONDS = 0;
54 static const int ID_ITEM_BACKLIGHT_TIME_30_SECONDS = 1;
55 static const int ID_ITEM_BACKLIGHT_TIME_1_MINUTE = 2;
56 static const int ID_ITEM_BACKLIGHT_TIME_2_MINUTES = 3;
57 static const int ID_ITEM_BACKLIGHT_TIME_5_MINUTES = 4;
58 static const int ID_ITEM_BACKLIGHT_TIME_10_MINUTES = 5;
60 static const int ID_GROUP_FONT = 3;
61 static const int ID_ITEM_FONT = 0;
63 static const int ID_GROUP_BATTERY_PERCENTAGE = 4;
64 static const int ID_ITEM_BATTERY_PERCENTAGE = 0;
66 static const int ID_GROUP_BATTERY_PERCENTAGE_HELP = 5;
67 static const int ID_ITEM_BATTERY_PERCENTAGE_HELP = 0;
69 static const int ID_GROUP_DISPLAY_MAX_COUNT = 6;
70 static const int ID_GROUP_DEFAULT_ITEM_COUNT = 1;
72 static const int ID_GROUP_COUNT = 6;
73 static const int ID_GROUP_MAX_ITEM_COUNT = ID_GROUP_DISPLAY_MAX_COUNT;
75 DisplayForm::DisplayForm(void)
79 DisplayForm::~DisplayForm(void)
84 DisplayForm::CreateFooter(void)
86 Footer* pFooter = GetFooter();
89 pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
90 pFooter->AddActionEventListener(*this);
92 SetFormBackEventListener(this);
96 DisplayForm::OnInitializing(void)
98 CreateHeader(ResourceManager::GetString(L"IDS_ST_BODY_DISPLAY"));
101 AppLogDebug("ENTER");
107 DisplayForm::OnTerminating(void)
111 SetFormBackEventListener(null);
116 DisplayForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
118 if (previousSceneId == IDSCN_FONT)
122 __pTableView->UpdateTableView();
124 bool autoRotation = false;
125 if (SettingInfo::GetValue(SETTING_INFO_KEY_SCREEN_ROTAION_AUTO, autoRotation) == E_SUCCESS)
127 __pTableView->SetItemChecked(ID_GROUP_AUTO_ROTATE_SCREEN, ID_ITEM_AUTO_ROTATE_SCREEN, autoRotation);
130 bool batteryPercentage = false;
131 if (SettingInfo::GetValue(SETTING_INFO_KEY_BATTERY_PERCENTAGE, batteryPercentage) == E_SUCCESS)
133 __pTableView->SetItemChecked(ID_GROUP_BATTERY_PERCENTAGE, ID_ITEM_BATTERY_PERCENTAGE, batteryPercentage);
136 __pTableView->SetItemChecked(ID_GROUP_BACKLIGHT_TIME_LIST, GetBackLightTimeIndex(), true);
137 __pTableView->CollapseGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
141 DisplayForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
146 DisplayForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
148 SceneManager* pSceneManager = SceneManager::GetInstance();
149 AppAssert(pSceneManager);
151 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
155 DisplayForm::GetGroupCount(void)
157 AppLogDebug("ENTER");
158 return ID_GROUP_COUNT;
162 DisplayForm::GetItemCount(int groupIndex)
164 int itemCount = ID_GROUP_DEFAULT_ITEM_COUNT;
166 if (groupIndex == ID_GROUP_BACKLIGHT_TIME_LIST)
168 itemCount = ID_GROUP_BACKLIGHT_TIME_LIST_ITEM_COUNT;
170 else if (groupIndex == ID_GROUP_BATTERY_PERCENTAGE_HELP)
174 AppLogDebug("GetItemCount %d", itemCount);
180 DisplayForm::CreateGroupItem(int groupIndex, int itemWidth)
182 AppLogDebug("ENTER");
184 int itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
185 int yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
186 LabelTextStyle style = LABEL_TEXT_STYLE_BOLD;
187 Rectangle itemMainRectangle;
189 Label* pLabel = null;
191 TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
193 if (groupIndex == ID_GROUP_BATTERY_PERCENTAGE_HELP)
195 style = LABEL_TEXT_STYLE_NORMAL;
196 yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
197 itemHeight = H_GROUP_INDEX_DEFAULT;
198 groupText = ResourceManager::GetString(L"IDS_ST_BODY_SHOWS_BATTERY_PERCENTAGE_ON_INDICATOR");
206 itemMainRectangle.x = X_GROUP_INDEX_DEFAULT_LABEL;
207 itemMainRectangle.y = yItemOffset;
208 itemMainRectangle.width = itemWidth;
209 itemMainRectangle.height = itemHeight;
211 RelativeLayout relativeLayout;
212 relativeLayout.Construct();
214 pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight));
215 pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT);
217 pLabel = new (std::nothrow) Label();
218 pLabel->Construct(itemMainRectangle, groupText);
219 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
220 pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
221 pLabel->SetTextConfig(FONT_SIZE_GROUP_TITLE_TEXT, style);
222 pLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
224 pItem->AddControl(pLabel);
225 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
226 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
227 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
228 pItem->SetEnabled(false);
234 DisplayForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
236 AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
238 Rectangle itemMainRectangle;
239 Rectangle itemSubRectangle;
240 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
243 Label* pLabel = null;
244 int fontSize = GetFontSize();
247 Rectangle detailArrow;
248 Bitmap* pBitmap = null;
250 TableViewItem* pItem = new (std::nothrow) TableViewItem();
252 ItemTypeOneLine(itemMainRectangle);
253 itemHeight = itemMainRectangle.height;
257 case ID_GROUP_AUTO_ROTATE_SCREEN:
259 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
260 itemMainRectangle.width -= W_RESIZE_LABEL_GAP;
261 itemMainText = ResourceManager::GetString(L"IDS_ST_HEADER_AUTO_ROTATE_SCREEN_ABB");
265 case ID_GROUP_BACKLIGHT_TIME:
267 ItemTypeTwoLine(itemMainRectangle, itemSubRectangle,fontSize);
268 itemHeight = (itemMainRectangle.height + itemSubRectangle.height);
270 pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
272 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_BACKLIGHT_TIME");
273 int index = GetBackLightTimeIndex();
274 subText = GetBackLightTimeIndexString(index);
278 case ID_GROUP_BACKLIGHT_TIME_LIST:
280 style = TABLE_VIEW_ANNEX_STYLE_RADIO;
281 itemMainText = GetBackLightTimeIndexString(itemIndex);
287 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_FONT");
291 case ID_GROUP_BATTERY_PERCENTAGE:
293 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
294 itemMainRectangle.width -= W_RESIZE_LABEL_GAP;
295 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_BATTERY_PERCENTAGE_ABB");
303 RelativeLayout relativeLayout;
304 relativeLayout.Construct();
306 pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight), style);
307 pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
309 pLabel = new (std::nothrow) Label();
310 pLabel->Construct(itemMainRectangle, itemMainText);
311 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
312 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
313 pLabel->SetTextColor(COLOR_MAIN_TEXT);
315 pItem->AddControl(pLabel);
319 case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
321 rightMargin = RELATIVE_LAYOUT_RIGHT_MARGIN_ONOFF_SLIDING;
325 case TABLE_VIEW_ANNEX_STYLE_RADIO:
327 leftMargin = RELATIVE_LAYOUT_LEFT_MARGIN;
328 rightMargin = RELATIVE_LAYOUT_ITEM_RIGHT_MARGIN;
334 rightMargin = RELATIVE_LAYOUT_ITEM_RIGHT_MARGIN;
338 relativeLayout.SetMargin(*pLabel, leftMargin, rightMargin, 0, 0);
339 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
340 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
344 detailArrow = itemMainRectangle;
345 detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
346 detailArrow.height = W_DETAIL_ARROW_BUTTON;
347 detailArrow.width = W_DETAIL_ARROW_BUTTON;
349 pLabel = new (std::nothrow) Label();
350 pLabel->Construct(detailArrow, L"");
352 pLabel->SetBackgroundBitmap(*pBitmap);
354 pItem->AddControl(pLabel);
355 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN_DETAIL_ARROW_BUTTON, 0, 0);
356 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
358 pLabel = new (std::nothrow) Label();
359 pLabel->Construct(itemSubRectangle, subText);
360 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
361 pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
362 pLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
363 pLabel->SetTextColor(COLOR_SUB_TEXT);
365 pItem->AddControl(pLabel);
366 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
367 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
368 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
375 DisplayForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
377 AppLogDebug("ENTER");
386 DisplayForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
388 AppLogDebug("ENTER");
397 DisplayForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
399 AppLogDebug("ENTER");
400 AppLogDebug("RequestFrom[%d]", requestId);
401 if (requestId == REFRESH_REQUEST_EVENT)
403 int itemCount = __pTableView->GetItemCountAt(ID_GROUP_BACKLIGHT_TIME_LIST);
404 bool autoRotation = false;
405 if (SettingInfo::GetValue(SETTING_INFO_KEY_SCREEN_ROTAION_AUTO, autoRotation) == E_SUCCESS)
407 __pTableView->SetItemChecked(ID_GROUP_AUTO_ROTATE_SCREEN, ID_ITEM_AUTO_ROTATE_SCREEN, autoRotation);
410 bool batteryPercentage = false;
411 if (SettingInfo::GetValue(SETTING_INFO_KEY_BATTERY_PERCENTAGE, batteryPercentage) == E_SUCCESS)
413 __pTableView->SetItemChecked(ID_GROUP_BATTERY_PERCENTAGE, ID_ITEM_BATTERY_PERCENTAGE, batteryPercentage);
416 for (int index = 0; index < itemCount; index++)
418 if (index == GetBackLightTimeIndex())
420 __pTableView->SetItemChecked(ID_GROUP_BACKLIGHT_TIME_LIST, index, true);
424 __pTableView->SetItemChecked(ID_GROUP_BACKLIGHT_TIME_LIST, index, false);
427 __pTableView->RefreshItem(ID_GROUP_BACKLIGHT_TIME, 0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
428 __pTableView->RefreshItem(ID_GROUP_BACKLIGHT_TIME, 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
433 DisplayForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
435 SceneManager* pSceneManager = SceneManager::GetInstance();
436 AppAssert(pSceneManager);
438 AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
442 case ID_GROUP_AUTO_ROTATE_SCREEN:
444 bool itemSelectStatus = tableView.IsItemChecked(groupIndex, itemIndex);
446 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
448 itemSelectStatus = !itemSelectStatus;
451 if (SettingInfo::SetValue(SETTING_INFO_KEY_SCREEN_ROTAION_AUTO, itemSelectStatus) == E_SUCCESS)
453 tableView.SetItemChecked(groupIndex, itemIndex, itemSelectStatus);
458 case ID_GROUP_BACKLIGHT_TIME:
460 if (tableView.IsGroupExpanded(ID_GROUP_BACKLIGHT_TIME_LIST) == true)
462 tableView.CollapseGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
466 tableView.ExpandGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
468 tableView.RefreshItem(groupIndex, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
472 case ID_GROUP_BACKLIGHT_TIME_LIST:
474 SetBackLightTime(itemIndex);
476 int itemCount = tableView.GetItemCountAt(groupIndex);
478 for (int index = 0; index < itemCount; index++)
480 if (index == itemIndex)
482 tableView.SetItemChecked(groupIndex, index, true);
486 tableView.SetItemChecked(groupIndex, index, false);
489 tableView.RefreshItem(ID_GROUP_BACKLIGHT_TIME, 0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
495 SceneManager* pSceneManager = SceneManager::GetInstance();
496 AppAssert(pSceneManager);
498 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_FONT, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), null);
502 case ID_GROUP_BATTERY_PERCENTAGE:
504 bool itemSelectStatus = tableView.IsItemChecked(groupIndex, itemIndex);
506 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
508 itemSelectStatus = !itemSelectStatus;
511 if (SettingInfo::SetValue(SETTING_INFO_KEY_BATTERY_PERCENTAGE, itemSelectStatus) == E_SUCCESS)
513 tableView.SetItemChecked(groupIndex, itemIndex, itemSelectStatus);
524 DisplayForm::GetDefaultGroupItemHeight(void)
526 return H_GROUP_INDEX_NO_TITLE_DEFAULT;
530 DisplayForm::GetDefaultItemHeight(void)
532 return H_GROUP_ITEM_DEFAULT;
536 DisplayForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
541 DisplayForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
546 Label* pSubLabel = null;
552 case ID_GROUP_AUTO_ROTATE_SCREEN:
554 case ID_GROUP_BATTERY_PERCENTAGE:
556 case ID_GROUP_BACKLIGHT_TIME_LIST:
558 int fontSize = GetFontSize();
559 Label* pLabel = static_cast<Label*>(pItem->GetControl(0));
561 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
562 pLabel->Invalidate(false);
566 case ID_GROUP_BACKLIGHT_TIME:
568 Bitmap* pBitmap = null;
569 Label* pLabel = static_cast<Label*>(pItem->GetControl(0));
570 Label* pLabelBitmap = static_cast<Label*>(pItem->GetControl(1));
571 pSubLabel = static_cast<Label*>(pItem->GetControl(2));
573 int fontSize = GetFontSize();
574 Rectangle mainRectangle;
575 Rectangle subRectangle;
576 Rectangle pItemRectangle;
577 Rectangle detailArrow;
579 pItemRectangle = pItem->GetBounds();
580 ItemTypeTwoLine(mainRectangle, subRectangle, fontSize);
582 pLabel->SetBounds(mainRectangle);
583 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
585 pItemRectangle.height = (mainRectangle.height + subRectangle.height);
586 pItem->SetBounds(pItemRectangle);
588 if (__pTableView->IsGroupExpanded(ID_GROUP_BACKLIGHT_TIME_LIST))
590 pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_OPENED);
594 pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
596 pLabelBitmap->SetBackgroundBitmap(*pBitmap);
598 detailArrow = mainRectangle;
599 detailArrow.y = mainRectangle.y + ((pItemRectangle.height - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
600 detailArrow.height = W_DETAIL_ARROW_BUTTON;
601 detailArrow.width = W_DETAIL_ARROW_BUTTON;
602 pLabelBitmap->SetBounds(detailArrow);
604 index = GetBackLightTimeIndex();
605 itemSubText = GetBackLightTimeIndexString(index);
606 pSubLabel->SetBounds(subRectangle);
607 pSubLabel->SetText(itemSubText);
608 pSubLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
610 pLabel->Invalidate(false);
611 pLabelBitmap->Invalidate(false);
612 pSubLabel->Invalidate(false);
613 pItem->Invalidate(false);
622 DisplayForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
627 DisplayForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
632 DisplayForm::GetBackLightTime(void)
634 int backlightTime = 0;
636 result r = SettingInfo::GetValue(SETTING_INFO_KEY_BACKLIGHT_TIME, backlightTime);
639 AppLogDebug("GetValue Backlight Time fail [%s]", GetErrorMessage(r));
641 return backlightTime;
645 DisplayForm::SetBackLightTime(int itemIndex)
647 int backlightTime = 0;
650 case ID_ITEM_BACKLIGHT_TIME_15_SECONDS:
652 backlightTime = BACKLIGHT_TIME_15_SECONDS;
656 case ID_ITEM_BACKLIGHT_TIME_30_SECONDS:
658 backlightTime = BACKLIGHT_TIME_30_SECONDS;
662 case ID_ITEM_BACKLIGHT_TIME_1_MINUTE:
664 backlightTime = BACKLIGHT_TIME_1_MINUTE;
668 case ID_ITEM_BACKLIGHT_TIME_2_MINUTES:
670 backlightTime = BACKLIGHT_TIME_2_MINUTES;
674 case ID_ITEM_BACKLIGHT_TIME_5_MINUTES:
676 backlightTime = BACKLIGHT_TIME_5_MINUTES;
680 case ID_ITEM_BACKLIGHT_TIME_10_MINUTES:
682 backlightTime = BACKLIGHT_TIME_10_MINUTES;
687 result r = SettingInfo::SetValue(SETTING_INFO_KEY_BACKLIGHT_TIME, backlightTime);
690 AppLogDebug("SetValue Backlight Time fail [%s]", GetErrorMessage(r));
695 DisplayForm::GetBackLightTimeIndex(void)
698 int backlightTime = GetBackLightTime();
700 switch (backlightTime)
702 case BACKLIGHT_TIME_15_SECONDS:
704 itemIndex = ID_ITEM_BACKLIGHT_TIME_15_SECONDS;
708 case BACKLIGHT_TIME_30_SECONDS:
710 itemIndex = ID_ITEM_BACKLIGHT_TIME_30_SECONDS;
714 case BACKLIGHT_TIME_1_MINUTE:
716 itemIndex = ID_ITEM_BACKLIGHT_TIME_1_MINUTE;
720 case BACKLIGHT_TIME_2_MINUTES:
722 itemIndex = ID_ITEM_BACKLIGHT_TIME_2_MINUTES;
726 case BACKLIGHT_TIME_5_MINUTES:
728 itemIndex = ID_ITEM_BACKLIGHT_TIME_5_MINUTES;
732 case BACKLIGHT_TIME_10_MINUTES:
734 itemIndex = ID_ITEM_BACKLIGHT_TIME_10_MINUTES;
743 DisplayForm::GetBackLightTimeIndexString(int itemIndex)
749 case ID_ITEM_BACKLIGHT_TIME_15_SECONDS:
751 itemText = ResourceManager::GetString(L"IDS_ST_BODY_15_SECONDS");
755 case ID_ITEM_BACKLIGHT_TIME_30_SECONDS:
757 itemText = ResourceManager::GetString(L"IDS_ST_BODY_30_SECONDS");
761 case ID_ITEM_BACKLIGHT_TIME_1_MINUTE:
763 itemText = ResourceManager::GetString(L"IDS_ST_BODY_1_MINUTE");
767 case ID_ITEM_BACKLIGHT_TIME_2_MINUTES:
769 itemText = ResourceManager::GetString(L"IDS_ST_BODY_2_MINUTES");
773 case ID_ITEM_BACKLIGHT_TIME_5_MINUTES:
775 itemText = ResourceManager::GetString(L"IDS_ST_BODY_5_MINUTES");
779 case ID_ITEM_BACKLIGHT_TIME_10_MINUTES:
781 itemText = ResourceManager::GetString(L"IDS_ST_BODY_10_MINUTES");