Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_TableViewItem.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FUiCtrl_TableViewItem.cpp
20  * @brief       This is the implementation file for _TableViewItem class.
21  *
22  * This file contains the implementation of _TableViewItem class.
23  */
24
25 #include <FBaseUtilMath.h>
26 #include <FGrp_BitmapImpl.h>
27 #include "FUi_ResourceManager.h"
28 #include "FUi_UiTouchEvent.h"
29 #include "FUiAnim_VisualElement.h"
30 #include "FUiAnim_ControlVisualElement.h"
31 #include "FUiCtrl_TableViewItem.h"
32 #include "FUiCtrl_TableView.h"
33 #include "FUi_CoordinateSystemUtils.h"
34 #include "FUi_Math.h"
35 #include "FUiCtrl_LabelImpl.h"
36 #include "FUi_Window.h"
37
38 using namespace Tizen::Base;
39 using namespace Tizen::Base::Runtime;
40 using namespace Tizen::Base::Collection;
41 using namespace Tizen::Ui::Animations;
42 using namespace Tizen::Graphics;
43
44 namespace Tizen { namespace Ui { namespace Controls
45 {
46
47 _TableViewItemControl::_TableViewItemControl(void)
48         :__pBackgroundBitmap(null)
49 {
50 }
51
52 _TableViewItemControl::~_TableViewItemControl(void)
53 {
54         if(__pBackgroundBitmap)
55         {
56                 delete __pBackgroundBitmap;
57                 __pBackgroundBitmap = null;
58         }
59         ClearLastResult();
60 }
61
62 void
63 _TableViewItemControl::OnDraw(void)
64 {
65         Bitmap* pBitmap = GetBackgroundBitmap();
66
67         FloatRectangle bounds(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height); // +++ check floating
68
69         Color bgColor = GetBackgroundColor();
70
71         Canvas* pCanvas = null;
72
73         if (pBitmap != null)
74         {
75                 pCanvas = GetCanvasN();
76                 if (pCanvas == null)
77                 {
78                         SysLog(NID_UI_CTRL, "Cannot get a canvas.");
79
80                         return;
81                 }
82
83                 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
84                 pCanvas->Clear();
85
86                 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap))
87                 {
88                         pCanvas->DrawNinePatchedBitmap(bounds, *pBitmap);
89                 }
90                 else
91                 {
92                         FloatRectangle drawingRect(0.0f, 0.0f, bounds.width, bounds.height);
93                         pCanvas->DrawBitmap(drawingRect, *pBitmap);
94                 }
95
96         }
97         else
98         {
99                 if (IsCalledGetCanvasN() == false)
100                 {
101                         GetVisualElement()->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255));
102                 }
103                 else
104                 {
105                         pCanvas = GetCanvasN();
106                         if (pCanvas == null)
107                         {
108                                 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
109
110                                 return;
111                         }
112
113                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
114                         pCanvas->Clear();
115                         pCanvas->FillRectangle(GetBackgroundColor(), bounds); // +++ check floating
116                 }
117         }
118
119         if (pCanvas)
120         {
121                 delete pCanvas;
122         }
123
124         return;
125 }
126
127 HitTestResult
128 _TableViewItemControl::HitTest(const  Graphics :: FloatPoint & point)
129 {
130         return HIT_TEST_NOWHERE;
131 }
132
133 _TableViewItemControl*
134 _TableViewItemControl::CreateTableViewItemControlN(void)
135 {
136         _TableViewItemControl* pItemControl = new (std::nothrow) _TableViewItemControl();
137         SysTryReturn(NID_UI_CTRL, pItemControl, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
138         SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
139
140         pItemControl->AcquireHandle();
141
142         return pItemControl;
143
144 CATCH:
145         delete pItemControl;
146         return null;
147 }
148
149 result
150 _TableViewItemControl::SetBackgroundBitmap(const Bitmap& bitmap)
151 {
152         result r = E_SYSTEM;
153
154         Bitmap* pClonedBitmap = _BitmapImpl::CloneN(bitmap);
155
156         if (pClonedBitmap)
157         {
158                 if (__pBackgroundBitmap != null)
159                 {
160                         delete __pBackgroundBitmap;
161                 }
162
163                 __pBackgroundBitmap = pClonedBitmap;
164
165                 r = E_SUCCESS;
166         }
167
168         return r;
169 }
170
171 Bitmap*
172 _TableViewItemControl::GetBackgroundBitmap(void) const
173 {
174         return __pBackgroundBitmap;
175 }
176
177 _TableViewItem::_TableViewItem(float itemHeight)
178         : _Control()
179         , __pAppInfo(null)
180         , __refCount(1)
181         , __itemHeight(itemHeight)
182         , __itemGroupIndex(-1)
183         , __itemIndex(-1)
184         , __checkedState(false)
185         , __enabledState(true)
186         , __itemChanged(true)
187         , __reorderMode(false)
188         , __itemSelected(false)
189         , __itemTouchMoved(false)
190         , __childMarginState(false)
191         , __annexStyle(TABLE_VIEW_ANNEX_STYLE_NORMAL)
192         , __drawingStatus(TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
193         , __selectionStyle(TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE)
194         , __itemType(TABLE_VIEW_ITEM_TYPE_NONE)
195         , __pContextItem(null)
196         , __isContextItem(false)
197         , __isContextItemActivated(false)
198         , __checkItemHeightNeeded(false)
199         , __pItemDivider(null)
200         , __pItemTopDivider(null)
201         , __pItemAnnex(null)
202         , __pItemCover(null)
203         , __pItemAnnexLeftDivider(null)
204         , __pItemAnnexRightDivider(null)
205         , __itemWidth(0.0f)
206         , __pDrawingProperty(null)
207         , __itemDividerEnabled(true)
208         , __pSimpleItemText(null)
209         , __pSimpleItemBitmap(null)
210         , __simpleItemTextSize(0)
211         , __pHeaderFooterItemText(null)
212         , __pDimLayer(null)
213         , __touchStartPosition(0.0f, 0.0f)
214         , __annexTouchStartPosition(0)
215         , __annexOnOffHandlerMoved(false)
216         , __annexOnOffHandlerPositionX(0.0f)
217         , __childControlCenterAlign(false)
218         , __customHeight(0.0f)
219         , __animationCount(0)
220         , __pAccessibilityElement(null)
221         , __pPressedTimer(null)
222         , __pReleasedTimer(null)
223         , __isPressedTimerEnabled(false)
224         , __isReleasedTimerEnabled(false)
225         , __pressedControl(TABLE_VIEW_ITEM_PRESSED_NONE)
226         , __releasedControl(TABLE_VIEW_ITEM_PRESSED_NONE)
227         , __pCheckedTimer(null)
228         , __isCheckedTimerEnabled(false)
229         , __isCheckedAnimationEnabled(false)
230         , __checkedCount(0)
231         , __checkedBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
232         , __isItemLayoutEnabled(false)
233         , __isMoveItemAnimationEnabled(false)
234         , __isZoomInOutItemAnimationEnabled(false)
235         , __isFadeInOutItemAnimationEnabled(false)
236         , __isAnimationCallbackBlocked(false)
237         , __isItemTapSoundEnabled(true)
238         , __isTabSoundPlayed(false)
239         , __isSelectedDetailButton(false)
240         , __isSimpleLastItem(false)
241         , __isTouchPressOnScroll(false)
242         , __pHighlightVisualElement(null)
243         , __pBitmapVisualElement(null)
244         , __pMoveItemAnimation(null)
245         , __pZoomInOutItemAnimation(null)
246         , __pFadeInOutItemtAnimation(null)
247 {
248         for (int i = 0; i < 3; i++)
249         {
250                 __pItemBgBitmap[i] = null;
251         }
252
253         GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_NORMAL, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]); // for support opacity 0x00
254         GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_PRESSED, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED]);
255         GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_HIGHLIGHTED, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED]);
256
257         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_NORMAL, __simpleItemTextColor[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]);
258         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_PRESSED, __simpleItemTextColor[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED]);
259         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_HIGHLIGHTED, __simpleItemTextColor[TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED]);
260         GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_NORMAL]);
261         GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_PRESSED, __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_PRESSED]);
262         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_DISABLED, __simpleItemTextColor[TABLE_VIEW_SIMPLEITEM_DRAWING_STATUS_DISABLED]);
263
264
265         _AccessibilityContainer* pContainer = GetAccessibilityContainer();
266         if (pContainer)
267         {
268                 pContainer->Activate(true);
269                 pContainer->AddListener(*this);
270         }
271 }
272
273 _TableViewItem::~_TableViewItem()
274 {
275         __isAnimationCallbackBlocked = true;
276
277         StopTouchPressedTimer();
278         delete __pPressedTimer;
279         __pPressedTimer = null;
280
281         StopTouchReleasedTimer();
282         delete __pReleasedTimer;
283         __pReleasedTimer = null;
284
285         _VisualElement* pVisualElement = GetVisualElement();
286         if (pVisualElement != null)
287         {
288                 if(__pMoveItemAnimation != null)
289                 {
290                         __pMoveItemAnimation->SetVisualElementAnimationTickEventListener(null);
291                         __pMoveItemAnimation->SetVisualElementAnimationStatusEventListener(null);
292                 }
293
294                 if(__pZoomInOutItemAnimation != null)
295                 {
296                         __pZoomInOutItemAnimation->SetVisualElementAnimationTickEventListener(null);
297                         __pZoomInOutItemAnimation->SetVisualElementAnimationStatusEventListener(null);
298                 }
299
300                 if(__pFadeInOutItemtAnimation != null)
301                 {
302                         __pFadeInOutItemtAnimation->SetVisualElementAnimationTickEventListener(null);
303                         __pFadeInOutItemtAnimation->SetVisualElementAnimationStatusEventListener(null);
304                 }
305                 pVisualElement->RemoveAllAnimations();
306         }
307
308         for (int j = 0; j < 3; j++)
309         {
310                 delete __pItemBgBitmap[j];
311                 __pItemBgBitmap[j] = null;
312         }
313
314         if (__pHighlightVisualElement != null)
315         {
316                 __pHighlightVisualElement->RemoveAllAnimations();
317                 __pHighlightVisualElement->SetAnimationProvider(null);
318                 __pHighlightVisualElement->Destroy();
319                 __pHighlightVisualElement = null;
320         }
321
322         if (__pBitmapVisualElement != null)
323         {
324                 __pBitmapVisualElement->RemoveAllAnimations();
325                 __pBitmapVisualElement->SetAnimationProvider(null);
326                 __pBitmapVisualElement->Destroy();
327                 __pBitmapVisualElement = null;
328         }
329
330         DetachAllChildren();
331
332         if (GetParent() != null && __isContextItem == true)
333         {
334                 GetParent()->DetachChild(*this);
335         }
336
337         delete __pItemDivider;
338         __pItemDivider = null;
339
340         delete __pItemTopDivider;
341         __pItemTopDivider = null;
342
343         delete __pItemAnnexLeftDivider;
344         __pItemAnnexLeftDivider = null;
345
346         delete __pItemAnnexRightDivider;
347         __pItemAnnexRightDivider = null;
348
349         delete __pItemAnnex;
350         __pItemAnnex = null;
351
352         delete __pDimLayer;
353         __pDimLayer = null;
354
355         delete __pItemCover;
356         __pItemCover = null;
357
358         delete __pHeaderFooterItemText;
359         __pHeaderFooterItemText = null;
360
361         delete __pMoveItemAnimation;
362         __pMoveItemAnimation = null;
363
364         delete __pZoomInOutItemAnimation;
365         __pZoomInOutItemAnimation = null;
366
367         delete __pFadeInOutItemtAnimation;
368         __pFadeInOutItemtAnimation = null;
369
370         if (__isCheckedTimerEnabled)
371         {
372                 __pCheckedTimer->Cancel();
373         }
374
375         delete __pCheckedTimer;
376         __pCheckedTimer = null;
377
378         if (__pAccessibilityElement)
379         {
380                 _AccessibilityContainer* pContainer = GetAccessibilityContainer();
381                 if(pContainer)
382                 {
383                         pContainer->RemoveAllElement();
384                 }
385                 __pAccessibilityElement = null;
386         }
387 }
388
389 _TableViewItem*
390 _TableViewItem::CreateTableViewItemN(float itemHeight)
391 {
392         result r = E_SUCCESS;
393
394         _TableViewItem* pItem = null;
395         pItem = new (std::nothrow) _TableViewItem(itemHeight);
396         SysTryReturn(NID_UI_CTRL, pItem, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
397
398         pItem->AcquireHandle();
399
400         r = pItem->Initialize();
401         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r = E_SYSTEM, "[E_SYSTEM] Unable to create TableView Item");
402
403         return pItem;
404
405 CATCH:
406         delete pItem;
407
408         return null;
409 }
410
411 result
412 _TableViewItem::Initialize(void)
413 {
414         GetVisualElement()->SetSurfaceOpaque(false);
415
416         result r = E_SUCCESS;
417
418         __pHighlightVisualElement = new (std::nothrow) _VisualElement();
419         SysTryCatch(NID_UI_CTRL, __pHighlightVisualElement != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
420
421         r = __pHighlightVisualElement->Construct();
422         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct Visual Element.", GetErrorMessage(r));
423
424         r = __pHighlightVisualElement->SetSurfaceOpaque(false);
425         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set surface opaque.", GetErrorMessage(r));
426
427         __pHighlightVisualElement->SetImplicitAnimationEnabled(false);
428
429         r = GetVisualElement()->AttachChild(*__pHighlightVisualElement);
430         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach child to the control VisualElement.", GetErrorMessage(r));
431
432         r = SetItemHighlightBounds(*__pHighlightVisualElement, CalculateItemHighlightBounds());
433         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds.", GetErrorMessage(r));
434
435         __pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f));
436         __pHighlightVisualElement->SetShowState(true);
437
438         r = __individualSelectionControls.Construct(DEFAULT_CAPTURED_CONTROL_COUNT);
439         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct ArrayList", GetErrorMessage(r));
440
441         SetTouchPressThreshold(SENSITIVE);
442
443         if (!_FloatCompare(__itemHeight, 0.0f))
444         {
445                 SetAccessibilityElement();
446         }
447
448         GetAccessibilityContainer()->Activate(false);
449
450         return r;
451
452 CATCH:
453         if (__pHighlightVisualElement != null)
454         {
455                 __pHighlightVisualElement->RemoveAllAnimations();
456                 __pHighlightVisualElement->SetAnimationProvider(null);
457                 __pHighlightVisualElement->Destroy();
458                 __pHighlightVisualElement = null;
459         }
460
461         return r;
462 }
463
464 _TableViewItem*
465 _TableViewItem::GetContextItem(void) const
466 {
467         return __pContextItem;
468 }
469
470 void
471 _TableViewItem::SetContextItem(_TableViewItem* pContextItem)
472 {
473         if (pContextItem != null)
474         {
475                 pContextItem->__isContextItem = true;
476         }
477
478         __pContextItem = pContextItem;
479 }
480
481 bool
482 _TableViewItem::IsContextItem(void) const
483 {
484         return __isContextItem;
485 }
486
487 void
488 _TableViewItem::SetContextItemActivation(bool activated)
489 {
490         __isContextItemActivated = activated;
491 }
492
493 bool
494 _TableViewItem::IsContextItemActivated(void) const
495 {
496         return __isContextItemActivated;
497 }
498
499 result
500 _TableViewItem::CreateItemDimLayer(void)
501 {
502         result r = E_SUCCESS;
503
504         if (__pDimLayer == null)
505         {
506                 __pDimLayer = _Label::CreateLabelN();
507
508                 r = GetLastResult();
509                 SysTryReturn(NID_UI_CTRL, __pDimLayer != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
510
511                 __pDimLayer->SetBackgroundColor(Color(0, 0, 0, BACKGROUND_DIMMED_OPACITY * 0xff));
512                 __pDimLayer->SetVisibleState(false);
513
514                 AttachSystemChild(*__pDimLayer);
515         }
516
517         return r;
518 }
519
520 result
521 _TableViewItem::CreateItemDivider(void)
522 {
523         result r = E_SUCCESS;
524
525         if (__pItemDivider == null)
526         {
527                 __pItemDivider = _TableViewItemControl::CreateTableViewItemControlN();
528                 r = GetLastResult();
529                 SysTryReturn(NID_UI_CTRL, __pItemDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
530                 __pItemDivider->SetFocusable(false);
531                 AttachSystemChild(*__pItemDivider);
532
533                 _AccessibilityContainer* pContainer = __pItemDivider->GetAccessibilityContainer();
534                 pContainer->Activate(false);
535         }
536
537         if (__pItemTopDivider == null)
538         {
539                 __pItemTopDivider = _TableViewItemControl::CreateTableViewItemControlN();
540                 SysTryReturn(NID_UI_CTRL, __pItemTopDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
541                 __pItemTopDivider->SetFocusable(false);
542                 AttachSystemChild(*__pItemTopDivider);
543
544                 _AccessibilityContainer* pContainer = __pItemTopDivider->GetAccessibilityContainer();
545                 pContainer->Activate(false);
546         }
547
548         return r;
549 }
550
551 result
552 _TableViewItem::CreateItemAnnexDivider(void)
553 {
554         result r = E_SUCCESS;
555
556         if (__pItemAnnexLeftDivider == null)
557         {
558                 __pItemAnnexLeftDivider = _TableViewItemControl::CreateTableViewItemControlN();
559                 r = GetLastResult();
560                 SysTryReturn(NID_UI_CTRL, __pItemAnnexLeftDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
561                 __pItemAnnexLeftDivider->SetFocusable(false);
562                 AttachSystemChild(*__pItemAnnexLeftDivider);
563         }
564
565         if (__pItemAnnexRightDivider == null)
566         {
567                 __pItemAnnexRightDivider = _TableViewItemControl::CreateTableViewItemControlN();
568                 SysTryReturn(NID_UI_CTRL, __pItemAnnexRightDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
569                 __pItemAnnexRightDivider->SetFocusable(false);
570                 AttachSystemChild(*__pItemAnnexRightDivider);
571         }
572
573         return r;
574 }
575
576 result
577 _TableViewItem::CreateItemCover(void)
578 {
579         result r = E_SUCCESS;
580
581         if (__pItemCover == null)
582         {
583                 __pItemCover = _TableViewItemControl::CreateTableViewItemControlN();
584                 r = GetLastResult();
585                 SysTryReturn(NID_UI_CTRL, __pItemCover != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
586                 __pItemCover->SetFocusable(false);
587                 AttachSystemChild(*__pItemCover);
588         }
589
590         return r;
591 }
592
593 result
594 _TableViewItem::CreateCheckBox(void)
595 {
596         result r = E_SUCCESS;
597
598         if (__pItemAnnex == null)
599         {
600                 float annexWidth = 0.0f;
601                 float annexHeight = 0.0f;
602                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
603                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
604
605                 __pItemAnnex = new (std::nothrow) Label();
606                 r = GetLastResult();
607                 SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
608
609                 float leftMargin = 0.0f;
610                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
611
612                 float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
613                 __pItemAnnex->Construct(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
614                 __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
615                 GetLabelCore(__pItemAnnex)->SetFocusable(true);
616
617                 AttachSystemChild(*GetLabelCore(__pItemAnnex));
618         }
619
620         return r;
621 }
622
623
624 result
625 _TableViewItem::CreateRadioBox(void)
626 {
627         result r = E_SUCCESS;
628
629         if (__pItemAnnex == null)
630         {
631                 float annexWidth = 0.0f;
632                 float annexHeight = 0.0f;
633                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
634                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
635
636                 __pItemAnnex = new (std::nothrow) Label();
637                 r = GetLastResult();
638                 SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
639
640                 float leftMargin = 0.0f;
641                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
642
643                 float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
644                 __pItemAnnex->Construct(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
645                 __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
646                 GetLabelCore(__pItemAnnex)->SetFocusable(true);
647
648                 AttachSystemChild(*GetLabelCore(__pItemAnnex));
649         }
650
651         return r;
652 }
653
654 result
655 _TableViewItem::CreateOnOffButton(void)
656 {
657         result r = E_SUCCESS;
658
659         if (__pItemAnnex == null)
660         {
661                 float annexWidth = 0.0f;
662                 float annexHeight = 0.0f;
663
664                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
665                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
666
667                 __pItemAnnex = new (std::nothrow) Label();
668                 r = GetLastResult();
669                 SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
670
671                 float leftMargin = 0.0f;
672                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
673
674                 leftMargin += __pDrawingProperty->scrollMargin;
675
676                 float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
677                 __pItemAnnex->Construct(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
678                 __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
679                 GetLabelCore(__pItemAnnex)->SetFocusable(true);
680
681                 AttachSystemChild(*GetLabelCore(__pItemAnnex));
682         }
683
684         return r;
685 }
686
687 result
688 _TableViewItem::CreateDetailButton(void)
689 {
690         result r = E_SUCCESS;
691
692         if (__pItemAnnex == null)
693         {
694                 float annexWidth = 0.0f;
695                 float annexHeight = 0.0f;
696
697                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
698                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
699                 __pItemAnnex = new (std::nothrow) Label();
700                 r = GetLastResult();
701                 SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
702
703                 float leftMargin = 0.0f;
704                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
705
706                 leftMargin += __pDrawingProperty->scrollMargin;
707                 float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
708                 __pItemAnnex->Construct(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
709                 __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
710                 GetLabelCore(__pItemAnnex)->SetFocusable(true);
711
712                 AttachSystemChild(*GetLabelCore(__pItemAnnex));
713         }
714
715         return r;
716 }
717
718 _Label*
719 _TableViewItem::GetLabelCore(Label* label)
720 {
721         if(label == null)
722         {
723                 return null;
724         }
725
726         _LabelImpl* pImpl = _LabelImpl::GetInstance(*label);
727         return &pImpl->GetCore();
728 }
729
730 void
731 _TableViewItem::ExposeContextItem(FloatRectangle itemBounds, float targetWidth)
732 {
733         DrawItemDivider();
734         if (__pDimLayer == null)
735         {
736                 if (CreateItemDimLayer() != E_SUCCESS)
737                 {
738                         return;
739                 }
740         }
741
742         SetBounds(itemBounds);
743
744         bool visible = true;
745
746         if ((itemBounds.width <= 0) || (itemBounds.width >= targetWidth)) // +++ check floating
747         {
748                 visible = false;
749         }
750
751         if (visible)
752         {
753                 float rightMargin = 0.0f;
754                 float dimLayerOpacity = 0.0f;
755
756                 GET_SHAPE_CONFIG(TABLEVIEW::CONTEXTITEM_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, rightMargin);
757
758                 dimLayerOpacity = BACKGROUND_DIMMED_OPACITY - ((itemBounds.width * BACKGROUND_DIMMED_OPACITY) / (targetWidth - rightMargin));
759                 dimLayerOpacity = ((dimLayerOpacity < 0) ? 0 :  dimLayerOpacity); // +++ check floating
760
761                 __pDimLayer->SetBounds(FloatRectangle(0.0f, 0.0f, itemBounds.width, itemBounds.height));
762                 __pDimLayer->SetBackgroundColor(Color(0.0f, 0.0f, 0.0f, dimLayerOpacity * 0xff));
763         }
764
765         __pDimLayer->SetVisibleState(visible);
766
767 }
768
769 void
770 _TableViewItem::DrawItemDimLayer(bool visible)
771 {
772         if (__pDimLayer == null)
773         {
774                 if (CreateItemDimLayer() != E_SUCCESS)
775                 {
776                         return;
777                 }
778         }
779
780         if (visible)
781         {
782                 FloatDimension itemSize = GetSizeF();
783                 __pDimLayer->SetBounds(FloatRectangle(0.0f, 0.0f, itemSize.width, itemSize.height));
784                 __pDimLayer->SetBackgroundColor(Color(0, 0, 0, BACKGROUND_DISABLED_OPACITY * 0xff));
785         }
786
787         __pDimLayer->SetVisibleState(visible);
788 }
789
790 void
791 _TableViewItem::SetItemWidth(float width)
792 {
793         __itemWidth = width;
794 }
795
796 bool
797 _TableViewItem::SetItemBackgroundBitmap(ListItemState itemState, const Bitmap* pBitmap)
798 {
799         Bitmap* pCopyBitmap = null;
800
801         pCopyBitmap = _BitmapImpl::CloneN(*pBitmap);
802         SysTryReturn(NID_UI_CTRL, pCopyBitmap != null, false, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient."));
803
804         delete __pItemBgBitmap[itemState];
805         __pItemBgBitmap[itemState] = pCopyBitmap;
806
807
808         if(__pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] == null &&
809                 __pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED] == null &&
810                 __pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED] == null)
811         {
812                 if(__pBitmapVisualElement != null)
813                 {
814                         __pBitmapVisualElement->Destroy();
815                         __pBitmapVisualElement = null;
816                 }
817         }
818         else
819         {
820                 if(__pBitmapVisualElement == null)
821                 {
822                         FloatRectangle bounds = GetBoundsF();
823                         result r = E_SUCCESS;
824
825                         __pBitmapVisualElement = new (std::nothrow) _VisualElement();
826                         SysTryCatch(NID_UI_CTRL, __pBitmapVisualElement != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
827
828                         r = __pBitmapVisualElement->Construct();
829                         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
830
831                         __pBitmapVisualElement->SetSurfaceOpaque(false);
832                         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set surface opaque.", GetErrorMessage(r));
833
834                         __pBitmapVisualElement->SetImplicitAnimationEnabled(false);
835                         __pBitmapVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
836                         __pBitmapVisualElement->SetShowState(true);
837
838                         GetVisualElement()->AttachChild(*__pBitmapVisualElement);
839                 }
840         }
841
842         SetItemChanged(true);
843         return true;
844 CATCH:
845         if (__pBitmapVisualElement != null)
846         {
847                 __pBitmapVisualElement->RemoveAllAnimations();
848                 __pBitmapVisualElement->SetAnimationProvider(null);
849                 __pBitmapVisualElement->Destroy();
850                 __pBitmapVisualElement = null;
851         }
852         return false;
853 }
854
855 Tizen::Graphics::Bitmap*
856 _TableViewItem::GetItemBackgroundBitmap(ListItemState itemState) const
857 {
858         return __pItemBgBitmap[itemState];
859 }
860
861 void
862 _TableViewItem::SetItemBackgroundColor(ListItemState itemState, const Color bgColor)
863 {
864         if(__colorItemBg[itemState] == bgColor)
865         {
866                 return;
867         }
868
869         __colorItemBg[itemState] = bgColor;
870
871         SetItemChanged(true);
872 }
873
874 Color
875 _TableViewItem::GetItemBackgroundColor(ListItemState itemState) const
876 {
877         return __colorItemBg[itemState];
878 }
879
880 void
881 _TableViewItem::SetItemStyle(TableViewAnnexStyle style)
882 {
883         if (__annexStyle == style)
884         {
885                 return;
886         }
887
888         __annexStyle = style;
889 }
890
891 result
892 _TableViewItem::SetSelectionStyle(TableViewItemSelectionStyle style)
893 {
894         __selectionStyle = style;
895
896         return E_SUCCESS;
897 }
898
899 TableViewItemSelectionStyle
900 _TableViewItem::GetSelectionStyle(void) const
901 {
902         return __selectionStyle;
903 }
904
905 float
906 _TableViewItem::GetItemHeight(void) const
907 {
908         return GetSizeF().height;
909 }
910
911 void
912 _TableViewItem::SetItemHeight(int itemHeight)
913 {
914         SetItemHeight(_CoordinateSystemUtils::ConvertToFloat(itemHeight));
915 }
916
917 void
918 _TableViewItem::SetItemHeight(float itemHeight)
919 {
920         if(_FloatCompare(GetSizeF().height, itemHeight))
921         {
922                 return;
923         }
924
925         SetSize(FloatDimension(GetSizeF().width, itemHeight));
926 }
927
928 void
929 _TableViewItem::SetChecked(bool checked)
930 {
931         if (__checkedState == checked)
932         {
933                 return;
934         }
935
936         __checkedState = checked;
937
938         SetItemChanged(true);
939 }
940
941 bool
942 _TableViewItem::IsChecked(void) const
943 {
944         return __checkedState;
945 }
946
947 void
948 _TableViewItem::SetCheckedAnimationEnabled(bool enabled)
949 {
950         if(__isCheckedAnimationEnabled == enabled)
951         {
952                 return;
953         }
954
955         __isCheckedAnimationEnabled = enabled;
956
957         if (__isCheckedAnimationEnabled == false)
958         {
959                 StopCheckBoxAnimation();
960         }
961 }
962
963 void
964 _TableViewItem::SetItemEnabled(bool enabled)
965 {
966         if (__enabledState == enabled)
967         {
968                 return;
969         }
970
971         __enabledState = enabled;
972
973         SetEnableState(enabled);
974
975         SetItemChanged(true);
976
977         Invalidate();
978
979         return;
980 }
981
982 bool
983 _TableViewItem::IsItemEnabled(void) const
984 {
985         return __enabledState;
986 }
987
988 void
989 _TableViewItem::SetItemType(const TableViewItemType itemType)
990 {
991         if(__itemType == itemType)
992         {
993                 return;
994         }
995
996         __itemType = itemType;
997
998         if (__pContextItem != null)
999         {
1000                 __pContextItem->SetItemType(__itemType);
1001         }
1002
1003         if(itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
1004         {
1005                 Color titleColor;
1006                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_PRESSED, titleColor);
1007                 if(titleColor == __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED])
1008                 {
1009                         GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BG_PRESSED, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED]);
1010                 }
1011                 GetAccessibilityContainer()->Activate(true);
1012         }
1013 }
1014
1015 void
1016 _TableViewItem::SetItemIndex(int groupIndex, int itemIndex)
1017 {
1018         __itemGroupIndex = groupIndex;
1019         __itemIndex = itemIndex;
1020 }
1021
1022 void
1023 _TableViewItem::GetItemIndex(int& groupIndex, int& itemIndex) const
1024 {
1025         groupIndex = __itemGroupIndex;
1026         itemIndex = __itemIndex;
1027 }
1028
1029
1030 TableViewItemType
1031 _TableViewItem::GetItemType(void) const
1032 {
1033         return __itemType;
1034 }
1035
1036 bool
1037 _TableViewItem::IsReorderMode(void) const
1038 {
1039         return __reorderMode;
1040 }
1041
1042 void
1043 _TableViewItem::SetReorderMode(bool enabled)
1044 {
1045         __reorderMode = enabled;
1046 }
1047
1048 void
1049 _TableViewItem::SetAppInfo(const void* pAppInfo)
1050 {
1051         __pAppInfo = const_cast<void*>(pAppInfo);
1052 }
1053
1054 void*
1055 _TableViewItem::GetAppInfo(void) const
1056 {
1057         return __pAppInfo;
1058 }
1059
1060 void
1061 _TableViewItem::SetItemChanged(bool changed)
1062 {
1063         __itemChanged = changed;
1064 }
1065
1066 bool
1067 _TableViewItem::IsItemChanged(void) const
1068 {
1069         return __itemChanged;
1070 }
1071
1072 bool
1073 _TableViewItem::IsAnnexOnOffSliding(void)
1074 {
1075         return __annexOnOffHandlerMoved;
1076 }
1077
1078 TableViewAnnexStyle
1079 _TableViewItem::GetItemStyle(void) const
1080 {
1081         return __annexStyle;
1082 }
1083
1084 bool
1085 _TableViewItem::DrawItem(FloatRectangle& rcItem, ListItemState itemState, bool itemDivider)
1086 {
1087         return true;
1088 }
1089
1090 bool
1091 _TableViewItem::SetItemTapSoundEnabled(bool tapSoundEnabled)
1092 {
1093         bool oldValue = __isItemTapSoundEnabled;
1094         __isItemTapSoundEnabled = tapSoundEnabled;
1095         return oldValue;
1096 }
1097
1098 bool
1099 _TableViewItem::GetItemTapSoundEnabled(void)
1100 {
1101         return __isItemTapSoundEnabled;
1102 }
1103
1104 Tizen::Graphics::Canvas*
1105 _TableViewItem::OnCanvasRequestedN(const Tizen::Graphics::FloatRectangle& bounds)
1106 {
1107         Canvas* pCanvas = null;
1108
1109         if(__pBitmapVisualElement != null && __pBitmapVisualElement->GetImageSource().IsEmpty())
1110         {
1111                 Bitmap* pDrawBitmap = __pItemBgBitmap[__drawingStatus];
1112                 if(pDrawBitmap != null)
1113                 {
1114                         pCanvas = __pBitmapVisualElement->GetCanvasN();
1115                         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
1116                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1117                         pCanvas->Clear();
1118
1119                         pDrawBitmap->IsNinePatchedBitmap();
1120                         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pDrawBitmap);
1121                 }
1122         }
1123
1124 CATCH:
1125
1126         return pCanvas;
1127 }
1128
1129 void
1130 _TableViewItem::FireItemEvent(bool selectedItem)
1131 {
1132         if (!HasParent()
1133                 || IsContextItem()
1134                 || __itemType == TABLE_VIEW_ITEM_TYPE_HEADER
1135                 || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER)
1136         {
1137                 return;
1138         }
1139
1140         _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
1141         if (pParent == null)
1142         {
1143                 return;
1144         }
1145
1146         TableViewNotifyType eventType = TABLEVIEW_NOTIFY_TYPE_SELECTED_ITEM;
1147
1148         if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
1149                 || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
1150                 || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING))
1151         {
1152                 if (IsChecked())
1153                 {
1154                         eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_CHECK;
1155                 }
1156                 else
1157                 {
1158                         eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_UNCHECK;
1159                 }
1160         }
1161         else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
1162         {
1163                 if (!selectedItem)
1164                 {
1165                         eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_MORE;
1166                 }
1167         }
1168         else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1169         {
1170                 if (selectedItem)
1171                 {
1172                         eventType = TABLEVIEW_NOTIFY_TYPE_SELECTED_ITEM;
1173                 }
1174                 else
1175                 {
1176                         if (IsChecked())
1177                         {
1178                                 eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_CHECK;
1179                         }
1180                         else
1181                         {
1182                                 eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_UNCHECK;
1183                         }
1184                 }
1185         }
1186
1187         if (__isItemTapSoundEnabled)
1188         {
1189                 if (!__isTabSoundPlayed)
1190                 {
1191                         PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, this);
1192                 }
1193         }
1194
1195         __isTabSoundPlayed = false;
1196         __checkItemHeightNeeded = true;
1197
1198         int groupIndex = -1;
1199         int itemIndex = -1;
1200         GetItemIndex(groupIndex, itemIndex);
1201         pParent->FireTableViewItemEvent(groupIndex, itemIndex, eventType, this);
1202 }
1203
1204 void
1205 _TableViewItem::FireItemSweepEvent(TableViewSweepDirection direction)
1206 {
1207         if (HasParent() == false)
1208         {
1209                 return;
1210         }
1211
1212         _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
1213         if (pParent == null)
1214         {
1215                 return;
1216         }
1217
1218         int groupIndex = -1;
1219         int itemIndex = -1;
1220         GetItemIndex(groupIndex, itemIndex);
1221
1222         pParent->FireTableViewItemSweepEvent(groupIndex, itemIndex, direction);
1223 }
1224
1225 bool
1226 _TableViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1227 {
1228         if (IsContextItem() ||
1229                 __isContextItemActivated ||
1230                 IsAnimationPlaying() ||
1231                 IsReorderMode())
1232         {
1233                 return true;
1234         }
1235
1236         if (IsTouchPressOnScroll())
1237         {
1238                 return true;
1239         }
1240
1241         __annexOnOffHandlerMoved = false;
1242         __touchStartPosition = touchinfo.GetCurrentPosition();
1243
1244         if (&source == this)
1245         {
1246                 __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
1247         }
1248         else if (&source == GetLabelCore(__pItemAnnex))
1249         {
1250                 __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
1251
1252                 if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
1253                         __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1254                 {
1255                         __annexTouchStartPosition = touchinfo.GetCurrentPosition().x;
1256                 }
1257         }
1258         else if (IsIndividualSelectionEnabled(source))
1259         {
1260                 __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
1261         }
1262         else
1263         {
1264                 __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
1265         }
1266
1267         if(__isReleasedTimerEnabled)
1268         {
1269                 StopTouchReleasedTimer();
1270
1271                 _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
1272                 if (pParent != null)
1273                 {
1274                         int groupIndex = -1;
1275                         int itemIndex = -1;
1276                         GetItemIndex(groupIndex, itemIndex);
1277                         pParent->FireItemTouchReleasedEventDuringPressing(groupIndex, itemIndex);
1278                 }
1279         }
1280         else
1281         {
1282                 if (!IsIndividualSelectionEnabled(source))
1283                 {
1284                         __itemSelected = true;
1285                         if(unlikely((_AccessibilityManager::IsActivated())))
1286                         {
1287                                 FireItemTouchPressed();
1288                         }
1289                         else
1290                         {
1291                                 StartTouchPressedTimer(source, touchinfo);
1292                         }
1293                 }
1294         }
1295
1296         return true;
1297 }
1298
1299 bool
1300 _TableViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1301 {
1302         if (IsReorderMode())
1303         {
1304                 return true;
1305         }
1306
1307         if (IsTouchPressOnScroll())
1308         {
1309                 SetTouchPressOnScroll(false);
1310                 return true;
1311         }
1312
1313         if (&source == this)
1314         {
1315                 __releasedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
1316         }
1317         else if (&source == GetLabelCore(__pItemAnnex))
1318         {
1319                 __releasedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
1320         }
1321         else if (IsIndividualSelectionEnabled(source))
1322         {
1323                 __releasedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
1324         }
1325         else
1326         {
1327                 __releasedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
1328         }
1329
1330         __isTabSoundPlayed = IS_PLAYED_FEEDBACK();
1331
1332         if(!__itemTouchMoved && __isPressedTimerEnabled)
1333         {
1334                 StopTouchPressedTimer();
1335
1336                 if(!IsContextItem())
1337                 {
1338                         FireItemTouchPressed();
1339                 }
1340
1341                 StartTouchReleasedTimer();
1342                 return true;
1343         }
1344
1345         FireItemTouchReleased();
1346         return true;
1347 }
1348
1349 void
1350 _TableViewItem::FireItemTouchPressed()
1351 {
1352         if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
1353         {
1354                 __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
1355                 SetItemChanged(true);
1356                 Invalidate();
1357         }
1358         else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
1359         {
1360                 if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
1361                 {
1362                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1363                         __isSelectedDetailButton = true;
1364                         DrawAnnexStyle();
1365                 }
1366                 else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
1367                                         __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1368                 {
1369                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1370                 }
1371                 else
1372                 {
1373                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
1374                         SetItemChanged(true);
1375                         Invalidate();
1376                 }
1377         }
1378         else
1379         {
1380                 if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
1381                 {
1382                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
1383                         SetItemChanged(true);
1384                         Invalidate();
1385                 }
1386         }
1387 }
1388
1389 void
1390 _TableViewItem::FireItemTouchReleased()
1391 {
1392         bool fireItemEvent = false;
1393         bool selectedItem = true;
1394
1395         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1396
1397         if (__itemSelected == true)
1398         {
1399                 bool checked = IsChecked();
1400                 fireItemEvent = true;
1401
1402                 if (__releasedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
1403                 {
1404                         if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
1405                                 || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING))
1406                         {
1407                                 SetChecked(!checked);
1408                         }
1409                         else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
1410                         {
1411                                 SetChecked(!checked);
1412                                 SetCheckedAnimationEnabled(!checked);
1413                         }
1414                 }
1415                 else if(__releasedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
1416                 {
1417                         if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
1418                         {
1419                                 __isSelectedDetailButton = false;
1420                                 DrawAnnexStyle();
1421                                 selectedItem = false;
1422                         }
1423                         else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
1424                                 __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1425                         {
1426                                 bool isPreviousChecked = IsChecked();
1427                                 AdjustAnnexOnOffHandlerPosition();
1428                                 selectedItem = false;
1429                                 if (isPreviousChecked == IsChecked())
1430                                 {
1431                                         fireItemEvent = false;
1432                                 }
1433                         }
1434                         else
1435                         {
1436                                 SetChecked(!checked);
1437                                 SetCheckedAnimationEnabled(!checked);
1438                         }
1439                 }
1440                 else
1441                 {
1442                         if(__releasedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
1443                         {
1444                                 if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
1445                                         || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
1446                                         || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING))
1447                                 {
1448                                         SetChecked(!checked);
1449                                         SetCheckedAnimationEnabled(!checked);
1450                                 }
1451                         }
1452                         else
1453                         {
1454                                 fireItemEvent = false;
1455                         }
1456                 }
1457
1458                 SetItemChanged(true);
1459                 Invalidate();
1460
1461         }
1462         else
1463         {
1464                 if (__releasedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
1465                 {
1466                         if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
1467                                 __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1468                         {
1469                                 bool isPreviousChecked = IsChecked();
1470                                 AdjustAnnexOnOffHandlerPosition();
1471                                 fireItemEvent = true;
1472                                 if (isPreviousChecked == IsChecked())
1473                                 {
1474                                         fireItemEvent = false;
1475                                 }
1476                         }
1477                 }
1478         }
1479
1480         __itemSelected = false;
1481         __annexOnOffHandlerMoved = false;
1482         __itemTouchMoved = false;
1483
1484         if (fireItemEvent)
1485         {
1486                 FireItemEvent(selectedItem);
1487         }
1488 }
1489
1490 bool
1491 _TableViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1492 {
1493         if(IsReorderMode())
1494         {
1495                 return false;
1496         }
1497
1498         if (IsTouchPressOnScroll())
1499         {
1500                 SetTouchPressOnScroll(false);
1501         }
1502
1503         if (__isPressedTimerEnabled)
1504         {
1505                 StopTouchPressedTimer();
1506         }
1507
1508         bool retVal = false;
1509
1510         if (&source == this)
1511         {
1512                 __itemSelected = false;
1513                 __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1514
1515                 SetItemChanged(true);
1516                 Invalidate();
1517         }
1518         else if (&source == GetLabelCore(__pItemAnnex))
1519         {
1520                 if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
1521                 {
1522                         __isSelectedDetailButton = false;
1523                         __itemSelected = false;
1524                         DrawAnnexStyle();
1525                 }
1526                 else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
1527                         __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1528                 {
1529                         __annexOnOffHandlerMoved = true;
1530                         DrawAnnexOnOffHandler(touchinfo.GetCurrentPosition().x);
1531                         retVal = true;
1532                 }
1533                 else
1534                 {
1535                         __itemSelected = false;
1536                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1537
1538                         SetItemChanged(true);
1539                         Invalidate();
1540                 }
1541         }
1542         else
1543         {
1544                 if(!IsIndividualSelectionEnabled(source))
1545                 {
1546                         __itemSelected = false;
1547                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1548
1549                         SetItemChanged(true);
1550                         Invalidate();
1551                 }
1552         }
1553
1554         __itemTouchMoved = true;
1555
1556         return retVal;
1557 }
1558
1559 bool
1560 _TableViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
1561 {
1562         if (__isPressedTimerEnabled)
1563         {
1564                 StopTouchPressedTimer();
1565         }
1566
1567         __annexOnOffHandlerMoved = false;
1568         __itemTouchMoved = false;
1569
1570         __itemSelected = false;
1571         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1572
1573         if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
1574         {
1575                 __isSelectedDetailButton = false;
1576         }
1577
1578         SetItemChanged(true);
1579         Invalidate();
1580
1581         if (&source != this)
1582         {
1583                 return false;
1584         }
1585
1586         return true;
1587 }
1588
1589 _UiTouchEventDelivery
1590 _TableViewItem::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1591 {
1592         if (IsTouchPressOnScroll())
1593         {
1594                 SetTouchPressOnScroll(false);
1595                 return _UI_TOUCH_EVENT_DELIVERY_NO;
1596         }
1597         return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES;
1598 }
1599
1600 _UiTouchEventDelivery
1601 _TableViewItem::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1602 {
1603         return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES;
1604 }
1605
1606 _UiTouchEventDelivery
1607 _TableViewItem::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1608 {
1609         return _UI_TOUCH_EVENT_DELIVERY_YES;
1610 }
1611
1612 _UiTouchEventDelivery
1613 _TableViewItem::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
1614 {
1615         return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES;
1616 }
1617
1618 void
1619 _TableViewItem::OnDraw(void)
1620 {
1621         if (IsItemChanged() == true)
1622         {
1623                 DrawItemBackground();
1624                 DrawAnnexStyle();
1625                 DrawItemDivider();
1626                 DrawSimpleItem();
1627                 DrawSectionStyleBackgroundCover();
1628
1629                 SetItemChanged(false);
1630         }
1631 }
1632
1633 void
1634 _TableViewItem::OnChildAttached(const _Control& child)
1635 {
1636         _Control* pControl = const_cast<_Control*>(&child);
1637         _AccessibilityContainer* pContainer = pControl->GetAccessibilityContainer();
1638
1639         if (__individualSelectionControls.Contains(child))
1640         {
1641                 pContainer->Activate(true);
1642         }
1643         else
1644         {
1645                 pContainer->Activate(false);
1646
1647                 if(!(pControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
1648                         || pControl == static_cast<_Control*>(__pItemAnnexRightDivider)
1649                         || pControl == static_cast<_Control*>(__pItemCover)
1650                         || pControl == static_cast<_Control*>(__pItemDivider)
1651                         || pControl== static_cast<_Control*>(__pItemTopDivider)))
1652                 {
1653                         GetAccessibilityContainer()->Activate(true);
1654                 }
1655         }
1656
1657         pControl->SetTouchPressThreshold(SENSITIVE);
1658
1659         FloatRectangle bounds = child.GetBoundsF();
1660
1661         if (__pDrawingProperty != null && __pDrawingProperty->groupedLookEnabled)
1662         {
1663                 float groupedBarMargin = 0.0f;
1664                 GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, groupedBarMargin);
1665
1666                 bounds.x += groupedBarMargin;
1667         }
1668
1669         if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO))
1670         {
1671                 if (GetLabelCore(__pItemAnnex) == &child ||
1672                         GetLabelCore(__pSimpleItemBitmap) == &child ||
1673                         GetLabelCore(__pSimpleItemText) == &child)
1674                 {
1675                         return;
1676                 }
1677
1678                 float leftMargin = 0.0f;
1679                 float annexWidth = 0.0f;
1680
1681                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
1682                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
1683
1684                 bounds.x += (leftMargin * 2) + annexWidth;
1685         }
1686
1687         pControl->SetBounds(bounds);
1688 }
1689
1690 void
1691 _TableViewItem::OnChildDetached(const _Control& child)
1692 {
1693         if (__individualSelectionControls.Contains(child))
1694         {
1695                 __individualSelectionControls.Remove(child, false);
1696         }
1697
1698         _Label* pSimpleItemTextCore = GetLabelCore(__pSimpleItemText);
1699         _Label* pSimpleItemBitmapCore = GetLabelCore(__pSimpleItemBitmap);
1700
1701         if (&child == pSimpleItemTextCore)
1702         {
1703                 __pSimpleItemText = null;
1704         }
1705
1706         if (&child == pSimpleItemBitmapCore)
1707         {
1708                 __pSimpleItemBitmap = null;
1709         }
1710 }
1711
1712 void
1713 _TableViewItem::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
1714 {
1715         result r = E_SUCCESS;
1716
1717         if (&timer == __pCheckedTimer)
1718         {
1719                 if (__checkedCount < MAX_CHECKED_COUNT)
1720                 {
1721                         r = __pCheckedTimer->Start(CHECKED_ANIMATION_DURATION);
1722                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1723                 }
1724
1725                 r = PlayCheckBoxAnimation();
1726                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1727
1728                 if (__checkedCount < MAX_CHECKED_COUNT)
1729                 {
1730                         __checkedCount++;
1731                 }
1732                 else
1733                 {
1734                         __checkedCount = 0;
1735                         __isCheckedAnimationEnabled = false;
1736                         __isCheckedTimerEnabled = false;
1737                 }
1738         }
1739         else if (&timer == __pPressedTimer)
1740         {
1741                 __isPressedTimerEnabled = false;
1742                 FireItemTouchPressed();
1743         }
1744         else if(&timer == __pReleasedTimer)
1745         {
1746                 __isReleasedTimerEnabled = false;
1747                 FireItemTouchReleased();
1748         }
1749 }
1750
1751 result
1752 _TableViewItem::StartTouchPressedTimer(const _Control& source, const _TouchInfo& touchinfo)
1753 {
1754         result r = E_SUCCESS;
1755
1756         if (__pPressedTimer == null)
1757         {
1758                 __pPressedTimer = new (std::nothrow) Timer();
1759                 SysTryCatch(NID_UI_CTRL, __pPressedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1760
1761                 r = __pPressedTimer->Construct(*this);
1762                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage);
1763         }
1764
1765         if (__isPressedTimerEnabled == false)
1766         {
1767                 r = __pPressedTimer->Start(TOUCH_PRESSED_DURATION);
1768                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage);
1769
1770                 __isPressedTimerEnabled = true;
1771         }
1772
1773         return r;
1774
1775 CATCH:
1776         if (__isPressedTimerEnabled && __pPressedTimer != null)
1777         {
1778                 __pPressedTimer->Cancel();
1779         }
1780
1781         delete __pPressedTimer;
1782         __pPressedTimer = null;
1783
1784         return r;
1785 }
1786
1787 void
1788 _TableViewItem::StopTouchPressedTimer(void)
1789 {
1790         result r = E_SUCCESS;
1791
1792         SysTryReturnVoidResult(NID_UI_CTRL, __pPressedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
1793
1794         if (__isPressedTimerEnabled)
1795         {
1796                 r = __pPressedTimer->Cancel();
1797                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1798         }
1799
1800         __isPressedTimerEnabled = false;
1801
1802         return;
1803 }
1804
1805 result
1806 _TableViewItem::StartTouchReleasedTimer()
1807 {
1808         result r = E_SUCCESS;
1809
1810         if(__pReleasedTimer == null)
1811         {
1812                 __pReleasedTimer = new (std::nothrow) Timer();
1813                 SysTryCatch(NID_UI_CTRL, __pReleasedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1814
1815                 r = __pReleasedTimer->Construct(*this);
1816                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage);
1817         }
1818
1819         if(!__isReleasedTimerEnabled)
1820         {
1821                 r = __pReleasedTimer->Start(TOUCH_RELEASED_DURATION);
1822                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage);
1823         }
1824         __isReleasedTimerEnabled = true;
1825
1826         return r;
1827
1828 CATCH:
1829         if (__isReleasedTimerEnabled && __pReleasedTimer != null)
1830         {
1831                 __pReleasedTimer->Cancel();
1832         }
1833
1834         delete __pReleasedTimer;
1835         __pReleasedTimer = null;
1836
1837         return r;
1838 }
1839
1840 void
1841 _TableViewItem::StopTouchReleasedTimer(void)
1842 {
1843         result r = E_SUCCESS;
1844
1845         SysTryReturnVoidResult(NID_UI_CTRL, __pReleasedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
1846
1847         if (__isReleasedTimerEnabled)
1848         {
1849                 r = __pReleasedTimer->Cancel();
1850                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1851         }
1852
1853         __isReleasedTimerEnabled = false;
1854
1855         return;
1856 }
1857
1858 void
1859 _TableViewItem::OnAncestorInputEnableStateChanged(const _Control& control)
1860 {
1861         if (__isPressedTimerEnabled)
1862         {
1863                 StopTouchPressedTimer();
1864         }
1865
1866         __annexOnOffHandlerMoved = false;
1867         __itemTouchMoved = false;
1868
1869         __itemSelected = false;
1870         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
1871
1872         if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
1873         {
1874                 __isSelectedDetailButton = false;
1875         }
1876
1877         SetItemChanged(true);
1878         Invalidate();
1879 }
1880
1881 result
1882 _TableViewItem::StartCheckBoxAnimation(void)
1883 {
1884         result r = E_SUCCESS;
1885
1886         if (__pCheckedTimer == null)
1887         {
1888                 __pCheckedTimer = new (std::nothrow) Timer();
1889                 SysTryCatch(NID_UI_CTRL, __pCheckedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1890
1891                 r = __pCheckedTimer->Construct(*this);
1892                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage);
1893         }
1894
1895         if (__isCheckedTimerEnabled == false)
1896         {
1897                 r = __pCheckedTimer->Start(CHECKED_ANIMATION_DURATION);
1898                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage);
1899
1900                 __isCheckedTimerEnabled = true;
1901         }
1902
1903         return r;
1904
1905 CATCH:
1906         if (__isCheckedTimerEnabled)
1907         {
1908                 __pCheckedTimer->Cancel();
1909         }
1910
1911         delete __pCheckedTimer;
1912         __pCheckedTimer = null;
1913
1914         return r;
1915 }
1916
1917 void
1918 _TableViewItem::StopCheckBoxAnimation(void)
1919 {
1920         result r = E_SUCCESS;
1921
1922         SysTryReturnVoidResult(NID_UI_CTRL, __pCheckedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
1923
1924         if (__isCheckedTimerEnabled)
1925         {
1926                 r = __pCheckedTimer->Cancel();
1927                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1928         }
1929
1930         __checkedCount = 0;
1931         __isCheckedAnimationEnabled = false;
1932         __isCheckedTimerEnabled = false;
1933
1934         return;
1935 }
1936
1937 result
1938 _TableViewItem::PlayCheckBoxAnimation(void)
1939 {
1940         Bitmap* pCheckBox = null;
1941         Bitmap* pCheckBoxBg = null;
1942         Bitmap* pMergeBitmap = null;
1943         Canvas* pCanvas = null;
1944         result r = E_SUCCESS;
1945
1946         FloatRectangle bounds;
1947
1948         float annexWidth = 0.0f;
1949         float annexHeight = 0.0f;
1950
1951         if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
1952         {
1953                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBoxBg);
1954         }
1955         else if ((__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED) || (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED))
1956         {
1957                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBoxBg);
1958         }
1959         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBoxBg != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
1960
1961         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBox);
1962         SysTryCatch(NID_UI_CTRL,(r == E_SUCCESS) && (pCheckBox != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
1963
1964         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
1965         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
1966
1967         bounds.SetBounds(0, 0, annexWidth, annexHeight);
1968
1969         pCanvas = new (std::nothrow) Canvas();
1970         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
1971
1972         r = pCanvas->Construct(bounds);
1973         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1974         pCanvas->Clear();
1975
1976         DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pCheckBoxBg), *pCheckBoxBg);
1977
1978         __checkedBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pCheckBox);
1979         if (IsChecked() == true)
1980         {
1981                 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pCheckBox))
1982                 {
1983                         FloatRectangle drawingRect(__checkedBounds.x, __checkedBounds.y, __checkedBounds.width, __checkedBounds.height);
1984                         r = pCanvas->DrawNinePatchedBitmap(drawingRect, *pCheckBox); // +++ check floating
1985                 }
1986                 else
1987                 {
1988                         FloatRectangle bitmapSourceRect(0.0f, 0.0f, pCheckBox->GetWidthF()*__checkedCount * 0.1, pCheckBox->GetHeightF());
1989                         FloatRectangle drawingRect(__checkedBounds.x, __checkedBounds.y, __checkedBounds.width * __checkedCount * 0.1, __checkedBounds.height);
1990                         r = pCanvas->DrawBitmap(drawingRect, *pCheckBox, bitmapSourceRect); // +++ check floating
1991                 }
1992         }
1993
1994         pMergeBitmap = new (std::nothrow) Bitmap();
1995         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
1996
1997         pMergeBitmap->Construct(*pCanvas, bounds);
1998         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
1999
2000         if(__pItemAnnex)
2001         {
2002                 __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
2003                 __pItemAnnex->Invalidate(false);
2004         }
2005
2006 CATCH:
2007         delete pCheckBox;
2008         delete pCheckBoxBg;
2009         delete pMergeBitmap;
2010         delete pCanvas;
2011
2012         return r;
2013 }
2014
2015 void
2016 _TableViewItem::SetItemLayoutEnabled(bool enabled)
2017 {
2018         __isItemLayoutEnabled = enabled;
2019 }
2020
2021 bool
2022 _TableViewItem::GetItemLayoutEnabled(void)
2023 {
2024         return __isItemLayoutEnabled;
2025 }
2026
2027 void
2028 _TableViewItem::OnBoundsChanged(void)
2029 {
2030         if (__checkItemHeightNeeded && HasParent())
2031         {
2032                 _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
2033                 if (pParent != null)
2034                 {
2035                         int groupIndex = -1;
2036                         int itemIndex = -1;
2037                         GetItemIndex(groupIndex, itemIndex);
2038
2039                         pParent->CheckItemHeightAndRefreshLayout(groupIndex, itemIndex);
2040                 }
2041
2042                 __checkItemHeightNeeded = false;
2043         }
2044
2045         AdjustAnnexBounds();
2046
2047         SetItemHighlightBounds(*__pHighlightVisualElement, CalculateItemHighlightBounds());
2048
2049         if (__pHeaderFooterItemText != null)
2050         {
2051                 FloatRectangle textBounds = __pHeaderFooterItemText->GetBoundsF();
2052                 textBounds.width = GetBoundsF().width;
2053
2054                 if (__itemType == TABLE_VIEW_ITEM_TYPE_FOOTER)
2055                 {
2056                         textBounds.x -= __pDrawingProperty->scrollMargin;
2057                 }
2058
2059                 __pHeaderFooterItemText->SetBounds(textBounds);
2060         }
2061
2062         if(__pBitmapVisualElement != null)
2063         {
2064                 FloatRectangle bounds = GetBoundsF();
2065                 __pBitmapVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
2066         }
2067
2068         if(__pAccessibilityElement != null)
2069         {
2070                 __pAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
2071         }
2072 }
2073
2074 void
2075 _TableViewItem::SetDrawingProperty(_ItemDrawingProperty* pDrawingProperty)
2076 {
2077
2078         SysTryReturnVoidResult(NID_UI_CTRL, pDrawingProperty != null, E_INVALID_ARG, "[E_INAVLID_ARG] pDrawingProperty is null");
2079
2080         __pDrawingProperty = pDrawingProperty;
2081
2082         if (__pDrawingProperty->sectionStyleEnabled == true &&
2083                 !IsContextItem())
2084         {
2085                 CreateItemCover();
2086         }
2087
2088         if(__pDrawingProperty->itemDividerEnabled)
2089         {
2090                 CreateItemDivider();
2091         }
2092
2093         CreateAnnexStyle();
2094 }
2095
2096 _ItemDrawingProperty*
2097 _TableViewItem::GetDrawingProperty(void)
2098 {
2099         return __pDrawingProperty;
2100 }
2101
2102 void
2103 _TableViewItem::DrawItemBackground(void)
2104 {
2105         Canvas* pCanvas = null;
2106         Bitmap* pDrawBitmap = __pItemBgBitmap[__drawingStatus];
2107         Color bgColor = __colorItemBg[__drawingStatus];
2108         FloatRectangle bounds = GetBoundsF();
2109
2110         SetItemHighlightBounds(*__pHighlightVisualElement, CalculateItemHighlightBounds());
2111         __pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f));
2112
2113         if(pDrawBitmap != null && __enabledState)
2114         {
2115                 if(__pBitmapVisualElement == null)
2116                 {
2117                         return;
2118                 }
2119
2120                 String imagePath = null;
2121                 if(_BitmapImpl::CheckNinePatchedBitmapStrictly(*pDrawBitmap) == false)
2122                 {
2123                         imagePath = _BitmapImpl::GetInstance(*pDrawBitmap)->GetFileName();
2124                 }
2125
2126                 if(imagePath.IsEmpty() == false)
2127                 {
2128                         __pBitmapVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() /255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255));
2129                         __pBitmapVisualElement->SetImageSource(imagePath);
2130                 }
2131                 else
2132                 {
2133                         pCanvas = __pBitmapVisualElement->GetCanvasN();
2134                         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2135                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2136                         pCanvas->Clear();
2137
2138                         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pDrawBitmap);
2139                 }
2140         }
2141
2142         if(IsContextItem())
2143         {
2144                 DrawContextItemBackground();
2145         }
2146         else if (__pDrawingProperty->sectionStyleEnabled == true)
2147         {
2148                 DrawSectionStyleBackground();
2149         }
2150         else
2151         {
2152                 if(__enabledState)
2153                 {
2154                         if (__itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER)
2155                         {
2156                                 SetBackgroundColor(Color(0, 0, 0, 0));
2157                                 __pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f));
2158                         }
2159                         else if(__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
2160                         {
2161                                 __pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
2162                         }
2163                         else
2164                         {
2165                                 SetBackgroundColor(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]);
2166
2167                                 __pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
2168
2169                                 if (__pDrawingProperty->groupedLookEnabled == true)
2170                                 {
2171                                         DrawGroupedLook();
2172                                 }
2173                         }
2174                 }
2175                 else
2176                 {
2177                         GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor);
2178                         SetBackgroundColor(bgColor);
2179                         __pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
2180
2181                         if (__pDrawingProperty->groupedLookEnabled == true)
2182                         {
2183                                 DrawGroupedLook();
2184                         }
2185                 }
2186         }
2187
2188         delete pCanvas;
2189         return;
2190
2191 CATCH:
2192
2193         if (__pBitmapVisualElement != null)
2194         {
2195                 __pBitmapVisualElement->RemoveAllAnimations();
2196                 __pBitmapVisualElement->SetAnimationProvider(null);
2197                 __pBitmapVisualElement->Destroy();
2198                 __pBitmapVisualElement = null;
2199         }
2200 }
2201
2202 void
2203 _TableViewItem::DrawGroupedLook(void)
2204 {
2205         if (IsTitleStyleItem() || IsContextItem())
2206         {
2207                 return;
2208         }
2209
2210         Color barColor;
2211         Color outlineColor = __pDrawingProperty->dividerColor;
2212
2213         float barWidth = 0.0f;
2214
2215         Canvas* pCanvas = GetVisualElement()->GetCanvasN();
2216         SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
2217
2218         FloatRectangle bounds = GetBoundsF();
2219         pCanvas->SetBackgroundColor(GetBackgroundColor());
2220         pCanvas->Clear();
2221
2222         GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BAR_NORMAL, barColor);
2223         GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, barWidth);
2224
2225         pCanvas->FillRectangle(barColor, FloatRectangle(0.0f, 0.0f, barWidth, bounds.height));
2226
2227         if (__pDrawingProperty->sectionStyleEnabled == true)
2228         {
2229                 pCanvas->FillRectangle(outlineColor, FloatRectangle(bounds.width - 1.0f, 0.0f, 1.0f, bounds.height));
2230
2231                 if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP || __itemType == TABLE_VIEW_ITEM_TYPE_ONE)
2232                 {
2233                         pCanvas->FillRectangle(outlineColor, FloatRectangle(0.0f, 0.0f, bounds.width, 1.0f));
2234                 }
2235         }
2236
2237         delete pCanvas;
2238 }
2239
2240 void
2241 _TableViewItem::DrawSectionStyleBackground(void)
2242 {
2243         Canvas* pCanvas = null;
2244         Bitmap* pSectionBg = null;
2245         Bitmap* pSectionPressBg = null;
2246         Bitmap* pSectionDisabledBg = null;
2247         Bitmap* pReplacementSectionPressBg = null;
2248         Bitmap* pReplacementSectionBg = null;
2249         Color bgColor = __colorItemBg[__drawingStatus];
2250         FloatRectangle bounds = GetBoundsF();
2251         float dividerHeight = 0.0f;
2252
2253         result r = E_SUCCESS;
2254
2255         pCanvas = GetVisualElement()->GetCanvasN();
2256         SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
2257
2258         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2259         pCanvas->Clear();
2260
2261         if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
2262         {
2263                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBg);
2264         }
2265         else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
2266         {
2267                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBg);
2268         }
2269         else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
2270         {
2271                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBg);
2272         }
2273         else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
2274         {
2275                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBg);
2276         }
2277         else
2278         {
2279                 r = E_SYSTEM;
2280         }
2281         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2282
2283         if (__enabledState)
2284         {
2285                 if(__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED || __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED)
2286                 {
2287                         if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
2288                         {
2289                                 if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_SINGLE_BG_PRESSED))
2290                                 {
2291                                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
2292                                         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2293                                 }
2294                         }
2295                         else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
2296                         {
2297                                 if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_TOP_BG_PRESSED))
2298                                 {
2299                                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
2300                                         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2301                                 }
2302                         }
2303                         else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
2304                         {
2305                                 if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_CENTER_BG_PRESSED))
2306                                 {
2307                                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
2308                                         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2309                                 }
2310                         }
2311                         else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
2312                         {
2313                                 if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_BOTTOM_BG_PRESSED))
2314                                 {
2315                                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
2316                                         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2317                                 }
2318                         }
2319
2320                         GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeight);
2321
2322                         if(pSectionPressBg)
2323                         {
2324                                 pReplacementSectionPressBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionPressBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2325                         }
2326                         else
2327                         {
2328                                 pReplacementSectionPressBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2329                         }
2330
2331                         DrawBitmap(*pCanvas, FloatRectangle(0.0f, dividerHeight, bounds.width, bounds.height - (dividerHeight * 2)), *pReplacementSectionPressBg);
2332                 }
2333                 else
2334                 {
2335                         if(bgColor != null)
2336                         {
2337                                 pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2338                         }
2339                         else
2340                         {
2341                                 pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), __pDrawingProperty->sectionStyleBgColor);
2342                         }
2343
2344                         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pReplacementSectionBg);
2345                 }
2346         }
2347         else
2348         {
2349                 if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
2350                 {
2351                         if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_SINGLE_BG_DISABLED))
2352                         {
2353                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
2354                                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2355                         }
2356                 }
2357                 else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
2358                 {
2359                         if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_TOP_BG_DISABLED))
2360                         {
2361                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
2362                                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2363                         }
2364                 }
2365                 else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
2366                 {
2367                         if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_CENTER_BG_DISABLED))
2368                         {
2369                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
2370                                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2371                         }
2372                 }
2373                 else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
2374                 {
2375                         if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_BOTTOM_BG_DISABLED))
2376                         {
2377                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
2378                                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2379                         }
2380                 }
2381
2382                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor);
2383                 if(pSectionDisabledBg)
2384                 {
2385                         pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionDisabledBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2386                 }
2387                 else
2388                 {
2389                         pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2390                 }
2391                 DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pReplacementSectionBg);
2392         }
2393
2394         if (__pDrawingProperty->groupedLookEnabled == true)
2395         {
2396                 Color barColor;
2397
2398                 float barWidth = 0.0f;
2399                 float barMargin = 0.0f;
2400
2401                 GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BAR_NORMAL, barColor);
2402                 GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, barWidth);
2403                 GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, barMargin);
2404
2405                 pCanvas->FillRectangle(barColor, FloatRectangle(0.0f, barMargin, barWidth, bounds.height-barMargin));
2406         }
2407
2408 CATCH:
2409         delete pSectionBg;
2410         delete pSectionPressBg;
2411         delete pSectionDisabledBg;
2412         delete pReplacementSectionPressBg;
2413         delete pReplacementSectionBg;
2414         delete pCanvas;
2415 }
2416
2417 void
2418 _TableViewItem::DrawSectionStyleBackgroundCover(void)
2419 {
2420         if (!__pDrawingProperty->sectionStyleEnabled ||
2421                 __pItemCover == null)
2422         {
2423                 return;
2424         }
2425
2426         Bitmap* pSectionBgCoverEf = null;
2427         Bitmap* pReplacementSectionBgEf = null;
2428         Bitmap* pReplacementSectionBg = null;
2429         Bitmap* pSectionBgCoverBg = null;
2430         Bitmap* pMergeBitmap = null;
2431         Canvas* pCanvas = null;
2432         Color bgColor;
2433
2434         result r = E_SUCCESS;
2435         FloatRectangle bounds = GetBoundsF();
2436         if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
2437         {
2438                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_COVER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverEf);
2439         }
2440         else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
2441         {
2442                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_COVER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverEf);
2443         }
2444         else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
2445         {
2446                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_COVER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverEf);
2447         }
2448         else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
2449         {
2450                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_COVER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverEf);
2451         }
2452         else
2453         {
2454                 r = E_SYSTEM;
2455         }
2456         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2457
2458         if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
2459         {
2460                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_COVER_ROUND_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverBg);
2461         }
2462         else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
2463         {
2464                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_COVER_ROUND_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverBg);
2465         }
2466         else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
2467         {
2468                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_COVER_ROUND_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverBg);
2469         }
2470         else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
2471         {
2472                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_COVER_ROUND_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCoverBg);
2473         }
2474         else
2475         {
2476                 r = E_SYSTEM;
2477         }
2478         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
2479
2480         __pItemCover->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
2481
2482         if (__enabledState)
2483         {
2484                 _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
2485                 SysTryCatch(NID_UI_CTRL, pParent != null, , E_SYSTEM, "[E_SYSTEM] SectionTableView load failed");
2486
2487                 bgColor = pParent->GetBackgroundColor();
2488         }
2489         else
2490         {
2491                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor);
2492         }
2493
2494         pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBgCoverBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2495         pReplacementSectionBgEf = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBgCoverEf, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2496
2497         pCanvas = new (std::nothrow) Canvas();
2498         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2499
2500         pCanvas->Construct(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
2501         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2502         pCanvas->Clear();
2503
2504         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pReplacementSectionBg);
2505         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pReplacementSectionBgEf);
2506
2507         pMergeBitmap = new (std::nothrow) Bitmap();
2508         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2509
2510         pMergeBitmap->Construct(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
2511
2512         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
2513
2514         __pItemCover->SetBackgroundBitmap(*pMergeBitmap);
2515
2516 CATCH:
2517         delete pSectionBgCoverEf;
2518         delete pReplacementSectionBgEf;
2519         delete pReplacementSectionBg;
2520         delete pSectionBgCoverBg;
2521         delete pCanvas;
2522         delete pMergeBitmap;
2523 }
2524
2525 void
2526 _TableViewItem::DrawContextItemBackground(void)
2527 {
2528         Canvas* pCanvas = null;
2529         Bitmap* pContextBg = null;
2530         Bitmap* pContextBgEf = null;
2531         Bitmap* pReplacementContextBg = null;
2532         Color bgColor = __colorItemBg[__drawingStatus];
2533
2534         FloatRectangle bounds = GetBoundsF();
2535         result r = E_SUCCESS;
2536
2537         r = GET_BITMAP_CONFIG_N(TABLEVIEW::QUICK_MENU_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pContextBg);
2538         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] ContextItem image load failed");
2539
2540         r = GET_BITMAP_CONFIG_N(TABLEVIEW::QUICK_MENU_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pContextBgEf);
2541         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] ContextItem image load failed");
2542
2543         pCanvas = GetVisualElement()->GetCanvasN();
2544         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2545
2546         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2547         pCanvas->Clear();
2548
2549         if(__enabledState)
2550         {
2551                 if(bgColor == null)
2552                 {
2553                         GET_COLOR_CONFIG(TABLEVIEW::CONTEXTITEM_BG_NORMAL, bgColor);
2554                 }
2555         }
2556         else
2557         {
2558                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor);
2559         }
2560         pReplacementContextBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pContextBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
2561         SysTryCatch(NID_UI_CTRL, pReplacementContextBg != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2562
2563         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pReplacementContextBg);
2564         DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pContextBgEf);
2565
2566 CATCH:
2567         delete pCanvas;
2568         delete pContextBg;
2569         delete pContextBgEf;
2570         delete pReplacementContextBg;
2571 }
2572
2573
2574 void
2575 _TableViewItem::CreateAnnexStyle(void)
2576 {
2577         switch (__annexStyle)
2578         {
2579         case TABLE_VIEW_ANNEX_STYLE_MARK:
2580                 CreateCheckBox();
2581                 break;
2582         case TABLE_VIEW_ANNEX_STYLE_RADIO:
2583                 CreateRadioBox();
2584                 break;
2585         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
2586                 CreateOnOffButton();
2587                 break;
2588         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
2589                 CreateItemAnnexDivider();
2590                 CreateOnOffButton();
2591                 break;
2592         case TABLE_VIEW_ANNEX_STYLE_DETAILED:
2593                 CreateDetailButton();
2594                 break;
2595         default:
2596                 break;
2597         }
2598 }
2599
2600 void
2601 _TableViewItem::DrawAnnexStyle(void)
2602 {
2603         switch (__annexStyle)
2604         {
2605         case TABLE_VIEW_ANNEX_STYLE_MARK:
2606                 DrawCheckBox();
2607                 break;
2608         case TABLE_VIEW_ANNEX_STYLE_RADIO:
2609                 DrawRadioBox();
2610                 break;
2611         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
2612                 DrawOnOffButton();
2613                 break;
2614         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
2615                 DrawItemAnnexDivider();
2616                 DrawOnOffButton();
2617                 break;
2618         case TABLE_VIEW_ANNEX_STYLE_DETAILED:
2619                 DrawDetailButton();
2620                 break;
2621         default:
2622                 break;
2623         }
2624 }
2625
2626 void
2627 _TableViewItem::DrawCheckBox(void)
2628 {
2629         Bitmap* pCheckBox = null;
2630         Bitmap* pCheckBoxBg = null;
2631         Bitmap* pMergeBitmap = null;
2632         Canvas* pCanvas = null;
2633         result r = E_SUCCESS;
2634
2635         FloatRectangle bounds;
2636         float annexWidth = 0.0f;
2637         float annexHeight = 0.0f;
2638
2639         if(__enabledState)
2640         {
2641                 if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
2642                 {
2643                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBoxBg);
2644                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBoxBg != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
2645
2646                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBox);
2647                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBox != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
2648                 }
2649                 else if ((__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED) || (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED))
2650                 {
2651                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBoxBg);
2652                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBoxBg != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
2653
2654                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBox);
2655                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBox != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
2656                 }
2657
2658         }
2659         else
2660         {
2661                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBoxBg);
2662                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBoxBg != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
2663
2664                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBox);
2665                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pCheckBox != null), , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
2666         }
2667
2668         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
2669         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
2670
2671         bounds.SetBounds(0.0f, 0.0f, annexWidth, annexHeight);
2672
2673         pCanvas = new (std::nothrow) Canvas();
2674         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2675
2676         pCanvas->Construct(bounds);
2677         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2678         pCanvas->Clear();
2679
2680         DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pCheckBoxBg), *pCheckBoxBg);
2681
2682         if (__isCheckedAnimationEnabled == true)
2683         {
2684                 StartCheckBoxAnimation();
2685         }
2686         else
2687         {
2688                 if (IsChecked() == true && pCheckBox != null)
2689                 {
2690                         DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pCheckBox), *pCheckBox);
2691                 }
2692         }
2693
2694         pMergeBitmap = new (std::nothrow) Bitmap();
2695         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2696
2697         pMergeBitmap->Construct(*pCanvas, bounds);
2698         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
2699
2700         __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
2701         __pItemAnnex->Invalidate(false);
2702
2703 CATCH:
2704         delete pCheckBox;
2705         delete pCheckBoxBg;
2706         delete pMergeBitmap;
2707         delete pCanvas;
2708
2709         return;
2710 }
2711
2712 void
2713 _TableViewItem::DrawRadioBox(void)
2714 {
2715         Bitmap* pRadioButton = null;
2716         Bitmap* pRadioButtonBg = null;
2717         Bitmap* pMergeBitmap = null;
2718         Canvas* pCanvas = null;
2719         result r = E_SUCCESS;
2720
2721         FloatRectangle bounds;
2722         float annexWidth = 0.0f;
2723         float annexHeight = 0.0f;
2724
2725         if(__enabledState)
2726         {
2727                 if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
2728                 {
2729                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pRadioButtonBg);
2730                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pRadioButtonBg != null), , E_SYSTEM, "[E_SYSTEM] RadioButtonBg image load failed");
2731
2732                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_BUTTON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pRadioButton);
2733                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pRadioButton != null), , E_SYSTEM, "[E_SYSTEM] CheckBox image load failed");
2734                 }
2735                 else if ((__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED) || (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED))
2736                 {
2737                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pRadioButtonBg);
2738                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pRadioButtonBg != null), , E_SYSTEM, "[E_SYSTEM] RadioButtonBg image load failed");
2739
2740                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_BUTTON_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pRadioButton);
2741                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pRadioButton != null), , E_SYSTEM, "[E_SYSTEM] CheckBox image load failed");
2742                 }
2743         }
2744         else
2745         {
2746                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_NORMAL_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pRadioButtonBg);
2747                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pRadioButtonBg != null), , E_SYSTEM, "[E_SYSTEM] RadioButtonBg image load failed");
2748
2749                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_BUTTON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pRadioButton);
2750                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pRadioButton != null), , E_SYSTEM, "[E_SYSTEM] CheckBox image load failed");
2751         }
2752
2753         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
2754         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
2755         bounds.SetBounds(0.0f, 0.0f, annexWidth, annexHeight);
2756
2757         pCanvas = new (std::nothrow) Canvas();
2758         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2759
2760         pCanvas->Construct(bounds);
2761         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2762         pCanvas->Clear();
2763
2764         DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pRadioButtonBg), *pRadioButtonBg);
2765
2766         if (pRadioButton != null && IsChecked() == true)
2767         {
2768                 DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pRadioButton), *pRadioButton);
2769         }
2770
2771         pMergeBitmap = new (std::nothrow) Bitmap();
2772         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2773
2774         pMergeBitmap->Construct(*pCanvas, bounds);
2775         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
2776
2777         __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
2778         __pItemAnnex->Invalidate(false);
2779
2780 CATCH:
2781         delete pRadioButton;
2782         delete pRadioButtonBg;
2783         delete pMergeBitmap;
2784         delete pCanvas;
2785
2786         return;
2787 }
2788
2789 void
2790 _TableViewItem::DrawOnOffButton(void)
2791 {
2792         Bitmap* pOnOffButton = null;
2793         Bitmap* pOnOffButtonHandler = null;
2794         Bitmap* pMergeBitmap = null;
2795         Canvas* pCanvas = null;
2796         result r = E_SUCCESS;
2797
2798         FloatRectangle bounds;
2799         FloatRectangle backgroundBounds;
2800         FloatRectangle handlerBounds;
2801         float annexWidth = 0.0f;
2802         float annexHeight = 0.0f;
2803         float annexMargin = 0.0f;
2804
2805         if (IsChecked() == true)
2806         {
2807                 if(__enabledState)
2808                 {
2809                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2810                 }
2811                 else
2812                 {
2813                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2814                 }
2815         }
2816         else
2817         {
2818                 if(__enabledState)
2819                 {
2820                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2821                 }
2822                 else
2823                 {
2824                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2825                 }
2826         }
2827         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), , E_SYSTEM, "[E_SYSTEM] OnOffButtonHandler image load failed");
2828
2829         if(__enabledState)
2830         {
2831                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton);
2832         }
2833         else
2834         {
2835                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton);
2836         }
2837         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButton != null), , E_SYSTEM, "[E_SYSTEM] OnOffButton image load failed");
2838
2839         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
2840         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
2841         bounds.SetBounds(0, 0, annexWidth, annexHeight);
2842
2843         pCanvas = new (std::nothrow) Canvas();
2844         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2845
2846         pCanvas->Construct(bounds);
2847         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2848         pCanvas->Clear();
2849
2850         backgroundBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButton);
2851         DrawBitmap(*pCanvas, backgroundBounds, *pOnOffButton);
2852
2853         handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler);
2854         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin);
2855         if (IsChecked() == true)
2856         {
2857                 handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
2858         }
2859         else
2860         {
2861                 handlerBounds.x = backgroundBounds.x + annexMargin;
2862         }
2863
2864         DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler);
2865
2866         pMergeBitmap = new (std::nothrow) Bitmap();
2867         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2868
2869         pMergeBitmap->Construct(*pCanvas, bounds);
2870         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
2871
2872         __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
2873         __pItemAnnex->Invalidate(false);
2874
2875 CATCH:
2876         delete pOnOffButton;
2877         delete pOnOffButtonHandler;
2878         delete pMergeBitmap;
2879         delete pCanvas;
2880
2881         return;
2882 }
2883
2884 void
2885 _TableViewItem::AdjustAnnexOnOffHandlerPosition()
2886 {
2887         float annexWidth = 0.0f;
2888         float annexHeight = 0.0f;
2889         float annexMargin = 0.0f;
2890
2891         float annexStartPositionX = 0.0f;
2892         float annexEndPositionX = 0.0f;
2893         float handlerPositionX = 0.0f;
2894         FloatRectangle handlerBounds;
2895         result r = E_SUCCESS;
2896
2897         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin);
2898
2899         Bitmap* pOnOffButtonHandler = null;
2900         if (IsChecked() == true)
2901         {
2902                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2903         }
2904         else
2905         {
2906                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2907         }
2908         SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), E_SYSTEM, "[E_SYSTEM] OnOffHandlerButton button image load failed.");
2909
2910         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
2911         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
2912
2913         annexStartPositionX = __pItemAnnex->GetBoundsF().x;
2914         annexEndPositionX = annexStartPositionX + annexWidth + annexMargin;
2915
2916         handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler);
2917
2918         if(__annexOnOffHandlerMoved)
2919         {
2920                 if(annexStartPositionX <= __annexOnOffHandlerPositionX
2921                         && annexEndPositionX >= __annexOnOffHandlerPositionX)
2922                 {
2923                         if(((annexEndPositionX - annexStartPositionX) / 2) < (__annexOnOffHandlerPositionX + (handlerBounds.width / 2)) - annexStartPositionX )
2924                         {
2925                                 handlerPositionX = annexEndPositionX;
2926                                 SetChecked(true);
2927                         }
2928                         else
2929                         {
2930                                 handlerPositionX = annexStartPositionX;
2931                                 SetChecked(false);
2932                         }
2933                 }
2934         }
2935         else
2936         {
2937                 SetChecked(!IsChecked());
2938                 if(IsChecked())
2939                 {
2940                         handlerPositionX = annexEndPositionX;
2941                 }
2942                 else
2943                 {
2944                         handlerPositionX = annexStartPositionX;
2945                 }
2946         }
2947
2948         DrawAnnexOnOffHandler(handlerPositionX);
2949
2950         delete pOnOffButtonHandler;
2951
2952         return;
2953 }
2954
2955 void
2956 _TableViewItem::DrawAnnexOnOffHandler(float touchEndPosition)
2957 {
2958         if (__pItemAnnex == null)
2959         {
2960                 return;
2961         }
2962
2963         Bitmap* pOnOffButton = null;
2964         Bitmap* pOnOffButtonHandler = null;
2965         Bitmap* pMergeBitmap = null;
2966         Canvas* pCanvas = null;
2967         result r = E_SUCCESS;
2968
2969         FloatRectangle backgroundBounds;
2970         FloatRectangle handlerBounds;
2971         float annexWidth = 0.0f;
2972         float annexHeight = 0.0f;
2973         float annexMargin = 0.0f;
2974         float annexX = 0.0f;
2975         float nextHandlerX = 0.0f;
2976
2977         r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton);
2978         SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButton != null), E_SYSTEM, "[E_SYSTEM] OnOffButton image load failed.");
2979
2980         if (IsChecked() == true)
2981         {
2982                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2983         }
2984         else
2985         {
2986                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
2987         }
2988         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), , E_SYSTEM, "[E_SYSTEM] OnOffHandlerButton image load failed");
2989
2990         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
2991         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
2992         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin);
2993
2994         pCanvas = new (std::nothrow) Canvas();
2995         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
2996
2997         pCanvas->Construct(FloatRectangle(0, 0, annexWidth, annexHeight));
2998         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
2999         pCanvas->Clear();
3000
3001         backgroundBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButton);
3002         DrawBitmap(*pCanvas, backgroundBounds, *pOnOffButton);
3003
3004         handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler);
3005         handlerBounds.y  = backgroundBounds.y;
3006
3007         if(IsChecked())
3008         {
3009                 handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
3010         }
3011         else
3012         {
3013                 handlerBounds.x = backgroundBounds.x + annexMargin;
3014         }
3015
3016         nextHandlerX = handlerBounds.x + (touchEndPosition - __annexTouchStartPosition);
3017         annexX = __pItemAnnex->GetBoundsF().x;
3018
3019         if((annexX + nextHandlerX + handlerBounds.width) < (annexX + annexWidth + annexMargin)
3020                 && (annexX + nextHandlerX) > annexX)
3021         {
3022                 handlerBounds.x = nextHandlerX;
3023         }
3024         else if(_FloatCompareGE((annexX + nextHandlerX + handlerBounds.width), (annexX + annexWidth + annexMargin)))
3025         {
3026                 handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
3027         }
3028         else if(_FloatCompareLE((annexX + nextHandlerX), annexX))
3029         {
3030                 handlerBounds.x = backgroundBounds.x + annexMargin;
3031         }
3032
3033         __annexOnOffHandlerPositionX = annexX + handlerBounds.x;
3034         DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler);
3035
3036         pMergeBitmap = new (std::nothrow) Bitmap();
3037         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
3038
3039         pMergeBitmap->Construct(*pCanvas, FloatRectangle(0, 0, annexWidth, annexHeight));
3040         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
3041
3042         __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
3043         __pItemAnnex->Invalidate(false);
3044
3045 CATCH:
3046         delete pOnOffButton;
3047         delete pOnOffButtonHandler;
3048         delete pMergeBitmap;
3049         delete pCanvas;
3050
3051         return;
3052 }
3053
3054 void
3055 _TableViewItem::DrawDetailButton(void)
3056 {
3057         Bitmap* pDetail = null;
3058         Bitmap* pDetailBg = null;
3059         Bitmap* pDetailBgEffect = null;
3060         Bitmap* pDetailEffect = null;
3061         Bitmap* pReplacementDetail = null;
3062         Bitmap* pReplacementDetailBg = null;
3063         Bitmap* pMergeBitmap = null;
3064         Canvas* pCanvas = null;
3065         Color replacementNewColor;
3066         Color replacementNewBgColor;
3067         result r = E_SUCCESS;
3068
3069         FloatRectangle bounds;
3070         float annexWidth = 0.0f;
3071         float annexHeight = 0.0f;
3072         bool themeBackgroundBitmap = false;
3073
3074         themeBackgroundBitmap = IS_CUSTOM_BITMAP(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL);
3075
3076         if(__enabledState)
3077         {
3078                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBg);
3079                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBg != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3080
3081                 if (__isSelectedDetailButton)
3082                 {
3083                         if (!themeBackgroundBitmap)
3084                         {
3085                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect);
3086                                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3087
3088                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_REVEAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailEffect);
3089                                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3090                         }
3091
3092                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_REVEAL_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetail);
3093                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetail != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3094
3095                         GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_PRESSED, replacementNewColor);
3096                         GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_BG_PRESSED, replacementNewBgColor);
3097                 }
3098                 else
3099                 {
3100                         if (!themeBackgroundBitmap)
3101                         {
3102                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect);
3103                                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3104
3105                                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_REVEAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailEffect);
3106                                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3107                         }
3108
3109                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_REVEAL_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDetail);
3110                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetail != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3111
3112                         GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_NORMAL, replacementNewColor);
3113                         GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_BG_NORMAL, replacementNewBgColor);
3114                 }
3115         }
3116         else
3117         {
3118
3119                 if (!themeBackgroundBitmap)
3120                 {
3121                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect);
3122                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3123
3124                         r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_REVEAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailEffect);
3125                         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3126                 }
3127
3128                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_REVEAL_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetail);
3129                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetail != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3130
3131                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBg);
3132                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBg != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3133
3134                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_NORMAL, replacementNewColor);
3135         }
3136         pReplacementDetailBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pDetailBg, Color::GetColor(COLOR_ID_MAGENTA), replacementNewBgColor);
3137         SysTryCatch(NID_UI_CTRL, pReplacementDetailBg != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3138
3139         pReplacementDetail = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pDetail, Color::GetColor(COLOR_ID_MAGENTA), replacementNewColor);
3140         SysTryCatch(NID_UI_CTRL, pReplacementDetail != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
3141
3142         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3143         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
3144
3145         bounds.SetBounds(0, 0, annexWidth, annexHeight);
3146
3147         pCanvas = new (std::nothrow) Canvas();
3148         SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
3149
3150         pCanvas->Construct(bounds);
3151         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
3152         pCanvas->Clear();
3153
3154         DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pReplacementDetailBg), *pReplacementDetailBg);
3155         if (pDetailBgEffect)
3156         {
3157                 DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pDetailBgEffect), *pDetailBgEffect);
3158         }
3159         DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pReplacementDetail), *pReplacementDetail);
3160         if(pDetailEffect)
3161         {
3162                 DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pDetailEffect), *pDetailEffect);
3163         }
3164
3165         pMergeBitmap = new (std::nothrow) Bitmap();
3166         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
3167
3168         pMergeBitmap->Construct(*pCanvas, bounds);
3169         _BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
3170
3171         __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
3172         __pItemAnnex->Invalidate(false);
3173
3174 CATCH:
3175         delete pDetail;
3176         delete pDetailBg;
3177         delete pDetailBgEffect;
3178         delete pDetailEffect;
3179         delete pReplacementDetail;
3180         delete pReplacementDetailBg;
3181         delete pMergeBitmap;
3182         delete pCanvas;
3183
3184         return;
3185 }
3186
3187 void
3188 _TableViewItem::DrawItemDivider(void)
3189 {
3190         if(__pItemDivider == null || __pItemTopDivider == null)
3191         {
3192                 return;
3193         }
3194
3195         if (__pDrawingProperty->itemDividerEnabled == false ||
3196                 __itemType == TABLE_VIEW_ITEM_TYPE_HEADER ||
3197                 __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER ||
3198                 __itemDividerEnabled == false)
3199         {
3200                 __pItemDivider->SetVisibleState(false);
3201                 __pItemTopDivider->SetVisibleState(false);
3202
3203                 return;
3204         }
3205
3206         FloatRectangle dividerBottomBounds;
3207         FloatRectangle dividerTopBounds;
3208         Color topLineColor;
3209         Color bottomLineColor;
3210         Color customDividerColor;
3211         FloatRectangle bounds;
3212         FloatPoint bottomPoint;
3213
3214         __pItemDivider->SetVisibleState(true);
3215         __pItemTopDivider->SetVisibleState(true);
3216
3217         if(     __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED ||
3218                 __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED)
3219         {
3220                 if(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] != __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED])
3221                 {
3222                         if(__itemType != TABLE_VIEW_ITEM_TYPE_TITLE)
3223                         {
3224                                 __pItemDivider->SetVisibleState(false);
3225                         }
3226
3227                         __pItemTopDivider->SetVisibleState(false);
3228                 }
3229         }
3230
3231         if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
3232         {
3233                 if(__pItemBgBitmap[__drawingStatus] != null)
3234                 {
3235                         __pItemDivider->SetVisibleState(false);
3236                 }
3237                 else
3238                 {
3239                         float lineHeight = 0.0f;
3240                         float lineLeftMargin = 0.0f;
3241                         float lineBottomMargin = 0.0f;
3242                         bounds = GetBoundsF();
3243
3244                         if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
3245                         {
3246                                 GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_NORMAL, bottomLineColor);
3247                         }
3248                         else
3249                         {
3250                                 GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_PRESSED, bottomLineColor);
3251                         }
3252
3253                         GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight);
3254                         GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin);
3255                         GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineBottomMargin);
3256
3257                         lineHeight = Tizen::Graphics::CoordinateSystem::ConvertToLogicalY(lineHeight);
3258                         lineBottomMargin = Tizen::Graphics::CoordinateSystem::ConvertToLogicalY(lineBottomMargin);
3259                         bottomPoint = Tizen::Graphics::CoordinateSystem::AlignToDevice(FloatPoint(lineLeftMargin, bounds.height));
3260                         dividerBottomBounds = FloatRectangle(bottomPoint.x, bottomPoint.y - lineBottomMargin, bounds.width - lineLeftMargin * 2.0f, lineHeight);
3261                 }
3262         }
3263         else
3264         {
3265                 float lineLeftMargin = 0.0f;
3266                 float lineHeight = 0.0f;
3267                 bounds = GetBoundsF();
3268                 int groupIndex = -1;
3269                 int itemIndex = -1;
3270
3271                 GetItemIndex(groupIndex, itemIndex);
3272
3273                 if (itemIndex < 1)
3274                 {
3275                         __pItemTopDivider->SetVisibleState(false);
3276                 }
3277
3278                 if(!IsContextItem())
3279                 {
3280                         if (!__isSimpleLastItem)
3281                         {
3282                                 if(__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM || __itemType == TABLE_VIEW_ITEM_TYPE_ONE)
3283                                 {
3284                                         __pItemDivider->SetVisibleState(false);
3285                                 }
3286                         }
3287                 }
3288
3289                 customDividerColor = __pDrawingProperty->dividerColor;
3290                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL, topLineColor);
3291                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_BOTTOM_BG_NORMAL, bottomLineColor);
3292                 GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin);
3293                 GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight);
3294
3295                 lineLeftMargin = Tizen::Graphics::CoordinateSystem::ConvertToLogicalX(lineLeftMargin);
3296                 lineHeight = Tizen::Graphics::CoordinateSystem::ConvertToLogicalY(lineHeight);
3297                 bottomPoint = Tizen::Graphics::CoordinateSystem::AlignToDevice(FloatPoint(lineLeftMargin, (bounds.height)));
3298
3299                 dividerTopBounds.SetBounds(lineLeftMargin, 0.0f, bounds.width - lineLeftMargin * 2.0f, lineHeight);
3300                 dividerBottomBounds.SetBounds(lineLeftMargin, bottomPoint.y - lineHeight, bounds.width - lineLeftMargin * 2.0f, lineHeight);
3301         }
3302
3303         if(__pItemDivider->GetVisibleState())
3304         {
3305                 __pItemDivider->SetBounds(dividerBottomBounds);
3306                 if(customDividerColor == bottomLineColor || __itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
3307                 {
3308                         __pItemDivider->SetBackgroundColor(bottomLineColor);
3309                 }
3310                 else
3311                 {
3312                         __pItemDivider->SetBackgroundColor(customDividerColor);
3313                         __pItemDivider->GetVisualElement()->SetOpacity(ITEM_BOTTOM_DIVIDER_OPACITY);
3314                 }
3315                         __pItemDivider->Invalidate();
3316         }
3317
3318         if(__pItemTopDivider->GetVisibleState())
3319         {
3320                 __pItemTopDivider->SetBounds(dividerTopBounds);
3321                 if(customDividerColor == bottomLineColor)
3322                 {
3323                         __pItemTopDivider->SetBackgroundColor(topLineColor);
3324                 }
3325                 else
3326                 {
3327                         __pItemTopDivider->SetBackgroundColor(customDividerColor);
3328                         __pItemTopDivider->GetVisualElement()->SetOpacity(ITEM_TOP_DIVIDER_OPACITY);
3329                 }
3330                 __pItemTopDivider->Invalidate();
3331         }
3332 }
3333
3334 void
3335 _TableViewItem::DrawItemAnnexDivider(void)
3336 {
3337         if (__itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER)
3338         {
3339                 if (__pItemAnnexLeftDivider != null)
3340                 {
3341                         __pItemAnnexLeftDivider->SetVisibleState(false);
3342                 }
3343
3344                 if (__pItemAnnexRightDivider != null)
3345                 {
3346                         __pItemAnnexRightDivider->SetVisibleState(false);
3347                 }
3348         }
3349         else
3350         {
3351                 Color dividerLeftColor;
3352                 Color dividerRightColor;
3353                 Color customDividerColor;
3354                 Color bottomLineColor;
3355                 FloatRectangle bounds = GetBoundsF();
3356                 float dividerHeight = 0;
3357                 float itemHeight = 0;
3358                 float dividerWidth = 0.0f;
3359                 float dividerTopMargin = 0.0f;
3360                 float annexWidth = 0.0f;
3361                 float annexLeftMargin = 0.0f;
3362                 float itemLeftMargin = 0.0f;
3363
3364                 customDividerColor = __pDrawingProperty->dividerColor;
3365                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemLeftMargin);
3366                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexLeftMargin);
3367                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3368                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_LEFT_BG_NORMAL, dividerLeftColor);
3369                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_RIGHT_BG_NORMAL, dividerRightColor);
3370                 GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_BOTTOM_BG_NORMAL, bottomLineColor);
3371                 GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, dividerWidth);
3372                 GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerTopMargin);
3373
3374                 itemLeftMargin += __pDrawingProperty->scrollMargin;
3375                 itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
3376                 dividerHeight = itemHeight - (dividerTopMargin*2);
3377                 dividerHeight = (dividerHeight > 0) ? dividerHeight : 0;
3378                 __pItemAnnexLeftDivider->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - (itemLeftMargin + annexLeftMargin) - (dividerWidth*2)), dividerTopMargin, dividerWidth, dividerHeight));
3379                 __pItemAnnexRightDivider->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - (itemLeftMargin + annexLeftMargin) - dividerWidth), dividerTopMargin, dividerWidth, dividerHeight));
3380
3381                 if (customDividerColor == bottomLineColor)
3382                 {
3383                         __pItemAnnexLeftDivider->SetBackgroundColor(dividerLeftColor);
3384                 }
3385                 else
3386                 {
3387                         __pItemAnnexLeftDivider->SetBackgroundColor(customDividerColor);
3388                         __pItemAnnexLeftDivider->GetVisualElement()->SetOpacity(ITEM_TOP_DIVIDER_OPACITY);
3389                 }
3390
3391                 if (customDividerColor == bottomLineColor)
3392                 {
3393                         __pItemAnnexRightDivider->SetBackgroundColor(dividerRightColor);
3394                 }
3395                 else
3396                 {
3397                         __pItemAnnexRightDivider->SetBackgroundColor(customDividerColor);
3398                         __pItemAnnexRightDivider->GetVisualElement()->SetOpacity(ITEM_BOTTOM_DIVIDER_OPACITY);
3399                 }
3400
3401                 __pItemAnnexLeftDivider->Invalidate();
3402                 __pItemAnnexRightDivider->Invalidate();
3403         }
3404
3405         if (__pItemAnnexLeftDivider != null)
3406         {
3407                 _AccessibilityContainer* pContainer = __pItemAnnexLeftDivider->GetAccessibilityContainer();
3408                 pContainer->Activate(false);
3409         }
3410
3411         if (__pItemAnnexRightDivider != null)
3412         {
3413                 _AccessibilityContainer* pContainer = __pItemAnnexRightDivider->GetAccessibilityContainer();
3414                 pContainer->Activate(false);
3415         }
3416 }
3417
3418
3419 result
3420 _TableViewItem::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap)
3421 {
3422         result r = E_SUCCESS;
3423         if (_BitmapImpl::CheckNinePatchedBitmapStrictly(bitmap))
3424         {
3425                 r = canvas.DrawNinePatchedBitmap(bounds, bitmap);
3426                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Fail to draw ninepatched bitmap.", GetErrorMessage(r))
3427         }
3428         else
3429         {
3430                 r = canvas.DrawBitmap(bounds, bitmap);
3431                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Fail to draw bitmap.", GetErrorMessage(r))
3432         }
3433
3434         return r;
3435 }
3436
3437 result
3438 _TableViewItem::SetItemHighlightBounds(_VisualElement& highlightVisualElement, const FloatRectangle& bounds)
3439 {
3440         return highlightVisualElement.SetBounds(bounds);
3441 }
3442
3443 FloatRectangle
3444 _TableViewItem::CalculateItemHighlightBounds(void)
3445 {
3446         FloatRectangle itemBounds = GetBoundsF();
3447         return FloatRectangle(0.0f, 0.0f, itemBounds.width, itemBounds.height);
3448 }
3449
3450 FloatRectangle
3451 _TableViewItem::CalculateAnnexBitmapBounds(float annexWidth, float annexHeight, const Bitmap& bitmap)
3452 {
3453         FloatRectangle bounds;
3454         float width = 0;
3455         float height = 0;
3456         float leftMargin = 0;
3457         float topMargin = 0;
3458
3459         if (annexWidth > bitmap.GetWidthF())
3460         {
3461                 leftMargin = (annexWidth - bitmap.GetWidthF()) / 2;
3462                 width = bitmap.GetWidthF();
3463         }
3464         else
3465         {
3466                 width = annexWidth;
3467         }
3468
3469         if(annexHeight > bitmap.GetHeightF())
3470         {
3471                 topMargin = (annexHeight - bitmap.GetHeightF()) / 2;
3472                 height = bitmap.GetHeightF();
3473         }
3474         else
3475         {
3476                 height = annexHeight;
3477         }
3478
3479         bounds.SetBounds(leftMargin, topMargin, width, height);
3480
3481         return bounds;
3482 }
3483
3484 bool
3485 _TableViewItem::IsTitleStyleItem(void) const
3486 {
3487         if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE || __itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER)
3488         {
3489                 return true;
3490         }
3491
3492         return false;
3493 }
3494
3495 bool
3496 _TableViewItem::IsValidSelectionState(void)
3497 {
3498         _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
3499         if (pParent == null)
3500         {
3501                 return true;
3502         }
3503
3504         if (pParent->GetPressedItemCount() > 0)
3505         {
3506                 return false;
3507         }
3508
3509         return true;
3510 }
3511
3512 void
3513 _TableViewItem::DrawSimpleItem(void)
3514 {
3515         if (__pSimpleItemText != null)
3516         {
3517                 Color textColor = __simpleItemTextColor[__drawingStatus];
3518                 if (!IsEnabled())
3519                 {
3520                         textColor = __simpleItemTextColor[TABLE_VIEW_SIMPLEITEM_DRAWING_STATUS_DISABLED];
3521                 }
3522
3523                 if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
3524                 {
3525                         if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
3526                         {
3527                                 textColor = __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_NORMAL];
3528                         }
3529                         else
3530                         {
3531                                 textColor = __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_PRESSED];
3532                         }
3533                 }
3534
3535                 __pSimpleItemText->SetTextColor(textColor);
3536                 __pSimpleItemText->Invalidate(false);
3537         }
3538 }
3539 result
3540 _TableViewItem::SetSimpleItemContents(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap, bool groupType)
3541 {
3542         result r = E_SUCCESS;
3543         bool textOnly = true;
3544
3545         if (pBitmap != null)
3546         {
3547                 textOnly = false;
3548         }
3549
3550         r = CreateSimpleItemContents(textOnly);
3551         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
3552
3553         FloatRectangle bitmapRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f);
3554         FloatRectangle textRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f);
3555         float leftMargin = 0.0f;
3556         float annexMargin = 0.0f;
3557         float elementWidth = 0;
3558         float elementHeight = 0;
3559         float itemHeight = GetBoundsF().height;
3560         float itemWidth = GetBoundsF().width;
3561         float annexWidth = GetAnnexWidth(__annexStyle);
3562
3563         if (groupType)
3564         {
3565                 if (__simpleItemTextSize == 0)
3566                 {
3567                         GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, __simpleItemTextSize);
3568                 }
3569                 GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
3570         }
3571         else
3572         {
3573                 if (__simpleItemTextSize == 0)
3574                 {
3575                         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_DEFAULT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, __simpleItemTextSize);
3576                 }
3577                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
3578         }
3579
3580         if (!textOnly)
3581         {
3582                 elementWidth = itemHeight * SIMPLE_ITEM_ELEMENT_BITMAP_SIZE_RATIO;
3583                 elementHeight = elementWidth;
3584
3585                 bitmapRect.x = leftMargin;
3586                 bitmapRect.y = (itemHeight - elementHeight) / 2;
3587                 bitmapRect.width = elementWidth;
3588                 bitmapRect.height = elementHeight;
3589         }
3590
3591         if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_NORMAL)
3592         {
3593                 textRect.x = bitmapRect.x + elementWidth + leftMargin;
3594                 elementWidth = itemWidth - textRect.x - leftMargin;
3595         }
3596         else
3597         {
3598                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin);
3599                 if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || __annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
3600                 {
3601                         bitmapRect.x = leftMargin + annexWidth + annexMargin;
3602                         textRect.x = bitmapRect.x + elementWidth + leftMargin;
3603                         elementWidth = itemWidth - textRect.x - leftMargin;
3604                 }
3605                 else
3606                 {
3607                         textRect.x = bitmapRect.x + elementWidth + leftMargin;
3608                         elementWidth = itemWidth - textRect.x - annexWidth - leftMargin - annexMargin;
3609                 }
3610         }
3611
3612         textRect.y = 0.0f;
3613         textRect.width = elementWidth < 0 ? 0 : elementWidth;;
3614         textRect.height = itemHeight;
3615
3616         if (__pSimpleItemBitmap != null && pBitmap != null)
3617         {
3618                 __pSimpleItemBitmap->SetBackgroundBitmap(*pBitmap);
3619                 __pSimpleItemBitmap->SetBounds(bitmapRect);
3620
3621                 _Label* pSimpleItemBitmapCore = GetLabelCore(__pSimpleItemBitmap);
3622                 if (!pSimpleItemBitmapCore->HasParent())
3623                 {
3624                         r = AttachChild(*pSimpleItemBitmapCore);
3625                         SysTryReturn(NID_UI_CTRL, __pSimpleItemBitmap != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
3626                 }
3627         }
3628
3629         if (__pSimpleItemText != null)
3630         {
3631                 __pSimpleItemText->SetTextConfig(__simpleItemTextSize, LABEL_TEXT_STYLE_NORMAL);
3632                 __pSimpleItemText->SetText(text);
3633                 __pSimpleItemText->SetBounds(textRect);
3634
3635                 _Label* pSimpleItemTextCore = GetLabelCore(__pSimpleItemText);
3636                 if (!pSimpleItemTextCore->HasParent())
3637                 {
3638                         r = AttachChild(*pSimpleItemTextCore);
3639                         SysTryReturn(NID_UI_CTRL, __pSimpleItemText != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
3640                 }
3641         }
3642
3643         return E_SUCCESS;
3644 }
3645
3646 result
3647 _TableViewItem::CreateSimpleItemContents(bool textOnly)
3648 {
3649         result r = E_SUCCESS;
3650
3651         if (__pSimpleItemText == null)
3652         {
3653                 __pSimpleItemText = new (std::nothrow) Label();
3654
3655                 r = GetLastResult();
3656                 SysTryReturn(NID_UI_CTRL, __pSimpleItemText != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
3657
3658                 __pSimpleItemText->Construct(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), L"");
3659
3660                 __pSimpleItemText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
3661                 __pSimpleItemText->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
3662                 if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
3663                 {
3664                         __pSimpleItemText->SetTextColor(__simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_NORMAL]);
3665                 }
3666                 else
3667                 {
3668                         __pSimpleItemText->SetTextColor(__simpleItemTextColor[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]);
3669                 }
3670                 __pSimpleItemText->SetBackgroundColor(Color(0, 0, 0, 0));
3671                 GetLabelCore(__pSimpleItemText)->SetFocusable(true);
3672
3673         }
3674
3675         if (!textOnly)
3676         {
3677                 if (__pSimpleItemBitmap == null)
3678                 {
3679                         __pSimpleItemBitmap = new (std::nothrow) Label();
3680
3681                         r = GetLastResult();
3682                         SysTryReturn(NID_UI_CTRL, __pSimpleItemBitmap != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
3683
3684                         __pSimpleItemBitmap->Construct(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), L"");
3685                         __pSimpleItemBitmap->SetBackgroundColor(Color(0, 0, 0, 0));
3686                         GetLabelCore(__pSimpleItemBitmap)->SetFocusable(true);
3687                 }
3688
3689         }
3690         else
3691         {
3692                 if (__pSimpleItemBitmap != null)
3693                 {
3694                         delete __pSimpleItemBitmap;
3695                         __pSimpleItemBitmap = null;
3696                 }
3697         }
3698
3699         return E_SUCCESS;
3700 }
3701
3702 result
3703 _TableViewItem::SetSimpleTextColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status)
3704 {
3705         __simpleItemTextColor[status] = color;
3706
3707         return E_SUCCESS;
3708 }
3709
3710 Tizen::Graphics::Color
3711 _TableViewItem::GetSimpleItemTextColor(TableViewItemDrawingStatus status) const
3712 {
3713         return __simpleItemTextColor[status];
3714 }
3715
3716 result
3717 _TableViewItem::SetSimpleGroupItemTextColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status)
3718 {
3719         if (status == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
3720         {
3721                 __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_NORMAL] = color;
3722         }
3723         else if (status == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED)
3724         {
3725                 __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_PRESSED] = color;
3726         }
3727
3728         return E_SUCCESS;
3729 }
3730
3731 Tizen::Graphics::Color
3732 _TableViewItem::GetSimpleGroupItemTextColor(TableViewItemDrawingStatus status) const
3733 {
3734         if (status == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED)
3735         {
3736                 return __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_PRESSED];
3737         }
3738         else
3739         {
3740                 return __simpleItemTextColor[TABLE_VIEW_GROUPITEM_DRAWING_STATUS_NORMAL];
3741         }
3742 }
3743
3744 result
3745 _TableViewItem::SetSimpleItemTextSize(int size)
3746 {
3747         if(__simpleItemTextSize == size)
3748         {
3749                 return E_SUCCESS;
3750         }
3751
3752         __simpleItemTextSize = size;
3753
3754         if (__pSimpleItemText != null)
3755         {
3756                 __pSimpleItemText->SetTextConfig(__simpleItemTextSize, LABEL_TEXT_STYLE_NORMAL);
3757         }
3758         return E_SUCCESS;
3759 }
3760
3761 int
3762 _TableViewItem::GetSimpleItemTextSize(void) const
3763 {
3764         return __simpleItemTextSize;
3765 }
3766
3767 result
3768 _TableViewItem::SetSectionHeaderFooterContents(const Tizen::Base::String& text, HorizontalAlignment alignment, bool isHeader)
3769 {
3770         if (__pHeaderFooterItemText == null)
3771         {
3772                 result r = E_SUCCESS;
3773                 float contentsHeight = 0.0f;
3774                 float positionY = 0.0f;
3775                 Color textColor;
3776
3777                 GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, textColor);
3778                 GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, contentsHeight);
3779
3780                 __pHeaderFooterItemText = new (std::nothrow) Label();
3781
3782                 r = GetLastResult();
3783                 SysTryReturn(NID_UI_CTRL, __pHeaderFooterItemText != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
3784
3785                 if (isHeader)
3786                 {
3787                         positionY = GetBoundsF().height - contentsHeight;
3788                 }
3789                 __pHeaderFooterItemText->Construct(FloatRectangle(0.0f, positionY, GetBoundsF().width, contentsHeight), text);
3790                 __pHeaderFooterItemText->SetTextHorizontalAlignment(alignment);
3791                 __pHeaderFooterItemText->SetTextColor(textColor);
3792                 __pHeaderFooterItemText->SetBackgroundColor(Color(0, 0, 0, 0));
3793
3794                 _Label* pHeaderFooterItemTextCore = GetLabelCore(__pHeaderFooterItemText);
3795                 pHeaderFooterItemTextCore->SetFocusable(false);
3796                 AttachChild(*pHeaderFooterItemTextCore);
3797         }
3798
3799         return E_SUCCESS;
3800 }
3801
3802 result
3803 _TableViewItem::SetSectionHeaderFooterAlignment(HorizontalAlignment alignment)
3804 {
3805         if (__pHeaderFooterItemText != null)
3806         {
3807                 __pHeaderFooterItemText->SetTextHorizontalAlignment(alignment);
3808                 __pHeaderFooterItemText->Invalidate(false);
3809         }
3810
3811         return E_SUCCESS;
3812 }
3813
3814 float
3815 _TableViewItem::GetAnnexWidth(TableViewAnnexStyle style)
3816 {
3817         float annexWidth = 0.0f;
3818         float annexDividerWidth = 0.0f;
3819
3820         switch (style)
3821         {
3822         case TABLE_VIEW_ANNEX_STYLE_NORMAL:
3823                 annexWidth = 0.0f;
3824                 break;
3825
3826         case TABLE_VIEW_ANNEX_STYLE_MARK:
3827                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3828                 break;
3829
3830         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
3831                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3832                 break;
3833
3834         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
3835                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexDividerWidth);
3836                 GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexDividerWidth);
3837                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3838                 annexWidth = annexWidth + (annexDividerWidth*2) + annexDividerWidth;
3839                 break;
3840
3841         case TABLE_VIEW_ANNEX_STYLE_DETAILED:
3842                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3843                 break;
3844
3845         case TABLE_VIEW_ANNEX_STYLE_RADIO:
3846                 GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
3847                 break;
3848
3849         default:
3850                 break;
3851         }
3852
3853         return annexWidth;
3854 }
3855
3856 void
3857 _TableViewItem::SetDrawingStatus(TableViewItemDrawingStatus status)
3858 {
3859         __drawingStatus = status;
3860 }
3861
3862 TableViewItemDrawingStatus
3863 _TableViewItem::GetDrawingStatus(void)
3864 {
3865         return __drawingStatus;
3866 }
3867
3868 void
3869 _TableViewItem::SetPressedControl(TableViewItemPressedControl pressedControl)
3870 {
3871         __pressedControl = pressedControl;
3872
3873         if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
3874         {
3875                 __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
3876         }
3877         else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
3878         {
3879                 if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
3880                 {
3881                         __isSelectedDetailButton = true;
3882                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
3883                 }
3884                 else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
3885                         __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
3886                 {
3887                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
3888                 }
3889                 else
3890                 {
3891                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
3892                 }
3893         }
3894         else
3895         {
3896                 if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
3897                 {
3898                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
3899                 }
3900         }
3901 }
3902
3903 TableViewItemPressedControl
3904 _TableViewItem::GetPressedControl(void)
3905 {
3906         return __pressedControl;
3907 }
3908
3909 void
3910 _TableViewItem::AdjustChildControlMargin(void)
3911 {
3912         if (__childMarginState)
3913         {
3914                 return;
3915         }
3916
3917         if (IsTitleStyleItem())
3918         {
3919                 return;
3920         }
3921
3922         __childMarginState = true;
3923
3924         float margin = 0;
3925
3926         if (__pDrawingProperty->groupedLookEnabled)
3927         {
3928                 float groupedBarMargin = 0.0f;
3929                 GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, groupedBarMargin);
3930
3931                 margin = margin + groupedBarMargin;
3932         }
3933
3934         if (margin > 0)
3935         {
3936                 _VisualElement* pVisualElement = GetVisualElement();
3937
3938                 if (pVisualElement != null)
3939                 {
3940                         FloatPoint position;
3941
3942                         position.SetPosition(margin, 0.0f);
3943                         pVisualElement->ScrollByPoint(position, false);
3944                 }
3945         }
3946 }
3947
3948 void
3949 _TableViewItem::AdjustContextItemBounds(void)
3950 {
3951         _TableViewItem* pContextItem = GetContextItem();
3952
3953         if (pContextItem == null)
3954         {
3955                 return;
3956         }
3957
3958         FloatDimension contextItemSize = pContextItem->GetSizeF();
3959         FloatDimension itemSize = GetSizeF();
3960
3961         if (!_FloatCompare(contextItemSize.height, itemSize.height))
3962         {
3963                 contextItemSize.height = itemSize.height;
3964
3965                 pContextItem->SetSize(contextItemSize);
3966         }
3967
3968         pContextItem->AdjustChildControlCenterAlign();
3969 }
3970
3971 void
3972 _TableViewItem::AdjustAnnexBounds(void)
3973 {
3974         if (__pItemAnnex == null || __isMoveItemAnimationEnabled || __isZoomInOutItemAnimationEnabled ||__isFadeInOutItemAnimationEnabled)
3975         {
3976                 return;
3977         }
3978
3979         // h align
3980         if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER || __annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
3981         {
3982                 _Label* pAnnexCore = GetLabelCore(__pItemAnnex);
3983                 if (pAnnexCore->HasParent())
3984                 {
3985                         FloatRectangle annexBounds = __pItemAnnex->GetBoundsF();
3986                         float annexPositionX = annexBounds.x;
3987                         float leftMargin = 0.0f;
3988
3989                         GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
3990                         leftMargin += __pDrawingProperty->scrollMargin;
3991
3992                         annexPositionX = GetBoundsF().width - annexBounds.width - leftMargin;
3993
3994                         if (!_FloatCompare(annexPositionX, annexBounds.x))
3995                         {
3996                                 __pItemAnnex->SetPosition(FloatPoint(annexPositionX, annexBounds.y));
3997                         }
3998                 }
3999         }
4000
4001         // v align
4002         FloatRectangle itemBounds = GetBoundsF();
4003         FloatRectangle annexBounds = __pItemAnnex->GetBoundsF();
4004
4005         if (__customHeight > 0)
4006         {
4007                 itemBounds.height = __customHeight;
4008         }
4009
4010         annexBounds.y = (itemBounds.height - annexBounds.height) / 2;
4011         __pItemAnnex->SetPosition(FloatPoint(annexBounds.x, annexBounds.y));
4012 }
4013
4014 void
4015 _TableViewItem::SetItemCustomHeight(float height)
4016 {
4017         __customHeight = height;
4018 }
4019
4020 float
4021 _TableViewItem::GetItemCustomHeight(void)
4022 {
4023         return __customHeight;
4024 }
4025
4026 void
4027 _TableViewItem::AdjustChildControlCenterAlign(void)
4028 {
4029         if (__childControlCenterAlign)
4030         {
4031                 FloatDimension itemSize = GetSizeF();
4032
4033                 int childControlCount = GetChildCount();
4034
4035                 for (int i = 0; i < childControlCount; i++)
4036                 {
4037                         _Control* pChildControl = GetChild(i);
4038
4039                         if (pChildControl == null)
4040                         {
4041                                 continue;
4042                         }
4043
4044                         if (__pItemDivider == pChildControl)
4045                         {
4046                                 float positionX = pChildControl->GetPositionF().x;
4047                                 pChildControl->SetPosition(FloatPoint(positionX, itemSize.height - 1));
4048                                 continue;
4049                         }
4050
4051                         if (__pItemTopDivider == pChildControl)
4052                         {
4053                                 float positionX = pChildControl->GetPositionF().x;
4054                                 pChildControl->SetPosition(FloatPoint(positionX, 0));
4055                                 continue;
4056                         }
4057
4058                         FloatRectangle itemBounds = pChildControl->GetBoundsF();
4059
4060                         itemBounds.y = (itemSize.height - itemBounds.height) / 2;
4061
4062                         pChildControl->SetPosition(FloatPoint(itemBounds.x, itemBounds.y));
4063                 }
4064         }
4065 }
4066
4067 void
4068 _TableViewItem::SetChildControlCenterAlign(bool centerAlign)
4069 {
4070         __childControlCenterAlign = centerAlign;
4071 }
4072
4073 Point
4074 _TableViewItem::GetLastTouchPressedPosition(void)
4075 {
4076         return _CoordinateSystemUtils::ConvertToInteger(__touchStartPosition);
4077 }
4078
4079 FloatPoint
4080 _TableViewItem::GetLastTouchPressedPositionF(void)
4081 {
4082         return __touchStartPosition;
4083 }
4084
4085 void
4086 _TableViewItem::SetLastTouchPressedPosition(FloatPoint position)
4087 {
4088         // This function was made to modify of ListView::RefreshList().
4089         // This function could adversely affect touch event handling. So, you should be used with caution.
4090         __touchStartPosition = position;
4091 }
4092
4093 void
4094 _TableViewItem::SetLastTouchPressedPosition(Point position)
4095 {
4096         // This function was made to modify of ListView::RefreshList().
4097         // This function could adversely affect touch event handling. So, you should be used with caution.
4098         __touchStartPosition = _CoordinateSystemUtils::ConvertToFloat(position);
4099 }
4100
4101 bool
4102 _TableViewItem::GetSelectionState(void)
4103 {
4104         return __itemSelected;
4105 }
4106
4107 void
4108 _TableViewItem::SetSelectionState(bool selected)
4109 {
4110         // This function was made to modify of ListView::RefreshList().
4111         // This function could adversely affect touch event handling. So, you should be used with caution.
4112         __itemSelected = selected;
4113 }
4114
4115 bool
4116 _TableViewItem::MoveItem(FloatPoint position, int duration, int delay)
4117 {
4118         _VisualElement* pVisualElement = GetVisualElement();
4119         VisualElementValueAnimation* pAnimation = null;
4120         String animationName = L"MOVE_ITEM";
4121         FloatPoint itemPosition = GetPositionF();
4122         result r = E_SUCCESS;
4123
4124         if (position == itemPosition)
4125         {
4126                 return false;
4127         }
4128
4129         if (__pMoveItemAnimation == null)
4130         {
4131                 __pMoveItemAnimation = new (std::nothrow) VisualElementValueAnimation;
4132                 SysTryCatch(NID_UI_CTRL, __pMoveItemAnimation != null, , E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient."));
4133
4134                 __pMoveItemAnimation->SetVisualElementAnimationTickEventListener(this);
4135                 r = GetLastResult();
4136                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
4137
4138                 __pMoveItemAnimation->SetVisualElementAnimationStatusEventListener(this);
4139                 r = GetLastResult();
4140                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
4141         }
4142
4143         pAnimation = __pMoveItemAnimation;
4144
4145         pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseInOut"));
4146         pAnimation->SetDuration(duration);
4147         pAnimation->SetDelay(delay);
4148         pAnimation->SetStartValue(Variant(GetPositionF()));
4149         pAnimation->SetEndValue(Variant(position));
4150
4151         if (pVisualElement->AddAnimation(animationName, *pAnimation) != E_SUCCESS)
4152         {
4153                 return false;
4154         }
4155
4156         __animationCount++;
4157
4158         return true;
4159
4160 CATCH:
4161
4162         delete __pMoveItemAnimation;
4163         __pMoveItemAnimation = null;
4164
4165         return false;
4166 }
4167
4168 bool
4169 _TableViewItem::ZoomInOutItem(bool zoomOut, int duration, int delay)
4170 {
4171         _VisualElement* pVisualElement = GetVisualElement();
4172         VisualElementValueAnimation* pAnimation = null;
4173         String animationName = L"ZOOM_IN_OUT_ITEM";
4174         FloatDimension itemSize = GetSizeF();
4175         FloatDimension startValue;
4176         FloatDimension endValue;
4177         result r = E_SUCCESS;
4178
4179         if (__pZoomInOutItemAnimation == null)
4180         {
4181                 __pZoomInOutItemAnimation = new (std::nothrow) VisualElementValueAnimation;
4182                 SysTryCatch(NID_UI_CTRL, __pZoomInOutItemAnimation != null, , E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient."));
4183
4184                 __pZoomInOutItemAnimation->SetVisualElementAnimationTickEventListener(this);
4185                 r = GetLastResult();
4186                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
4187
4188                 __pZoomInOutItemAnimation->SetVisualElementAnimationStatusEventListener(this);
4189                 r = GetLastResult();
4190                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
4191         }
4192
4193         pAnimation = __pZoomInOutItemAnimation;
4194
4195         if (zoomOut)
4196         {
4197                 startValue = itemSize;
4198                 endValue = FloatDimension(itemSize.width, itemSize.height / 2);
4199                 pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseOut"));
4200         }
4201         else
4202         {
4203                 startValue = FloatDimension(itemSize.width, itemSize.height / 2);
4204                 endValue = itemSize;
4205                 pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseIn"));
4206         }
4207
4208         pAnimation->SetDuration(duration);
4209         pAnimation->SetDelay(delay);
4210         pAnimation->SetStartValue(Variant(startValue));
4211         pAnimation->SetEndValue(Variant(endValue));
4212
4213         if (pVisualElement->AddAnimation(animationName, *pAnimation) != E_SUCCESS)
4214         {
4215                 return false;
4216         }
4217
4218         __animationCount++;
4219
4220         return true;
4221
4222 CATCH:
4223         delete __pZoomInOutItemAnimation;
4224         __pZoomInOutItemAnimation = null;
4225
4226         return false;
4227 }
4228
4229 bool
4230 _TableViewItem::FadeInOutItem(bool fadeOut, int duration, int delay)
4231 {
4232         _VisualElement* pVisualElement = GetVisualElement();
4233         VisualElementValueAnimation* pAnimation = null;
4234         String animationName = L"FADE_IN_OUT_ITEM";
4235         float startValue = 0.0f;
4236         float endValue = 1.0f;
4237         result r = E_SUCCESS;
4238
4239         if (__pFadeInOutItemtAnimation == null)
4240         {
4241                 __pFadeInOutItemtAnimation = new (std::nothrow) VisualElementValueAnimation;
4242                 SysTryCatch(NID_UI_CTRL, __pFadeInOutItemtAnimation != null, , E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient."));
4243
4244                 __pFadeInOutItemtAnimation->SetVisualElementAnimationTickEventListener(this);
4245                 r = GetLastResult();
4246                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
4247
4248                 __pFadeInOutItemtAnimation->SetVisualElementAnimationStatusEventListener(this);
4249                 r = GetLastResult();
4250                 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
4251         }
4252
4253         pAnimation = __pFadeInOutItemtAnimation;
4254
4255         if (fadeOut)
4256         {
4257                 startValue = 1.0f;
4258                 endValue = 0.0f;
4259                 pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseOut"));
4260         }
4261         else
4262         {
4263                 pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseIn"));
4264         }
4265
4266         pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseIn"));
4267         pAnimation->SetDuration(duration);
4268         pAnimation->SetDelay(delay);
4269         pAnimation->SetStartValue(Variant(startValue));
4270         pAnimation->SetEndValue(Variant(endValue));
4271
4272         if (pVisualElement->AddAnimation(animationName, *pAnimation) != E_SUCCESS)
4273         {
4274                 return false;
4275         }
4276
4277         pVisualElement->SetOpacity(startValue);
4278
4279         __animationCount++;
4280
4281         return true;
4282
4283 CATCH:
4284
4285         delete __pFadeInOutItemtAnimation;
4286         __pFadeInOutItemtAnimation = null;
4287
4288         return false;
4289 }
4290
4291 result
4292 _TableViewItem::SetIndividualSelectionEnabled(const _Control& control, bool enable)
4293 {
4294         result r = E_SUCCESS;
4295         if (enable)
4296         {
4297                 if (!__individualSelectionControls.Contains(control))
4298                 {
4299                         r =  __individualSelectionControls.Add(control);
4300                 }
4301
4302                 _AccessibilityContainer* pContainer = const_cast<_Control*>(&control)->GetAccessibilityContainer();
4303                 pContainer->Activate(true);
4304                 int controlCount = 0;
4305                 for(int i=0; i<GetChildCount(); i++)
4306                 {
4307                         _Control* pChildControl = GetChild(i);
4308                         if(pChildControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
4309                                 || pChildControl == static_cast<_Control*>(__pItemAnnexRightDivider)
4310                                 || pChildControl == static_cast<_Control*>(__pItemCover)
4311                                 || pChildControl == static_cast<_Control*>(__pItemDivider)
4312                                 || pChildControl== static_cast<_Control*>(__pItemTopDivider))
4313                         {
4314                                 continue;
4315                         }
4316
4317                         controlCount++;
4318                 }
4319
4320                 if(controlCount == 0 || __individualSelectionControls.GetCount() == controlCount)
4321                 {
4322                         GetAccessibilityContainer()->Activate(false);
4323                 }
4324                 else
4325                 {
4326                         GetAccessibilityContainer()->Activate(true);
4327                 }
4328         }
4329         else
4330         {
4331                 if (__individualSelectionControls.Contains(control))
4332                 {
4333                         r = __individualSelectionControls.Remove(control, false);
4334                 }
4335         }
4336         return r;
4337 }
4338
4339 bool
4340 _TableViewItem::IsIndividualSelectionEnabled(const _Control& control)
4341 {
4342         return __individualSelectionControls.Contains(control);
4343 }
4344
4345 int
4346 _TableViewItem::AddRef(void)
4347 {
4348         return ++__refCount;
4349 }
4350
4351 int
4352 _TableViewItem::Release(void)
4353 {
4354         --__refCount;
4355         if (__refCount <= 0)
4356         {
4357                 delete this;
4358                 return 0;
4359         }
4360
4361         return __refCount;
4362 }
4363
4364 bool
4365 _TableViewItem::IsAnimationPlaying(void)
4366 {
4367         if (__animationCount > 0)
4368         {
4369                 return true;
4370         }
4371
4372         return false;
4373 }
4374
4375 void
4376 _TableViewItem::StopAllAnimation(void)
4377 {
4378         _VisualElement* pVisualElement = GetVisualElement();
4379
4380         pVisualElement->RemoveAllAnimations();
4381 }
4382
4383 void
4384 _TableViewItem::SetItemDividerEnabled(bool enable)
4385 {
4386         __itemDividerEnabled = enable;
4387 }
4388
4389 void
4390 _TableViewItem::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, const Tizen::Ui::Variant& currentValue)
4391 {
4392         if (keyName == L"MOVE_ITEM")
4393         {
4394                 FloatPoint position = currentValue.ToFloatPoint();
4395                 SetPosition(position);
4396         }
4397         else if (keyName == L"FADE_IN_OUT_ITEM")
4398         {
4399                 float opacity = currentValue.ToFloat();
4400
4401                 _VisualElement* pVisualElement = GetVisualElement();
4402
4403                 if (pVisualElement != null)
4404                 {
4405                         pVisualElement->SetOpacity(opacity);
4406                 }
4407         }
4408         else if (keyName == L"ZOOM_IN_OUT_ITEM")
4409         {
4410                 FloatDimension size = currentValue.ToFloatDimension();
4411                 SetSize(size);
4412         }
4413 }
4414
4415 void
4416 _TableViewItem::OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target)
4417 {
4418         if (keyName == L"MOVE_ITEM")
4419         {
4420                 __isMoveItemAnimationEnabled = true;
4421         }
4422         else if (keyName == L"FADE_IN_OUT_ITEM")
4423         {
4424                 __isFadeInOutItemAnimationEnabled = true;
4425         }
4426         else if (keyName == L"ZOOM_IN_OUT_ITEM")
4427         {
4428                 __isZoomInOutItemAnimationEnabled = true;
4429         }
4430 }
4431
4432 void
4433 _TableViewItem::OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount)
4434 {
4435 }
4436
4437 void
4438 _TableViewItem::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally)
4439 {
4440         if (__isAnimationCallbackBlocked)
4441         {
4442                 return;
4443         }
4444
4445         bool tableViewItemAnimation = true;
4446         const VisualElementValueAnimation *pAnimation = dynamic_cast<const VisualElementValueAnimation*>(&(animation));
4447
4448         if (keyName == L"MOVE_ITEM")
4449         {
4450                 if (pAnimation != null)
4451                 {
4452                         FloatPoint position = pAnimation->GetEndValue().ToFloatPoint();
4453
4454                         SetPosition(position);
4455                 }
4456                 __isMoveItemAnimationEnabled = false;
4457         }
4458         else if (keyName == L"FADE_IN_OUT_ITEM")
4459         {
4460                 if (pAnimation != null)
4461                 {
4462                         float opacity = pAnimation->GetEndValue().ToFloat();
4463
4464                         _VisualElement* pVisualElement = GetVisualElement();
4465
4466                         if (pVisualElement != null)
4467                         {
4468                                 pVisualElement->SetOpacity(opacity);
4469                                 Invalidate();
4470                         }
4471                 }
4472                 __isFadeInOutItemAnimationEnabled = false;
4473         }
4474         else if (keyName == L"ZOOM_IN_OUT_ITEM")
4475         {
4476                 if (pAnimation != null)
4477                 {
4478                         FloatDimension size = pAnimation->GetEndValue().ToFloatDimension();
4479
4480                         SetSize(size);
4481                 }
4482                 __isZoomInOutItemAnimationEnabled = false;
4483         }
4484         else
4485         {
4486                 tableViewItemAnimation = false;
4487         }
4488
4489         if (tableViewItemAnimation)
4490         {
4491                 __animationCount--;
4492         }
4493
4494         return;
4495 }
4496
4497 result
4498 _TableViewItem::OnAttachedToMainTree(void)
4499 {
4500         if (!_FloatCompare(GetBoundsF().height, 0.0f))
4501         {
4502                 SetAccessibilityElement();
4503         }
4504
4505         return E_SUCCESS;
4506 }
4507
4508 void
4509 _TableViewItem::SetAccessibilityElement(void)
4510 {
4511         _AccessibilityContainer* pContainer = GetAccessibilityContainer();
4512
4513         if(pContainer != null)
4514         {
4515                 if(__pAccessibilityElement == null)
4516                 {
4517                         __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
4518                         SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
4519
4520                         __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
4521                         __pAccessibilityElement->SetName(L"TableViewItem");
4522
4523                         pContainer->AddElement(*__pAccessibilityElement);
4524                 }
4525                 __pAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
4526         }
4527 }
4528
4529 _AccessibilityElement*
4530 _TableViewItem::GetAccessibilityElement(void)
4531 {
4532         return __pAccessibilityElement;
4533 }
4534 void
4535 _TableViewItem::SetAccessibilityElementTrait(void)
4536 {
4537         if(__pAccessibilityElement == null)
4538         {
4539                 return;
4540         }
4541         int groupIndex = -1;
4542         int itemIndex = -1;
4543         
4544         switch (__annexStyle)
4545         {
4546         case TABLE_VIEW_ANNEX_STYLE_NORMAL:
4547                 GetItemIndex(groupIndex, itemIndex);
4548                 if(groupIndex != -1 && itemIndex == -1)
4549                 {
4550                         __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_GROUP_INDEX");
4551                 }
4552                 break;
4553
4554         case TABLE_VIEW_ANNEX_STYLE_MARK:
4555                 __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_TICKBOX_T_TTS");
4556                 break;
4557
4558         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
4559         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
4560                 __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_ON_OFF_BUTTON_T_TTS");
4561                 break;
4562
4563         case TABLE_VIEW_ANNEX_STYLE_DETAILED:
4564                 __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
4565                 break;
4566
4567         case TABLE_VIEW_ANNEX_STYLE_RADIO:
4568                 __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_RADIO_BUTTON_T_TTS");
4569                 break;
4570
4571         default:
4572                 break;
4573         }
4574 }
4575 void
4576 _TableViewItem::SetAccessibilityElementValue(void)
4577 {
4578         if(__pAccessibilityElement == null)
4579         {
4580                 return;
4581         }
4582         
4583         switch (__annexStyle)
4584         {
4585         case TABLE_VIEW_ANNEX_STYLE_MARK:
4586                 if (IsChecked())
4587                 {
4588                         __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_TICK_T_TTS");
4589                 }
4590                 else
4591                 {
4592                         __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_UNTICK_T_TTS");
4593                 }
4594                 break;
4595
4596         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
4597         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
4598                 if (IsChecked())
4599                 {
4600                         __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_ON");
4601                 }
4602                 else
4603                 {
4604                         __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_OFF");
4605                 }
4606                 break;
4607
4608         case TABLE_VIEW_ANNEX_STYLE_RADIO:
4609                 if (IsChecked())
4610                 {
4611                         __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_SELECTED_T_TTS");
4612                 }
4613                 else
4614                 {
4615                         __pAccessibilityElement->SetValue(L"Unselected");
4616                 }
4617                 break;
4618
4619         default:
4620                 break;
4621         }
4622 }
4623 void
4624 _TableViewItem::SetAccessibilityElementLabel(void)
4625 {
4626         if(__pAccessibilityElement == null)
4627         {
4628                 return;
4629         }
4630         if(__pAccessibilityElement->GetLabel().GetLength() > 0)
4631         {
4632                 return;
4633         }
4634         String accessibilityLabel;
4635         String space = L" ";
4636         int childControlCount = GetChildCount();
4637         int groupIndex = -1;
4638         int itemIndex = -1;
4639
4640         for (int i = 0; i < childControlCount; i++)
4641         {
4642                 _Control* pChildControl = GetChild(i);
4643
4644                 if (pChildControl == null)
4645                 {
4646                         continue;
4647                 }
4648
4649                 if (__pItemDivider == pChildControl || __pItemTopDivider == pChildControl || __pItemCover == pChildControl)
4650                 {
4651                         continue;
4652                 }
4653
4654                 if (!IsIndividualSelectionEnabled(*pChildControl))
4655                 {
4656                         _AccessibilityContainer* pContainer = pChildControl->GetAccessibilityContainer();
4657                         LinkedListT<_AccessibilityElement*> accessibilityElements;
4658                         _AccessibilityElement* pElement = null;
4659
4660                         pContainer->GetElements(accessibilityElements);
4661                         pContainer->Activate(false);
4662                         int elementCount = accessibilityElements.GetCount();
4663
4664                         for (int i = 0; i < elementCount; i++)
4665                         {
4666                                 if (accessibilityElements.GetAt(i, pElement) == E_SUCCESS)
4667                                 {
4668                                         accessibilityLabel += pElement->GetLabel();
4669                                         accessibilityLabel += space;
4670                                 }
4671                         }
4672                 }
4673         }
4674
4675         __pAccessibilityElement->SetLabel(accessibilityLabel);
4676 }
4677
4678
4679 bool
4680 _TableViewItem::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4681 {
4682         return false;
4683 }
4684
4685 bool
4686 _TableViewItem::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4687 {
4688         return false;
4689 }
4690
4691 bool
4692 _TableViewItem::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4693 {
4694         return false;
4695 }
4696
4697 bool
4698 _TableViewItem::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4699 {
4700         SetAccessibilityElementLabel();
4701         SetAccessibilityElementTrait();
4702         SetAccessibilityElementValue();
4703         return false;
4704 }
4705
4706 bool
4707 _TableViewItem::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4708 {
4709         return false;
4710 }
4711
4712 bool
4713 _TableViewItem::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4714 {
4715         return false;
4716 }
4717
4718 bool
4719 _TableViewItem::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4720 {
4721         switch (__annexStyle)
4722         {
4723         case TABLE_VIEW_ANNEX_STYLE_NORMAL:
4724                 break;
4725
4726         case TABLE_VIEW_ANNEX_STYLE_MARK:
4727                 if (IsChecked())
4728                 {
4729                         _AccessibilityManager::GetInstance()->ReadContent(L"ticked");
4730                 }
4731                 else
4732                 {
4733                         _AccessibilityManager::GetInstance()->ReadContent(L"unticked");
4734                 }
4735                 break;
4736
4737         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
4738         case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
4739                 if (IsChecked())
4740                 {
4741                         _AccessibilityManager::GetInstance()->ReadContent(L"On");
4742                 }
4743                 else
4744                 {
4745                         _AccessibilityManager::GetInstance()->ReadContent(L"Off");
4746                 }
4747                 break;
4748
4749         case TABLE_VIEW_ANNEX_STYLE_DETAILED:
4750                 break;
4751
4752         case TABLE_VIEW_ANNEX_STYLE_RADIO:
4753                 if (IsChecked())
4754                 {
4755                         _AccessibilityManager::GetInstance()->ReadContent(L"selected");
4756                 }
4757                 else
4758                 {
4759                         _AccessibilityManager::GetInstance()->ReadContent(L"unselected");
4760                 }
4761                 break;
4762
4763         default:
4764                 break;
4765         }
4766
4767         return false;
4768 }
4769
4770 bool
4771 _TableViewItem::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4772 {
4773         return false;
4774 }
4775
4776 bool
4777 _TableViewItem::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
4778 {
4779         return false;
4780 }
4781
4782 bool
4783 _TableViewItem::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
4784 {
4785         if (!IsFocusModeStateEnabled())
4786         {
4787                 return false;
4788         }
4789
4790         _KeyCode keyCode = keyInfo.GetKeyCode();
4791         IListT<_Control*>* pFocusList = GetFocusListN();
4792         SysTryReturn(NID_UI_CTRL, pFocusList != null, true, GetLastResult(), "[%s] propagating.", GetErrorMessage(GetLastResult()));
4793
4794         _Control* pChildControl = null;
4795         _Control* pFocusedControl = null;
4796         _Window* pTop = source.GetRootWindow();
4797
4798         if (pTop)
4799         {
4800                 pFocusedControl = pTop->GetCurrentFocusControl();
4801         }
4802
4803         int count  = pFocusList->GetCount();
4804
4805         if (pFocusedControl == null)
4806         {
4807                   return false;
4808         }
4809
4810         switch (keyCode)
4811         {
4812         case _KEY_LEFT:
4813                 if (IsFocused())
4814                 {
4815                         if (pChildControl == null)
4816                         {
4817                                 for (int i=count-1; i>=0; i--)
4818                                 {
4819                                         pFocusList->GetAt(i, pChildControl);
4820                                         if (pChildControl == null)
4821                                         {
4822                                                 continue;
4823                                         }
4824
4825                                         if (pChildControl->IsFocusable())
4826                                         {
4827                                                 break;
4828                                         }
4829                                         else
4830                                         {
4831                                                 pChildControl = null;
4832                                         }
4833                                 }
4834                         }
4835                 }
4836                 else
4837                 {
4838                         for(int i=count-1; i>=0; i--)
4839                         {
4840                                 pFocusList->GetAt(i, pChildControl);
4841                                 if (pChildControl == null)
4842                                 {
4843                                         continue;
4844                                 }
4845
4846                                 if (pChildControl->IsFocused())
4847                                 {
4848                                         if (i == 0)
4849                                         {
4850                                                 pChildControl = null;
4851                                                 break;
4852                                         }
4853
4854                                         for(int j=i-1; j>=0; j--)
4855                                         {
4856                                                 pFocusList->GetAt(j, pChildControl);
4857                                                 if (pChildControl == null)
4858                                                 {
4859                                                         continue;
4860                                                 }
4861
4862                                                 if (pChildControl->IsFocusable())
4863                                                 {
4864                                                         break;
4865                                                 }
4866                                                 else
4867                                                 {
4868                                                         pChildControl = null;
4869                                                 }
4870                                         }
4871                                         break;
4872                                 }
4873                         }
4874                 }
4875
4876                 if (pChildControl)
4877                 {
4878                         pChildControl->SetFocused(true);
4879                         pChildControl->DrawFocus();
4880                 }
4881                 else
4882                 {
4883                         _Control* pParentControl = pFocusedControl->GetParent();
4884                         _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pParentControl);
4885
4886                         if (pItem != null && pItem->GetEnableState() && !pItem->IsFocused())
4887                         {
4888                                 pItem->SetFocused(true);
4889                                 pItem->DrawFocus();
4890                         }
4891                 }
4892                 break;
4893
4894         case _KEY_RIGHT:
4895                 if (IsFocused())
4896                 {
4897                         if (pChildControl == null)
4898                         {
4899                                 for (int i=0; i<count; i++)
4900                                 {
4901                                         pFocusList->GetAt(i, pChildControl);
4902                                         if (pChildControl == null)
4903                                         {
4904                                                 continue;
4905                                         }
4906
4907                                         if (pChildControl->IsFocusable())
4908                                         {
4909                                                 break;
4910                                         }
4911                                         else
4912                                         {
4913                                                 pChildControl = null;
4914                                         }
4915                                 }
4916                         }
4917                 }
4918                 else
4919                 {
4920                         for(int i=0; i<count; i++)
4921                         {
4922                                 pFocusList->GetAt(i, pChildControl);
4923                                 if (pChildControl == null)
4924                                 {
4925                                         continue;
4926                                 }
4927
4928                                 if (pChildControl->IsFocused())
4929                                 {
4930                                         if (i == count -1)
4931                                         {
4932                                                 pChildControl = null;
4933                                                 break;
4934                                         }
4935
4936                                         for (int j=i+1; j<count; j++)
4937                                         {
4938                                                 pFocusList->GetAt(j, pChildControl);
4939                                                 if (pChildControl == null)
4940                                                 {
4941                                                         continue;
4942                                                 }
4943
4944                                                 if (pChildControl->IsFocusable())
4945                                                 {
4946                                                         break;
4947                                                 }
4948                                                 else
4949                                                 {
4950                                                         pChildControl = null;
4951                                                 }
4952                                         }
4953                                         break;
4954                                 }
4955                         }
4956                 }
4957
4958                 if (pChildControl)
4959                 {
4960                         pChildControl->SetFocused(true);
4961                         pChildControl->DrawFocus();
4962                 }
4963                 else
4964                 {
4965                         _Control* pParentControl = pFocusedControl->GetParent();
4966                         _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pParentControl);
4967
4968                         if (pItem != null && pItem->GetEnableState() && !pItem->IsFocused())
4969                         {
4970                                 pItem->SetFocused(true);
4971                                 pItem->DrawFocus();
4972                         }
4973                 }
4974                 break;
4975
4976         case _KEY_ENTER:
4977                 if (&source == this)
4978                 {
4979                         __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
4980                 }
4981                 else if (&source == GetLabelCore(__pItemAnnex))
4982                 {
4983                         __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
4984                 }
4985                 else if (IsIndividualSelectionEnabled(source))
4986                 {
4987                         __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
4988                 }
4989                 else
4990                 {
4991                         __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
4992                 }
4993                 __itemSelected = true;
4994                 FireItemTouchPressed();
4995                 break;
4996
4997         default:
4998                 if (__itemSelected)
4999                 {
5000                         __annexOnOffHandlerMoved = false;
5001                         __itemTouchMoved = false;
5002
5003                         __itemSelected = false;
5004                         __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
5005
5006                         if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
5007                         {
5008                                 __isSelectedDetailButton = false;
5009                         }
5010
5011                         SetItemChanged(true);
5012                         Invalidate();
5013                 }
5014                 return false;
5015         }
5016
5017         return true;
5018 }
5019
5020 bool
5021 _TableViewItem::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
5022 {
5023         if (!IsFocusModeStateEnabled())
5024         {
5025                 return false;
5026         }
5027
5028         _KeyCode keyCode = keyInfo.GetKeyCode();
5029
5030         if(keyCode == _KEY_ENTER)
5031         {
5032                 _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
5033                 SysTryReturn(NID_UI_CTRL, pParent != null, true, GetLastResult(), "[%s] propagating.", GetErrorMessage(GetLastResult()));
5034
5035                 pParent->StopExpandCollapseAnimation();
5036                 if (&source == this)
5037                 {
5038                         __releasedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
5039                 }
5040                 else if (&source == GetLabelCore(__pItemAnnex))
5041                 {
5042                         __releasedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
5043                 }
5044                 else if (IsIndividualSelectionEnabled(source))
5045                 {
5046                         __releasedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
5047                 }
5048                 else
5049                 {
5050                         __releasedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
5051                 }
5052                 FireItemTouchReleased();
5053                 return true;
5054         }
5055         else if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
5056         {
5057                 return true;
5058         }
5059
5060         return false;
5061 }
5062
5063 _Control*
5064 _TableViewItem::GetPreviousFocusChildControl(const _Control& source)
5065 {
5066          _Control* pParentControl = null;
5067          float sourcePosition = 0.0f;
5068
5069          _Control* pSource = const_cast<_Control*>(&source);
5070          _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pSource);
5071          if (pItem != null)
5072          {
5073                  pParentControl = pSource;
5074                  sourcePosition = pParentControl->GetBoundsF().width;
5075          }
5076          else
5077          {
5078                  pParentControl = source.GetParent();
5079                  sourcePosition = source.GetBoundsF().x;
5080          }
5081
5082          if (pParentControl == null)
5083          {
5084                  return null;
5085          }
5086
5087          int childControlCount = pParentControl->GetChildCount();
5088          float position = 0.0f;
5089          _Control* destination = null;
5090
5091          for(int i=0; i<childControlCount; i++)
5092          {
5093                  _Control* pChildControl = pParentControl->GetChild(i);
5094                  if (pChildControl != null && pChildControl->IsFocusable())
5095                  {
5096                          float childPosition = pChildControl->GetBoundsF().x;
5097                          if (childPosition < sourcePosition)
5098                          {
5099                                  if (childPosition > position)
5100                                  {
5101                                          position = childPosition;
5102                                          destination = pChildControl;
5103                                  }
5104                                  else if (_FloatCompare(position, 0.0f))
5105                                  {
5106                                          position = childPosition;
5107                                          destination = pChildControl;
5108                                  }
5109                          }
5110                  }
5111          }
5112          return destination;
5113 }
5114
5115 _Control*
5116 _TableViewItem::GetNextFocusChildControl(const _Control& source)
5117 {
5118          _Control* pParentControl = null;
5119          float sourcePosition = 0.0f;
5120
5121          _Control* pSource = const_cast<_Control*>(&source);
5122          _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pSource);
5123          if (pItem != null)
5124          {
5125                  pParentControl = pSource;
5126                  sourcePosition = 0.0f;
5127          }
5128          else
5129          {
5130                  pParentControl = source.GetParent();
5131                  sourcePosition = source.GetBoundsF().x;
5132          }
5133
5134          if (pParentControl == null)
5135          {
5136                  return null;
5137          }
5138
5139          int childControlCount = pParentControl->GetChildCount();
5140          float position = 0.0f;
5141          _Control* destination = null;
5142
5143          for(int i=0; i<childControlCount; i++)
5144          {
5145                  _Control* pChildControl = pParentControl->GetChild(i);
5146                  if (pChildControl != null && pChildControl->IsFocusable())
5147                  {
5148                          float childPosition = pChildControl->GetBoundsF().x;
5149                          if (childPosition > sourcePosition)
5150                          {
5151                                  if (childPosition < position)
5152                                  {
5153                                          position = childPosition;
5154                                          destination = pChildControl;
5155                                  }
5156                                  else if (_FloatCompare(position, 0.0f))
5157                                  {
5158                                          position = childPosition;
5159                                          destination = pChildControl;
5160                                  }
5161                          }
5162                  }
5163          }
5164          return destination;
5165 }
5166
5167 bool
5168 _TableViewItem::IsChildControlFocusManage(void) const
5169 {
5170         return true;
5171 }
5172
5173 void
5174 _TableViewItem::SetSimpleLastItemEnabled(bool enable)
5175 {
5176         __isSimpleLastItem = enable;
5177 }
5178
5179 void
5180 _TableViewItem::SetTouchPressOnScroll(bool isTouch)
5181 {
5182         __isTouchPressOnScroll = isTouch;
5183 }
5184
5185 bool
5186 _TableViewItem::IsTouchPressOnScroll(void) const
5187 {
5188         return __isTouchPressOnScroll;
5189 }
5190
5191 }}} // Tizen::Ui::Controls
5192