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;
50 static const int ID_GROUP_BACKLIGHT_TIME_LIST = 2;
51 static const int ID_GROUP_BACKLIGHT_TIME_LIST_ITEM_COUNT = 6;
52 static const int ID_ITEM_BACKLIGHT_TIME_15_SECONDS = 0;
53 static const int ID_ITEM_BACKLIGHT_TIME_30_SECONDS = 1;
54 static const int ID_ITEM_BACKLIGHT_TIME_1_MINUTE = 2;
55 static const int ID_ITEM_BACKLIGHT_TIME_2_MINUTES = 3;
56 static const int ID_ITEM_BACKLIGHT_TIME_5_MINUTES = 4;
57 static const int ID_ITEM_BACKLIGHT_TIME_10_MINUTES = 5;
59 static const int ID_GROUP_FONT = 3;
61 static const int ID_GROUP_BATTERY_PERCENTAGE = 4;
62 static const int ID_ITEM_BATTERY_PERCENTAGE = 0;
64 static const int ID_GROUP_BATTERY_PERCENTAGE_HELP = 5;
66 static const int ID_GROUP_DEFAULT_ITEM_COUNT = 1;
68 static const int ID_GROUP_COUNT = 6;
70 DisplayForm::DisplayForm(void)
75 DisplayForm::~DisplayForm(void)
80 DisplayForm::CreateFooter(void)
82 Footer* pFooter = GetFooter();
85 pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
86 pFooter->AddActionEventListener(*this);
88 SetFormBackEventListener(this);
92 DisplayForm::OnInitializing(void)
94 CreateHeader(ResourceManager::GetString(L"IDS_ST_BODY_DISPLAY"));
103 DisplayForm::OnTerminating(void)
107 SetFormBackEventListener(null);
112 DisplayForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
114 __pTableView->UpdateTableView();
116 bool autoRotation = false;
117 if (SettingInfo::GetValue(SETTING_INFO_KEY_SCREEN_ROTAION_AUTO, autoRotation) == E_SUCCESS)
119 __pTableView->SetItemChecked(ID_GROUP_AUTO_ROTATE_SCREEN, ID_ITEM_AUTO_ROTATE_SCREEN, autoRotation);
122 bool batteryPercentage = false;
123 if (SettingInfo::GetValue(SETTING_INFO_KEY_BATTERY_PERCENTAGE, batteryPercentage) == E_SUCCESS)
125 __pTableView->SetItemChecked(ID_GROUP_BATTERY_PERCENTAGE, ID_ITEM_BATTERY_PERCENTAGE, batteryPercentage);
128 __pTableView->SetItemChecked(ID_GROUP_BACKLIGHT_TIME_LIST, GetBackLightTimeIndex(), true);
129 __pTableView->CollapseGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
133 DisplayForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
138 DisplayForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
140 SceneManager* pSceneManager = SceneManager::GetInstance();
141 AppAssert(pSceneManager);
143 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
147 DisplayForm::GetGroupCount(void)
149 AppLogDebug("ENTER");
150 return ID_GROUP_COUNT;
154 DisplayForm::GetItemCount(int groupIndex)
156 int itemCount = ID_GROUP_DEFAULT_ITEM_COUNT;
158 if (groupIndex == ID_GROUP_BACKLIGHT_TIME_LIST)
160 itemCount = ID_GROUP_BACKLIGHT_TIME_LIST_ITEM_COUNT;
162 else if (groupIndex == ID_GROUP_BATTERY_PERCENTAGE_HELP)
166 AppLogDebug("GetItemCount %d", itemCount);
172 DisplayForm::CreateGroupItem(int groupIndex, int itemWidth)
174 AppLogDebug("ENTER");
176 int itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
177 int yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
178 int fontSize = GetFontSize();
179 LabelTextStyle style = LABEL_TEXT_STYLE_BOLD;
180 Rectangle itemMainRectangle;
182 Label* pLabel = null;
184 TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
186 if (groupIndex == ID_GROUP_BATTERY_PERCENTAGE_HELP)
188 style = LABEL_TEXT_STYLE_NORMAL;
190 itemHeight = H_GROUP_INDEX_DEFAULT;
191 groupText = ResourceManager::GetString(L"IDS_ST_BODY_SHOWS_BATTERY_PERCENTAGE_ON_INDICATOR");
192 itemHeight = GetHeightForStringArea(groupText, itemWidth, fontSize);
200 itemMainRectangle.x = X_GROUP_INDEX_DEFAULT_LABEL;
201 itemMainRectangle.y = yItemOffset;
202 itemMainRectangle.width = itemWidth;
203 itemMainRectangle.height = itemHeight;
205 RelativeLayout relativeLayout;
206 relativeLayout.Construct();
208 pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight));
209 pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT);
211 pLabel = new (std::nothrow) Label();
212 pLabel->Construct(itemMainRectangle, groupText);
213 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
214 pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
215 pLabel->SetTextConfig(fontSize, style);
216 pLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
218 pItem->AddControl(pLabel);
219 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, 0, 0, 0);
220 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
221 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
222 pItem->SetEnabled(false);
228 DisplayForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
230 AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
232 Rectangle itemMainRectangle;
233 Rectangle itemSubRectangle;
234 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
237 Label* pLabel = null;
238 int fontSize = GetFontSize();
241 Rectangle detailArrow;
242 Bitmap* pBitmap = null;
244 TableViewItem* pItem = new (std::nothrow) TableViewItem();
246 ItemTypeOneLine(itemMainRectangle);
247 itemHeight = itemMainRectangle.height;
251 case ID_GROUP_AUTO_ROTATE_SCREEN:
253 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
254 itemMainRectangle.width -= W_RESIZE_LABEL_GAP;
255 itemMainText = ResourceManager::GetString(L"IDS_ST_HEADER_AUTO_ROTATE_SCREEN_ABB");
259 case ID_GROUP_BACKLIGHT_TIME:
261 ItemTypeTwoLine(itemMainRectangle, itemSubRectangle,fontSize);
262 itemHeight = (itemMainRectangle.height + itemSubRectangle.height);
264 pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
266 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_BACKLIGHT_TIME");
267 int index = GetBackLightTimeIndex();
268 subText = GetBackLightTimeIndexString(index);
272 case ID_GROUP_BACKLIGHT_TIME_LIST:
274 style = TABLE_VIEW_ANNEX_STYLE_RADIO;
275 itemMainText = GetBackLightTimeIndexString(itemIndex);
281 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_FONT");
285 case ID_GROUP_BATTERY_PERCENTAGE:
287 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
288 itemMainRectangle.width -= W_RESIZE_LABEL_GAP;
289 itemMainText = ResourceManager::GetString(L"IDS_ST_BODY_BATTERY_PERCENTAGE_ABB");
297 RelativeLayout relativeLayout;
298 relativeLayout.Construct();
300 pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight), style);
301 pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
303 pLabel = new (std::nothrow) Label();
304 pLabel->Construct(itemMainRectangle, itemMainText);
305 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
306 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
307 pLabel->SetTextColor(COLOR_MAIN_TEXT);
308 if (groupIndex == ID_GROUP_BACKLIGHT_TIME)
310 pLabel->AddTouchEventListener(*this);
313 pItem->AddControl(pLabel);
317 case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
319 rightMargin = RELATIVE_LAYOUT_RIGHT_MARGIN_ONOFF_SLIDING;
323 case TABLE_VIEW_ANNEX_STYLE_RADIO:
325 leftMargin = RELATIVE_LAYOUT_LEFT_MARGIN;
326 rightMargin = RELATIVE_LAYOUT_ITEM_RIGHT_MARGIN;
332 rightMargin = RELATIVE_LAYOUT_ITEM_RIGHT_MARGIN;
336 relativeLayout.SetMargin(*pLabel, leftMargin, rightMargin, 0, 0);
337 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
338 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
342 detailArrow = itemMainRectangle;
343 detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
344 detailArrow.height = W_DETAIL_ARROW_BUTTON;
345 detailArrow.width = W_DETAIL_ARROW_BUTTON;
347 pLabel = new (std::nothrow) Label();
348 pLabel->Construct(detailArrow, L"");
349 pLabel->AddTouchEventListener(*this);
350 pLabel->SetBackgroundBitmap(*pBitmap);
352 pItem->AddControl(pLabel);
353 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN_DETAIL_ARROW_BUTTON, 0, 0);
354 relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
356 __pLabel = new (std::nothrow) Label();
357 __pLabel->Construct(itemSubRectangle, subText);
358 __pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
359 __pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
360 __pLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
361 __pLabel->SetTextColor(COLOR_SUB_TEXT);
362 __pLabel->AddTouchEventListener(*this);
364 pItem->AddControl(__pLabel);
365 relativeLayout.SetMargin(*__pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
366 relativeLayout.SetRelation(*__pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
367 relativeLayout.SetRelation(*__pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
368 pItem->AddKeyEventListener(*this);
369 pItem->AddFocusEventListener(*this);
376 DisplayForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
378 AppLogDebug("ENTER");
387 DisplayForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
389 AppLogDebug("ENTER");
398 DisplayForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
400 AppLogDebug("ENTER");
401 AppLogDebug("RequestFrom[%d]", requestId);
402 if (requestId == REFRESH_REQUEST_EVENT)
404 int itemCount = __pTableView->GetItemCountAt(ID_GROUP_BACKLIGHT_TIME_LIST);
405 bool autoRotation = false;
406 if (SettingInfo::GetValue(SETTING_INFO_KEY_SCREEN_ROTAION_AUTO, autoRotation) == E_SUCCESS)
408 __pTableView->SetItemChecked(ID_GROUP_AUTO_ROTATE_SCREEN, ID_ITEM_AUTO_ROTATE_SCREEN, autoRotation);
411 bool batteryPercentage = false;
412 if (SettingInfo::GetValue(SETTING_INFO_KEY_BATTERY_PERCENTAGE, batteryPercentage) == E_SUCCESS)
414 __pTableView->SetItemChecked(ID_GROUP_BATTERY_PERCENTAGE, ID_ITEM_BATTERY_PERCENTAGE, batteryPercentage);
417 for (int index = 0; index < itemCount; index++)
419 if (index == GetBackLightTimeIndex())
421 __pTableView->SetItemChecked(ID_GROUP_BACKLIGHT_TIME_LIST, index, true);
425 __pTableView->SetItemChecked(ID_GROUP_BACKLIGHT_TIME_LIST, index, false);
428 __pTableView->RefreshItem(ID_GROUP_BACKLIGHT_TIME, 0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
429 __pTableView->RefreshItem(ID_GROUP_BACKLIGHT_TIME, 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
434 DisplayForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
436 SceneManager* pSceneManager = SceneManager::GetInstance();
437 AppAssert(pSceneManager);
439 AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
443 case ID_GROUP_AUTO_ROTATE_SCREEN:
445 bool itemSelectStatus = tableView.IsItemChecked(groupIndex, itemIndex);
447 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
449 itemSelectStatus = !itemSelectStatus;
452 if (SettingInfo::SetValue(SETTING_INFO_KEY_SCREEN_ROTAION_AUTO, itemSelectStatus) == E_SUCCESS)
454 tableView.SetItemChecked(groupIndex, itemIndex, itemSelectStatus);
459 case ID_GROUP_BACKLIGHT_TIME:
461 if (tableView.IsGroupExpanded(ID_GROUP_BACKLIGHT_TIME_LIST) == true)
463 tableView.CollapseGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
467 tableView.ExpandGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
469 tableView.RefreshItem(groupIndex, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
473 case ID_GROUP_BACKLIGHT_TIME_LIST:
475 SetBackLightTime(itemIndex);
477 int itemCount = tableView.GetItemCountAt(groupIndex);
479 for (int index = 0; index < itemCount; index++)
481 if (index == itemIndex)
483 tableView.SetItemChecked(groupIndex, index, true);
487 tableView.SetItemChecked(groupIndex, index, false);
490 tableView.RefreshItem(ID_GROUP_BACKLIGHT_TIME, 0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
496 SceneManager* pSceneManager = SceneManager::GetInstance();
497 AppAssert(pSceneManager);
499 __pTableView->CollapseGroup(ID_GROUP_BACKLIGHT_TIME_LIST);
500 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_FONT, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), null);
504 case ID_GROUP_BATTERY_PERCENTAGE:
506 bool itemSelectStatus = tableView.IsItemChecked(groupIndex, itemIndex);
508 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
510 itemSelectStatus = !itemSelectStatus;
513 if (SettingInfo::SetValue(SETTING_INFO_KEY_BATTERY_PERCENTAGE, itemSelectStatus) == E_SUCCESS)
515 tableView.SetItemChecked(groupIndex, itemIndex, itemSelectStatus);
526 DisplayForm::GetDefaultGroupItemHeight(void)
528 return H_GROUP_INDEX_NO_TITLE_DEFAULT;
532 DisplayForm::GetDefaultItemHeight(void)
534 return H_GROUP_ITEM_DEFAULT;
538 DisplayForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
541 BaseForm::OnOrientationChanged(source, orientationStatus);
542 __pTableView->UpdateTableView();
546 DisplayForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
551 DisplayForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
556 Label* pSubLabel = null;
562 case ID_GROUP_AUTO_ROTATE_SCREEN:
564 case ID_GROUP_BATTERY_PERCENTAGE:
566 case ID_GROUP_BACKLIGHT_TIME_LIST:
568 int fontSize = GetFontSize();
569 Label* pLabel = static_cast<Label*>(pItem->GetControl(0));
571 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
572 pLabel->Invalidate(false);
576 case ID_GROUP_BACKLIGHT_TIME:
578 Bitmap* pBitmap = null;
579 Label* pLabel = static_cast<Label*>(pItem->GetControl(0));
580 Label* pLabelBitmap = static_cast<Label*>(pItem->GetControl(1));
581 pSubLabel = static_cast<Label*>(pItem->GetControl(2));
583 int fontSize = GetFontSize();
584 Rectangle mainRectangle;
585 Rectangle subRectangle;
586 Rectangle pItemRectangle;
587 Rectangle detailArrow;
589 pItemRectangle = pItem->GetBounds();
590 ItemTypeTwoLine(mainRectangle, subRectangle, fontSize);
592 pLabel->SetBounds(mainRectangle);
593 pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
595 pItemRectangle.height = (mainRectangle.height + subRectangle.height);
596 pItem->SetBounds(pItemRectangle);
598 if (__pTableView->IsGroupExpanded(ID_GROUP_BACKLIGHT_TIME_LIST))
600 pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_OPENED);
604 pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
606 pLabelBitmap->SetBackgroundBitmap(*pBitmap);
608 detailArrow = mainRectangle;
609 detailArrow.y = mainRectangle.y + ((pItemRectangle.height - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
610 detailArrow.height = W_DETAIL_ARROW_BUTTON;
611 detailArrow.width = W_DETAIL_ARROW_BUTTON;
612 pLabelBitmap->SetBounds(detailArrow);
614 index = GetBackLightTimeIndex();
615 itemSubText = GetBackLightTimeIndexString(index);
616 pSubLabel->SetBounds(subRectangle);
617 pSubLabel->SetText(itemSubText);
618 pSubLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
620 pLabel->Invalidate(false);
621 pLabelBitmap->Invalidate(false);
622 pSubLabel->Invalidate(false);
623 pItem->Invalidate(false);
632 DisplayForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
637 DisplayForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
642 DisplayForm::GetBackLightTime(void)
644 int backlightTime = 0;
646 result r = SettingInfo::GetValue(SETTING_INFO_KEY_BACKLIGHT_TIME, backlightTime);
649 AppLogDebug("GetValue Backlight Time fail [%s]", GetErrorMessage(r));
651 return backlightTime;
655 DisplayForm::SetBackLightTime(int itemIndex)
657 int backlightTime = 0;
660 case ID_ITEM_BACKLIGHT_TIME_15_SECONDS:
662 backlightTime = BACKLIGHT_TIME_15_SECONDS;
666 case ID_ITEM_BACKLIGHT_TIME_30_SECONDS:
668 backlightTime = BACKLIGHT_TIME_30_SECONDS;
672 case ID_ITEM_BACKLIGHT_TIME_1_MINUTE:
674 backlightTime = BACKLIGHT_TIME_1_MINUTE;
678 case ID_ITEM_BACKLIGHT_TIME_2_MINUTES:
680 backlightTime = BACKLIGHT_TIME_2_MINUTES;
684 case ID_ITEM_BACKLIGHT_TIME_5_MINUTES:
686 backlightTime = BACKLIGHT_TIME_5_MINUTES;
690 case ID_ITEM_BACKLIGHT_TIME_10_MINUTES:
692 backlightTime = BACKLIGHT_TIME_10_MINUTES;
697 result r = SettingInfo::SetValue(SETTING_INFO_KEY_BACKLIGHT_TIME, backlightTime);
700 AppLogDebug("SetValue Backlight Time fail [%s]", GetErrorMessage(r));
705 DisplayForm::GetBackLightTimeIndex(void)
708 int backlightTime = GetBackLightTime();
710 switch (backlightTime)
712 case BACKLIGHT_TIME_15_SECONDS:
714 itemIndex = ID_ITEM_BACKLIGHT_TIME_15_SECONDS;
718 case BACKLIGHT_TIME_30_SECONDS:
720 itemIndex = ID_ITEM_BACKLIGHT_TIME_30_SECONDS;
724 case BACKLIGHT_TIME_1_MINUTE:
726 itemIndex = ID_ITEM_BACKLIGHT_TIME_1_MINUTE;
730 case BACKLIGHT_TIME_2_MINUTES:
732 itemIndex = ID_ITEM_BACKLIGHT_TIME_2_MINUTES;
736 case BACKLIGHT_TIME_5_MINUTES:
738 itemIndex = ID_ITEM_BACKLIGHT_TIME_5_MINUTES;
742 case BACKLIGHT_TIME_10_MINUTES:
744 itemIndex = ID_ITEM_BACKLIGHT_TIME_10_MINUTES;
753 DisplayForm::GetBackLightTimeIndexString(int itemIndex)
759 case ID_ITEM_BACKLIGHT_TIME_15_SECONDS:
761 itemText = ResourceManager::GetString(L"IDS_ST_BODY_15_SECONDS");
765 case ID_ITEM_BACKLIGHT_TIME_30_SECONDS:
767 itemText = ResourceManager::GetString(L"IDS_ST_BODY_30_SECONDS");
771 case ID_ITEM_BACKLIGHT_TIME_1_MINUTE:
773 itemText = ResourceManager::GetString(L"IDS_ST_BODY_1_MINUTE");
777 case ID_ITEM_BACKLIGHT_TIME_2_MINUTES:
779 itemText = ResourceManager::GetString(L"IDS_ST_BODY_2_MINUTES");
783 case ID_ITEM_BACKLIGHT_TIME_5_MINUTES:
785 itemText = ResourceManager::GetString(L"IDS_ST_BODY_5_MINUTES");
789 case ID_ITEM_BACKLIGHT_TIME_10_MINUTES:
791 itemText = ResourceManager::GetString(L"IDS_ST_BODY_10_MINUTES");
800 DisplayForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
802 __pLabel->SetTextColor(COLOR_SUB_TEXT);
803 __pLabel->Invalidate(false);
807 DisplayForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
809 __pLabel->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
810 __pLabel->Invalidate(false);
814 DisplayForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
816 __pLabel->SetTextColor(COLOR_SUB_TEXT);
817 __pLabel->Invalidate(false);
821 DisplayForm::OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
823 __pLabel->SetTextColor(COLOR_SUB_TEXT);
824 __pLabel->Invalidate(false);
828 DisplayForm::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
831 if(keyCode == KEY_ENTER)
834 __pLabel->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
835 __pLabel->Invalidate(false);
840 DisplayForm::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
843 if(keyCode == KEY_ENTER)
846 __pLabel->SetTextColor(COLOR_SUB_TEXT);
847 __pLabel->Invalidate(false);
852 DisplayForm::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
857 DisplayForm::OnFocusLost(const Tizen::Ui::Control& source)
860 __pLabel->SetTextColor(COLOR_SUB_TEXT);
861 __pLabel->Invalidate(false);
865 DisplayForm::OnFocusGained(const Tizen::Ui::Control& source)