Applied latest source code
[apps/native/preloaded/Settings.git] / src / StNfcPredefinedItemForm.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                StNfcPredefinedItemForm.cpp
19  * @brief               This is the implementation file for NfcPredefinedItemForm class.
20  */
21
22 #include <FSystem.h>
23 #include "StNfcPredefinedItemForm.h"
24 #include "StResourceManager.h"
25 #include "StSettingScenesList.h"
26 #include "StTypes.h"
27
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Graphics;
32 using namespace Tizen::System;
33 using namespace Tizen::Ui;
34 using namespace Tizen::Ui::Controls;
35 using namespace Tizen::Ui::Scenes;
36
37 static const int ID_GROUP_NFC_PREDEFINED_ITEM = 0;
38 static const int ID_GROUP_NFC_PREDEFINED_ITEM_COUNT = 1;
39 static const int ID_GROUP_ITEM_NFC_PREDEFINED_ITEM = 0;
40
41 static const int ID_GROUP_NFC_PREDEFINED_ITEM_LIST = 1;
42 static const int ID_GROUP_NFC_PREDEFINED_ITEM_LIST_DEFAULT_COUNT = 0;
43
44 static const int NFC_PREDEFINED_ITEM_DEFAULT_GROUP_COUNT = 2;
45 static const int W_TEXT_GAP = 30;
46
47 NfcPredefinedItemForm::NfcPredefinedItemForm(void)
48         : __pNfcPredefinedItemPresentationModelInstance(null)
49         , __pReservedPushCandidatesAppIdList(null)
50         , __pReservedPushCandidatesDescList(null)
51         , __itemCount(0)
52         , __pLabel(null)
53 {
54 }
55
56 NfcPredefinedItemForm::~NfcPredefinedItemForm(void)
57 {
58 }
59
60 void
61 NfcPredefinedItemForm::CreateFooter(void)
62 {
63         Footer* pFooter = GetFooter();
64         AppAssert(pFooter);
65
66         SetFormBackEventListener(this);
67 }
68
69 result
70 NfcPredefinedItemForm::OnInitializing(void)
71 {
72         CreateHeader(ResourceManager::GetString(L"IDS_NFC_BODY_PREDEFINED_ITEM_ABB"));
73         CreateTableView();
74
75         return E_SUCCESS;
76 }
77
78 result
79 NfcPredefinedItemForm::OnTerminating(void)
80 {
81         SetFormBackEventListener(null);
82         return E_SUCCESS;
83 }
84
85 void
86 NfcPredefinedItemForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
87 {
88         __pNfcPredefinedItemPresentationModelInstance = NfcPredefinedItemPresentationModel::GetInstance();
89         __pNfcPredefinedItemPresentationModelInstance->InitReservedPushCandidatesList();
90         __pReservedPushCandidatesAppIdList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesAppIdList();
91         __pReservedPushCandidatesDescList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesDescList();
92         __itemCount = __pReservedPushCandidatesAppIdList->GetCount();
93
94         if (__itemCount > 0)
95         {
96                 if (__pTableView != null)
97                         __pTableView->UpdateTableView();
98
99                 bool NfcReservedPushActivated = __pNfcPredefinedItemPresentationModelInstance->IsNfcReservedPushActivated();
100                 if (__pTableView != null)
101                         __pTableView->SetItemChecked(ID_GROUP_NFC_PREDEFINED_ITEM, ID_GROUP_ITEM_NFC_PREDEFINED_ITEM, NfcReservedPushActivated);
102         }
103
104         int selectItemIndex = __pNfcPredefinedItemPresentationModelInstance->GetSelectNfcReservedPushCandidatesAppIdIndex();
105         AppLogDebug("selectItemIndex %d", selectItemIndex);
106         SelectItemCheckIndex(selectItemIndex);
107 }
108
109 void
110 NfcPredefinedItemForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
111 {
112 }
113
114 void
115 NfcPredefinedItemForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
116 {
117         SceneManager* pSceneManager = SceneManager::GetInstance();
118         AppAssert(pSceneManager);
119
120         pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
121 }
122
123 int
124 NfcPredefinedItemForm::GetGroupCount(void)
125 {
126         return NFC_PREDEFINED_ITEM_DEFAULT_GROUP_COUNT;
127 }
128
129 int
130 NfcPredefinedItemForm::GetItemCount(int groupIndex)
131 {
132         int itemCount = 0;
133         if (groupIndex == ID_GROUP_NFC_PREDEFINED_ITEM)
134         {
135                 itemCount = ID_GROUP_NFC_PREDEFINED_ITEM_COUNT;
136         }
137         else
138         {
139                 itemCount = __itemCount;
140         }
141
142         return itemCount;
143 }
144
145 TableViewGroupItem*
146 NfcPredefinedItemForm::CreateGroupItem(int groupIndex, int itemWidth)
147 {
148         AppLogDebug("ENTER");
149         AppLogDebug("group[%d] width[%d]", groupIndex, itemWidth);
150
151         int itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
152         int yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
153         LabelTextStyle style = LABEL_TEXT_STYLE_NORMAL;
154         Rectangle itemMainText;
155         int fontSize = GetFontSize();
156         String groupText;
157         Label* pLabel = null;
158
159         TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
160
161         yItemOffset = H_GROUP_INDEX_NO_HELP_TEXT_GAP;
162         itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
163
164         itemMainText.x = X_GROUP_ITEM_DEFAULT_LABEL;
165         itemMainText.y = yItemOffset;
166         itemMainText.width = itemWidth;
167         itemMainText.height = itemHeight + H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
168
169         RelativeLayout relativeLayout;
170         relativeLayout.Construct();
171
172         pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight));
173         pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT);
174
175         pLabel = new (std::nothrow) Label();
176         pLabel->Construct(itemMainText, groupText);
177         pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
178         pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
179         pLabel->SetTextConfig(fontSize, style);
180         pLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
181
182         pItem->AddControl(pLabel);
183         pItem->SetEnabled(false);
184         relativeLayout.SetMargin(*pLabel, itemMainText.x, 0, 0, 0);
185         relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
186         relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
187
188         return pItem;
189 }
190
191 TableViewItem*
192 NfcPredefinedItemForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
193 {
194         AppLogDebug("group[%d] item[%d] width[%d]", groupIndex, itemIndex, itemWidth);
195         int itemHeight = H_GROUP_ITEM_DEFAULT;
196         int fontSize = GetFontSize();
197         Rectangle itemMainRectangle;
198         Rectangle itemSubRectangle;
199
200         String itemMainText;
201         String itemSubText;
202
203         ItemTypeOneLine(itemMainRectangle);
204         TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
205
206         TableViewItem* pItem = new (std::nothrow) TableViewItem();
207
208         switch (groupIndex)
209         {
210         case ID_GROUP_NFC_PREDEFINED_ITEM:
211                 {
212                         ItemTypeTwoLine(itemMainRectangle, itemSubRectangle, fontSize);
213                         itemMainText = ResourceManager::GetString(L"IDS_NFC_BODY_PREDEFINED_ITEM_ABB");
214                         __pNfcPredefinedItemPresentationModelInstance = NfcPredefinedItemPresentationModel::GetInstance();
215                         __pNfcPredefinedItemPresentationModelInstance->InitReservedPushCandidatesList();
216                         __pReservedPushCandidatesAppIdList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesAppIdList();
217                         if(__pReservedPushCandidatesAppIdList == null && __pReservedPushCandidatesAppIdList->GetCount() == 0)
218                         {
219                                 SceneManager* pSceneManager = SceneManager::GetInstance();
220                                 AppAssert(pSceneManager);
221                                 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
222                                 delete pItem;
223                                 return null;
224                         }
225                         if(__pReservedPushCandidatesAppIdList->GetCount() > 0)
226                         {
227                                 itemSubText = *static_cast<String*>(__pReservedPushCandidatesAppIdList->GetAt(itemIndex));
228                         }
229                         style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
230                 }
231                 break;
232
233         case ID_GROUP_NFC_PREDEFINED_ITEM_LIST:
234                 {
235                         style = TABLE_VIEW_ANNEX_STYLE_RADIO;
236                         itemMainText = *static_cast<String*>(__pReservedPushCandidatesDescList->GetAt(itemIndex));
237                 }
238                 break;
239
240         default:
241                 break;
242         }
243
244         RelativeLayout relativeLayout;
245         relativeLayout.Construct();
246
247         result r = pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight), style);
248         if (IsFailed(r))
249         {
250                 AppLogDebug("Construct fail [%s]", GetErrorMessage(r));
251                 delete pItem;
252                 return null;
253         }
254
255         pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
256
257         Label* pLabel = new (std::nothrow) Label();
258         r = pLabel->Construct(itemMainRectangle, itemMainText);
259         pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
260         pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
261         pLabel->SetTextColor(COLOR_MAIN_TEXT);
262
263         pItem->AddControl(pLabel);
264         if (groupIndex == ID_GROUP_NFC_PREDEFINED_ITEM)
265         {
266                 pLabel->AddTouchEventListener(*this);
267                 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN_ONOFF_SLIDING, 0, 0);
268         }
269         else
270         {
271                 relativeLayout.SetMargin(*pLabel, itemMainRectangle.x + RELATIVE_LAYOUT_LEFT_MARGIN, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
272         }
273         relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
274         relativeLayout.SetRelation(*pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
275
276         if (groupIndex == ID_GROUP_NFC_PREDEFINED_ITEM)
277         {
278                 __pLabel = new (std::nothrow) Label();
279                 if (__pLabel == null)
280                 {
281                         AppLogDebug("pLabel is null");
282                         return pItem;
283                 }
284
285                 r = __pLabel->Construct(itemSubRectangle, itemSubText);
286                 if (IsFailed(r))
287                 {
288                         AppLogDebug("Construct fail [%s]", GetErrorMessage(r));
289                         delete __pLabel;
290                         return pItem;
291                 }
292
293                 pItem->AddFocusEventListener(*this);
294                 pItem->AddKeyEventListener(*this);
295                 __pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
296                 __pLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
297                 __pLabel->SetTextColor(COLOR_SUB_TEXT);
298                 __pLabel->AddTouchEventListener(*this);
299
300                 pItem->AddControl(__pLabel);
301                 relativeLayout.SetMargin(*__pLabel, itemSubRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
302                 relativeLayout.SetRelation(*__pLabel, pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
303                 relativeLayout.SetRelation(*__pLabel, pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
304         }
305
306         return pItem;
307 }
308
309 bool
310 NfcPredefinedItemForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
311 {
312         AppLogDebug("ENTER");
313
314         delete pItem;
315         pItem = null;
316
317         return true;
318 }
319
320 bool
321 NfcPredefinedItemForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
322 {
323         AppLogDebug("ENTER");
324
325         delete pItem;
326         pItem = null;
327
328         return true;
329 }
330
331 void
332 NfcPredefinedItemForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
333 {
334         switch (groupIndex)
335         {
336         case ID_GROUP_NFC_PREDEFINED_ITEM:
337                 {
338                         result r = E_FAILURE;
339                         if (status == TABLE_VIEW_ITEM_STATUS_CHECKED)
340                         {
341                                 r = __pNfcPredefinedItemPresentationModelInstance->NfcReservedPushActivated();
342                         }
343                         else
344                         {
345                                 r = __pNfcPredefinedItemPresentationModelInstance->NfcReservedPushDeactivated();
346                         }
347
348                         if (r == E_FAILURE)
349                         {
350                                 AppLogDebug("NfcReservedPushActivated is fail [%s]", GetErrorMessage(r));
351                                 return;
352                         }
353                 }
354                 break;
355
356         case ID_GROUP_NFC_PREDEFINED_ITEM_LIST:
357                 {
358                         __pNfcPredefinedItemPresentationModelInstance = NfcPredefinedItemPresentationModel::GetInstance();
359                         __pNfcPredefinedItemPresentationModelInstance->InitReservedPushCandidatesList();
360                         __pReservedPushCandidatesAppIdList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesAppIdList();
361                         if(__pReservedPushCandidatesAppIdList == null && __pReservedPushCandidatesAppIdList->GetCount() == 0)
362                         {
363                                 SceneManager* pSceneManager = SceneManager::GetInstance();
364                                 AppAssert(pSceneManager);
365                                 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
366                                 return;
367                         }
368                         __pNfcPredefinedItemPresentationModelInstance->SetSelectNfcReservedPushCandidatesAppIdIndex(itemIndex);
369                         SelectItemCheckIndex(itemIndex);
370                 }
371                 break;
372
373         default:
374                 break;
375         }
376 }
377
378 void
379 NfcPredefinedItemForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
380 {
381 }
382
383 int
384 NfcPredefinedItemForm::GetDefaultGroupItemHeight(void)
385 {
386         return H_GROUP_INDEX_NO_TITLE_DEFAULT;
387 }
388
389 int
390 NfcPredefinedItemForm::GetDefaultItemHeight(void)
391 {
392         return H_GROUP_ITEM_DEFAULT;
393 }
394
395 void
396 NfcPredefinedItemForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
397 {
398 }
399
400 void
401 NfcPredefinedItemForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
402 {
403         switch (groupIndex)
404         {
405         case ID_GROUP_NFC_PREDEFINED_ITEM:
406                 {
407                         Label* secondLabel = static_cast<Label*>(pItem->GetControl(1));
408                         __pNfcPredefinedItemPresentationModelInstance = NfcPredefinedItemPresentationModel::GetInstance();
409                         __pNfcPredefinedItemPresentationModelInstance->InitReservedPushCandidatesList();
410                         __pReservedPushCandidatesAppIdList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesAppIdList();
411                         if (__pReservedPushCandidatesAppIdList == null)
412                         {
413                                 SceneManager* pSceneManager = SceneManager::GetInstance();
414                                 AppAssert(pSceneManager);
415                                 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
416                                 return;
417                         }
418                         int selectItemIndex = __pNfcPredefinedItemPresentationModelInstance->GetSelectNfcReservedPushCandidatesAppIdIndex();
419                         if (__pReservedPushCandidatesAppIdList->GetCount() > 0)
420                         {
421                                 String itemSubText = *static_cast<String*>(__pReservedPushCandidatesAppIdList->GetAt(selectItemIndex));
422                                 secondLabel->SetText(itemSubText);
423                         }
424                 }
425                 break;
426
427         default:
428                 break;
429         }
430         __pTableView->RefreshItem(ID_GROUP_NFC_PREDEFINED_ITEM, ID_GROUP_ITEM_NFC_PREDEFINED_ITEM, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
431 }
432
433 void
434 NfcPredefinedItemForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
435 {
436 }
437
438 void
439 NfcPredefinedItemForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
440 {
441 }
442
443 void
444 NfcPredefinedItemForm::SelectItemCheckIndex(int itemIndex)
445 {
446         if (__pTableView == null)
447         {
448                 AppLogDebug("__pTableView is null");
449                 return;
450         }
451
452         for (int i = 0; i < __itemCount; i++)
453         {
454                 if (i == itemIndex)
455                 {
456                         __pTableView->SetItemChecked(ID_GROUP_NFC_PREDEFINED_ITEM_LIST, i, true);
457                         continue;
458                 }
459                 __pTableView->SetItemChecked(ID_GROUP_NFC_PREDEFINED_ITEM_LIST, i, false);
460         }
461
462         __pTableView->Invalidate(true);
463         __pTableView->RefreshItem(ID_GROUP_NFC_PREDEFINED_ITEM, ID_GROUP_ITEM_NFC_PREDEFINED_ITEM, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
464 }
465
466 void
467 NfcPredefinedItemForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
468 {
469         AppLog("Enter");
470         if (requestId == REFRESH_REQUEST_EVENT)
471         {
472                 __pNfcPredefinedItemPresentationModelInstance = NfcPredefinedItemPresentationModel::GetInstance();
473                 __pNfcPredefinedItemPresentationModelInstance->InitReservedPushCandidatesList();
474                 __pReservedPushCandidatesAppIdList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesAppIdList();
475                 if(__pReservedPushCandidatesAppIdList == null)
476                 {
477                         SceneManager* pSceneManager = SceneManager::GetInstance();
478                         AppAssert(pSceneManager);
479                         pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
480                         return;
481                 }
482                 __pReservedPushCandidatesDescList = __pNfcPredefinedItemPresentationModelInstance->GetAllListReservedPushCandidatesDescList();
483                 __itemCount = __pReservedPushCandidatesAppIdList->GetCount();
484
485                 AppLog("Enter __itemCount %d", __itemCount);
486                 if (__itemCount > 0)
487                         __pTableView->UpdateTableView();
488                 else
489                 {
490                         SceneManager* pSceneManager = SceneManager::GetInstance();
491                         AppAssert(pSceneManager);
492                         pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
493                 }
494
495                 bool NfcReservedPushActivated = __pNfcPredefinedItemPresentationModelInstance->IsNfcReservedPushActivated();
496                 __pTableView->SetItemChecked(ID_GROUP_NFC_PREDEFINED_ITEM, ID_GROUP_ITEM_NFC_PREDEFINED_ITEM, NfcReservedPushActivated);
497
498                 int selectItemIndex = __pNfcPredefinedItemPresentationModelInstance->GetSelectNfcReservedPushCandidatesAppIdIndex();
499                 AppLogDebug("selectItemIndex %d", selectItemIndex);
500
501                 if (__itemCount > 0)
502                         SelectItemCheckIndex(selectItemIndex);
503
504                 AppLog("Exit.");
505         }
506 }
507
508 void
509 NfcPredefinedItemForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
510 {
511         __pLabel->SetTextColor(COLOR_SUB_TEXT);
512         __pLabel->Invalidate(false);
513 }
514
515 void
516 NfcPredefinedItemForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
517 {
518         __pLabel->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
519         __pLabel->Invalidate(false);
520 }
521
522 void
523 NfcPredefinedItemForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
524 {
525         __pLabel->SetTextColor(COLOR_SUB_TEXT);
526         __pLabel->Invalidate(false);
527 }
528 void
529 NfcPredefinedItemForm::OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
530 {
531         __pLabel->SetTextColor(COLOR_SUB_TEXT);
532         __pLabel->Invalidate(false);
533 }
534
535 void
536 NfcPredefinedItemForm::OnFocusLost(const Tizen::Ui::Control& source)
537 {
538         AppLog("Enter");
539         __pLabel->SetTextColor(COLOR_SUB_TEXT);
540         __pLabel->Invalidate(false);
541 }
542
543 void
544 NfcPredefinedItemForm::OnFocusGained(const Tizen::Ui::Control& source)
545 {
546         AppLog("Enter");
547 }
548
549 void
550 NfcPredefinedItemForm::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
551 {
552         AppLog("Enter");
553         if(keyCode == KEY_ENTER)
554         {
555                 AppLog("Enter");
556                 __pLabel->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
557                 __pLabel->Invalidate(false);
558         }
559 }
560
561 void
562 NfcPredefinedItemForm::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
563 {
564         AppLog("Enter");
565         if(keyCode == KEY_ENTER)
566         {
567                 AppLog("Enter");
568                 __pLabel->SetTextColor(COLOR_SUB_TEXT);
569                 __pLabel->Invalidate(false);
570         }
571 }
572
573 void
574 NfcPredefinedItemForm::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
575 {
576 }