92344fedbbebbe49401f7edde00d0e59980e52de
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_ListViewItem.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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_ListViewItem.cpp
20  * @brief   This is the implementation file for _ListViewItem class.
21  *
22  * This file contains the implementation of _ListViewItem class.
23  */
24
25 #include <FBaseSysLog.h>
26 #include <FGrp_BitmapImpl.h>
27 #include <FGrp_EnrichedTextImpl.h>
28 #include <FGrp_TextElementImpl.h>
29 #include <FGrp_TextTextCutLink.h>
30 #include <FGrp_TextTextCutLinkParser.h>
31 #include <FGrp_TextTextSimple.h>
32 #include "FUi_AccessibilityContainer.h"
33 #include "FUi_AccessibilityElement.h"
34 #include "FUi_AccessibilityManager.h"
35 #include "FUi_CoordinateSystemUtils.h"
36 #include "FUi_Math.h"
37 #include "FUi_ResourceManager.h"
38 #include "FUiAnim_VisualElement.h"
39 #include "FUiCtrl_Label.h"
40 #include "FUiCtrl_ListViewContextItem.h"
41 #include "FUiCtrl_ListViewItem.h"
42 #include "FUiCtrl_Progress.h"
43 #include "FUiCtrl_UiListViewItemEvent.h"
44 #include "FUiCtrl_UiListViewItemEventArg.h"
45
46 #ifdef MEMORY_LEAK_CHECK
47 #include "mem_leak_check.h"
48 #endif
49
50 using namespace Tizen::Base;
51 using namespace Tizen::Base::Runtime;
52 using namespace Tizen::Base::Utility;
53 using namespace Tizen::Graphics;
54 using namespace Tizen::Graphics::_Text;
55 using namespace Tizen::Ui;
56 using namespace Tizen::Ui::Animations;
57
58 namespace Tizen { namespace Ui { namespace Controls
59 {
60
61 _ListViewItem::_ListViewItem(float itemHeight)
62         : _TableViewItem(itemHeight)
63         , __needAlignContextItem(false)
64         , __touchPressed(false)
65         , __selectedElementId(-1)
66         , __progressLeftMargin(0.0f)
67         , __progressRightMargin(0.0f)
68         , __pProgress(null)
69         , __descriptionTextShowState(false)
70         , __pDescriptionText(null)
71         , __pDivider(null)
72         , __selectionEabled(false)
73         , __fontStyle(0)
74         , __fontSize(0.0f)
75         , __fontName(L"")
76         , __prevTouchPos(-1.0f, -1.0f)
77         , __pTextSlideTimer(null)
78         , __pAccessibilityElement(null)
79 {
80         GET_COLOR_CONFIG(TABLEVIEW::ITEM_DESCRIPTION_TEXT_NORMAL, __descriptionTextColor);
81
82         ___stateChangedInfo.selectionType = LISTVIEW_ITEM_SELECTED;
83         ___stateChangedInfo.elementId = -1;
84         ___stateChangedInfo.pUiLinkInfo = null;
85 }
86
87 _ListViewItem::~_ListViewItem(void)
88 {
89         DeleteAllElement();
90
91         delete ___stateChangedInfo.pUiLinkInfo;
92         ___stateChangedInfo.pUiLinkInfo = null;
93
94         delete __pTextSlideTimer;
95         __pTextSlideTimer = null;
96
97         if (__pProgress != null)
98         {
99                 DetachChild(*__pProgress);
100
101                 delete __pProgress;
102                 __pProgress = null;
103         }
104
105         if (__pDescriptionText != null)
106         {
107                 DetachChild(*__pDescriptionText);
108
109                 delete __pDescriptionText;
110                 __pDescriptionText = null;
111         }
112
113         if (__pDivider != null)
114         {
115                 DetachChild(*__pDivider);
116
117                 delete __pDivider;
118                 __pDivider = null;
119         }
120
121         _AccessibilityContainer* pContainer = GetAccessibilityContainer();
122
123         if ((__pAccessibilityElement != null) && (pContainer != null))
124         {
125                 pContainer->RemoveAllElement();
126                 __pAccessibilityElement = null;
127         }
128 }
129
130 _ListViewItem*
131 _ListViewItem::CreateListViewItemN(float itemHeight)
132 {
133         _ListViewItem* pItem = new (std::nothrow) _ListViewItem(itemHeight);
134         SysTryReturn(NID_UI_CTRL, (pItem != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
135
136         pItem->AcquireHandle();
137
138         result r = pItem->Initialize();
139         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r = E_SYSTEM, "[E_SYSTEM] Unable to create _ListViewItem");
140
141         return pItem;
142
143 CATCH:
144         delete pItem;
145
146         return null;
147 }
148
149 void
150 _ListViewItem::SetListViewItemType(ListViewItemType type)
151 {
152         __itemType = type;
153 }
154
155 result
156 _ListViewItem::AddElement(FloatRectangle& rect, int elementId, const String& text, bool textSliding)
157 {
158         result r = E_SUCCESS;
159
160         SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG,
161                         ("[E_INVALID_ARG] This elementId already exists."));
162
163         // Convert String to TextObject
164         TextObject* pText = new (std::nothrow) TextObject();
165         pText->Construct();
166
167         if (text.IsEmpty() == false)
168         {
169                 TextSimple* pSimpleText = new (std::nothrow) TextSimple(const_cast <wchar_t*>(text.GetPointer()), text.GetLength());
170                 pText->AppendElement(*pSimpleText);
171
172                 pText->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_MIDDLE);
173                 pText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
174         }
175
176         // Make element object
177         _ListViewItemElement element;
178         memset(&element, 0, sizeof(_ListViewItemElement));
179
180         element.elementId = elementId;
181         element.elementType = LISTVIEW_ITEM_ELEMENT_TEXT;
182         element.bounds = rect;
183
184         element.pTextElement = new (std::nothrow) _ListViewItemElementText();
185         SysTryReturn(NID_UI_CTRL, (element.pTextElement != null), (r = GetLastResult()), r, "[%s] Propagating.", GetErrorMessage(r));
186
187         element.pTextElement->pTextObject = pText;
188         element.pTextElement->textSlidingEnabled = textSliding;
189
190         GET_SHAPE_CONFIG(LISTVIEW::ITEM_DEFAULT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, element.pTextElement->textSize);
191         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]);
192         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]);
193         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_HIGHLIGHTED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_HIGHLIGHTED]);
194
195         // Set Visual element for this element
196         _VisualElement* pVE = new (std::nothrow) _VisualElement();
197         pVE->Construct();
198         pVE->SetImplicitAnimationEnabled(false);
199         pVE->SetContentProvider(&__hitTestVEDelegator);
200         element.pTextElement->pVE = pVE;
201
202         __elements.push_back(element);
203
204         return r;
205 }
206
207 result
208 _ListViewItem::AddElement(FloatRectangle& rect, int elementId, const EnrichedText* pEnrichedText, bool textSliding)
209 {
210         SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG,
211                         ("[E_INVALID_ARG] This elementId already exists."));
212
213         SysTryReturn(NID_GRP, (pEnrichedText != null) && (_EnrichedTextImpl::GetInstance(*pEnrichedText) != null),
214                         E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This _EnrichedText element is null.");
215
216         // Set Text element
217         _EnrichedTextImpl* pCloneText = _EnrichedTextImpl::GetInstance(*pEnrichedText)->GetCloneN();
218         SysTryReturn(NID_GRP, (pCloneText != null), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This _EnrichedText element can not clone.");
219
220         TextObject* pText = pCloneText->GetTextObject();
221
222         // Make element object
223         _ListViewItemElement element;
224         memset(&element, 0, sizeof(_ListViewItemElement));
225
226         element.elementId = elementId;
227         element.elementType = LISTVIEW_ITEM_ELEMENT_TEXT;
228         element.bounds = rect;
229
230         element.pTextElement = new (std::nothrow) _ListViewItemElementText();
231         SysTryReturn(NID_UI_CTRL, (element.pTextElement != null), GetLastResult(), GetLastResult(), "[%s] Propagating.",
232                         GetErrorMessage(GetLastResult()));
233
234         element.pTextElement->pTextObject = pText;
235         element.pTextElement->pEnrichedText = pCloneText;
236         element.pTextElement->textSlidingEnabled = textSliding;
237
238         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]);
239         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]);
240         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_HIGHLIGHTED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_HIGHLIGHTED]);
241
242         // Set Visual element for this element
243         _VisualElement* pVE = new (std::nothrow) _VisualElement();
244         pVE->Construct();
245         pVE->SetImplicitAnimationEnabled(false);
246         pVE->SetContentProvider(&__hitTestVEDelegator);
247         element.pTextElement->pVE = pVE;
248
249         __elements.push_back(element);
250
251         return E_SUCCESS;
252 }
253
254 result
255 _ListViewItem::AddElement(FloatRectangle& rect, int elementId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
256 {
257         SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG,
258                         ("[E_INVALID_ARG] This elementId already exists."));
259
260         SysTryReturn(NID_GRP, (pNormalBitmap != null), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This Bitmap element is null.");
261
262         _ListViewItemElement element;
263         _VisualElement* pVE = null;
264         Bitmap* pClonePressedBitmap = null;
265         Bitmap* pCloneHighlightedBitmap = null;
266         result r = E_SUCCESS;
267
268         Bitmap* pCloneNormalBitmap = _BitmapImpl::CloneN(*pNormalBitmap);
269         SysTryReturn(NID_UI_CTRL, (pCloneNormalBitmap != null), (r = GetLastResult()), r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
270
271         if (pPressedBitmap != null)
272         {
273                 pClonePressedBitmap = _BitmapImpl::CloneN(*pPressedBitmap);
274                 SysTryCatch(NID_UI_CTRL, (pClonePressedBitmap != null), (r = GetLastResult()), r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
275         }
276
277         if (pHighlightedBitmap != null)
278         {
279                 pCloneHighlightedBitmap = _BitmapImpl::CloneN(*pHighlightedBitmap);
280                 SysTryCatch(NID_UI_CTRL, (pCloneHighlightedBitmap != null), (r = GetLastResult()), r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
281         }
282
283         // Make element object
284         memset(&element, 0, sizeof(_ListViewItemElement));
285
286         element.elementId = elementId;
287         element.elementType = LISTVIEW_ITEM_ELEMENT_BITMAP;
288         element.bounds = rect;
289
290         element.pBitmapElement = new (std::nothrow) _ListViewItemElementBitmap();
291         SysTryCatch(NID_UI_CTRL, (element.pBitmapElement != null), (r = GetLastResult()), r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
292
293         element.pBitmapElement->pBitmap[LISTVIEW_ITEM_STATUS_NORMAL] = pCloneNormalBitmap;
294         element.pBitmapElement->pBitmap[LISTVIEW_ITEM_STATUS_PRESSED] = pClonePressedBitmap;
295         element.pBitmapElement->pBitmap[LISTVIEW_ITEM_STATUS_HIGHLIGHTED] = pCloneHighlightedBitmap;
296
297         pVE = new (std::nothrow) _VisualElement();
298         pVE->Construct();
299         pVE->SetImplicitAnimationEnabled(false);
300         pVE->SetContentProvider(&__hitTestVEDelegator);
301         element.pBitmapElement->pVE = pVE;
302
303         __elements.push_back(element);
304
305         return E_SUCCESS;
306
307 CATCH:
308         delete pCloneNormalBitmap;
309         delete pClonePressedBitmap;
310         delete pCloneHighlightedBitmap;
311
312         return r;
313 }
314
315 result
316 _ListViewItem::AddElement(FloatRectangle& rect, int elementId, const _ICustomElement* pCustom)
317 {
318         SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG,
319                         ("[E_INVALID_ARG] This elementId already exists."));
320
321         SysTryReturn(NID_GRP, (pCustom != null), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This Custom element is null.");
322
323         // Make element object
324         _ListViewItemElement element;
325         memset(&element, 0, sizeof(_ListViewItemElement));
326
327         element.elementId = elementId;
328         element.elementType = LISTVIEW_ITEM_ELEMENT_OBJ;
329         element.bounds = rect;
330
331         element.pCustomElement = new (std::nothrow) _ListViewItemElementCustom();
332         SysTryReturn(NID_UI_CTRL, (element.pCustomElement != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
333
334         element.pCustomElement->pCustom = const_cast<_ICustomElement*>(pCustom);
335
336         _VisualElement* pVE = new (std::nothrow) _VisualElement();
337         pVE->Construct();
338         pVE->SetImplicitAnimationEnabled(false);
339         pVE->SetContentProvider(&__hitTestVEDelegator);
340         element.pCustomElement->pVE = pVE;
341
342         if (pVE->GetParent() == null)
343         {
344                 GetVisualElement()->AttachChild(*(pVE));
345                 pVE->SetShowState(true);
346                 pVE->SetBounds(rect);
347         }
348
349         __elements.push_back(element);
350
351         return E_SUCCESS;
352 }
353
354 bool
355 _ListViewItem::DeleteElement(int elementId)
356 {
357         _LinkedList <_ListViewItemElement>::_Iterator iter;
358
359         for (iter = __elements.begin(); iter != __elements.end(); iter++)
360         {
361                 if (iter->elementId == elementId)
362                 {
363                         DeleteElement(&(*iter));
364                         __elements.erase(iter);
365
366                         return true;
367                 }
368         }
369
370         return false;
371 }
372
373 void
374 _ListViewItem::DeleteAllElement(void)
375 {
376         _LinkedList <_ListViewItemElement>::_Iterator iter;
377
378         for (iter = __elements.begin(); iter != __elements.end(); iter++)
379         {
380                 DeleteElement(&(*iter));
381         }
382
383         __elements.clear();
384 }
385
386 void
387 _ListViewItem::DeleteElement(_ListViewItemElement* pElement)
388 {
389         if (pElement->pTextElement != null)
390         {
391                 if (pElement->pTextElement->pEnrichedText != null)
392                 {
393                         (pElement->pTextElement->pEnrichedText)->RemoveAllTextElements(true);
394
395                         delete pElement->pTextElement->pEnrichedText;
396                         pElement->pTextElement->pEnrichedText = null;
397
398                         pElement->pTextElement->pTextObject = null;
399                 }
400                 else
401                 {
402                         delete pElement->pTextElement->pTextObject;
403                         pElement->pTextElement->pTextObject = null;
404                 }
405
406                 if (pElement->pTextElement->pVE != null)
407                 {
408                         pElement->pTextElement->pVE->Destroy();
409                         pElement->pTextElement->pVE = null;
410                 }
411
412                 delete pElement->pTextElement;
413                 pElement->pTextElement = null;
414         }
415
416         if (pElement->pBitmapElement != null)
417         {
418                 for (int i = 0; i < LISTVIEW_ITEM_STATUS_MAX; i++)
419                 {
420                         delete pElement->pBitmapElement->pBitmap[i];
421                         pElement->pBitmapElement->pBitmap[i] = null;
422                 }
423
424                 if (pElement->pBitmapElement->pVE != null)
425                 {
426                         pElement->pBitmapElement->pVE->Destroy();
427                         pElement->pBitmapElement->pVE = null;
428                 }
429
430                 delete pElement->pBitmapElement;
431                 pElement->pBitmapElement = null;
432         }
433
434         if (pElement->pCustomElement)
435         {
436                 delete pElement->pCustomElement->pCustom;
437                 pElement->pCustomElement->pCustom = null;
438
439                 if (pElement->pCustomElement->pVE != null)
440                 {
441                         pElement->pCustomElement->pVE->Destroy();
442                         pElement->pCustomElement->pVE = null;
443                 }
444
445                 delete pElement->pCustomElement;
446                 pElement->pCustomElement = null;
447         }
448 }
449
450 bool
451 _ListViewItem::HasElement(int elementId)
452 {
453         _ListViewItemElement* pElement = GetElement(elementId);
454
455         return (pElement != null);
456 }
457
458 bool
459 _ListViewItem::RefreshElement(int elementId)
460 {
461         _ListViewItemElement* pElement = GetElement(elementId);
462
463         if (pElement != null)
464         {
465                 DrawElement(pElement);
466         }
467
468         return (pElement != null);
469 }
470
471 void
472 _ListViewItem::SetLastStateChangedInfo(void)
473 {
474         ClearLastStateChangedInfo();
475
476         int elementId = GetElementIdFromCurrentTouchPosition();
477         _ListViewItemElement* pElement = GetElement(elementId);
478
479         if ((pElement != null) && (__itemType == LISTVIEW_ITEM_TYPE_CUSTOM))
480         {
481                 _ListViewItemUiLinkInfo* pInfo = null;
482                 int cutlinkTextTouchedIndex = -1;
483
484                 if (IsCutlinkTextSelected(__prevTouchPos, &cutlinkTextTouchedIndex, &pInfo))
485                 {
486                         if ((GetItemStyle() == TABLE_VIEW_ANNEX_STYLE_DETAILED)
487                                         && (pElement->actionElement == true) && (pElement->selectionEnabled == false))
488                         {
489                                 elementId = -1;
490                         }
491
492                         if (cutlinkTextTouchedIndex >= 0)
493                         {
494                                 ___stateChangedInfo.selectionType = LISTVIEW_ITEM_UILINK_SELECTED;
495                                 ___stateChangedInfo.elementId = elementId;
496                                 ___stateChangedInfo.pUiLinkInfo = pInfo;
497                         }
498                         else
499                         {
500                                 ___stateChangedInfo.selectionType = LISTVIEW_ITEM_ELEMENT_SELECTED;
501                                 ___stateChangedInfo.elementId = elementId;
502                         }
503                 }
504                 else
505                 {
506                         if ((GetItemStyle() == TABLE_VIEW_ANNEX_STYLE_DETAILED)
507                                         && (pElement->actionElement == true) && (pElement->selectionEnabled == false))
508                         {
509                                 elementId = -1;
510                         }
511
512                         ___stateChangedInfo.selectionType = LISTVIEW_ITEM_ELEMENT_SELECTED;
513                         ___stateChangedInfo.elementId = elementId;
514                 }
515         }
516         else
517         {
518                 ___stateChangedInfo.selectionType = LISTVIEW_ITEM_ELEMENT_SELECTED;
519                 ___stateChangedInfo.elementId = -1;
520         }
521 }
522
523 bool
524 _ListViewItem::GetLastStateChangedInfo(_ListViewItemStateChangedInfo& changedInfo) const
525 {
526         changedInfo = ___stateChangedInfo;
527
528         return (___stateChangedInfo.selectionType != LISTVIEW_ITEM_SELECTED);
529 }
530
531 void
532 _ListViewItem::ClearLastStateChangedInfo(void)
533 {
534         delete ___stateChangedInfo.pUiLinkInfo;
535
536         ___stateChangedInfo.selectionType = LISTVIEW_ITEM_SELECTED;
537         ___stateChangedInfo.elementId = -1;
538         ___stateChangedInfo.pUiLinkInfo = null;
539 }
540
541 int
542 _ListViewItem::GetElementIdFromPosition(const FloatPoint& position) const
543 {
544         _LinkedList <_ListViewItemElement>::_ReverseIterator reverseIter;
545
546         for (reverseIter = __elements.rbegin(); reverseIter != __elements.rend(); reverseIter++)
547         {
548                 if ((*reverseIter).bounds.Contains(position))
549                 {
550                         return (*reverseIter).elementId;
551                 }
552         }
553
554         return -1;
555 }
556
557 int
558 _ListViewItem::GetElementIdFromCurrentTouchPosition(void) const
559 {
560         return GetElementIdFromPosition(__prevTouchPos);
561 }
562
563 _ListViewItemElement*
564 _ListViewItem::GetElement(int elementId) const
565 {
566         _LinkedList <_ListViewItemElement>::_Iterator iter;
567
568         for (iter = __elements.begin(); iter != __elements.end(); iter++)
569         {
570                 if (iter->elementId == elementId)
571                 {
572                         return &(*iter);
573                 }
574         }
575
576         return null;
577 }
578
579 ListViewItemElementType
580 _ListViewItem::GetElementType(int elementId) const
581 {
582         _ListViewItemElement* pElement = GetElement(elementId);
583
584         return ((pElement != null) ? pElement->elementType : LISTVIEW_ITEM_ELEMENT_INVALID);
585 }
586
587 TextObject*
588 _ListViewItem::GetTextObjectInElement(int elementId) const
589 {
590         _ListViewItemElementText* pElement = GetElementText(elementId);
591
592         return ((pElement != null) ? pElement->pTextObject : null);
593 }
594
595 _ListViewItemElementText*
596 _ListViewItem::GetElementText(int elementId) const
597 {
598         _ListViewItemElement* pElement = GetElement(elementId);
599
600         if ((pElement != null) && (pElement->elementType == LISTVIEW_ITEM_ELEMENT_TEXT)
601                         &&  (pElement->pTextElement->pTextObject != null))
602         {
603                 return pElement->pTextElement;
604         }
605
606         return null;
607 }
608
609 _ListViewItemElementBitmap*
610 _ListViewItem::GetElementBitmap(int elementId) const
611 {
612         _ListViewItemElement* pElement = GetElement(elementId);
613
614         if ((pElement != null) && (pElement->elementType == LISTVIEW_ITEM_ELEMENT_BITMAP))
615         {
616                 return pElement->pBitmapElement;
617         }
618
619         return null;
620 }
621
622 bool
623 _ListViewItem::SetElementSelectionEnabled(int elementId, bool enable)
624 {
625         _ListViewItemElement* pElement = GetElement(elementId);
626
627         if (pElement == null)
628         {
629                 return false;
630         }
631
632         pElement->actionElement = true;
633         pElement->selectionEnabled = enable;
634
635         return true;
636 }
637
638 bool
639 _ListViewItem::GetElementSelectionEnabled(int elementId, bool& enable)
640 {
641         _ListViewItemElement* pElement = GetElement(elementId);
642
643         if ((pElement == null) || (pElement->actionElement == false))
644         {
645                 return false;
646         }
647
648         enable = pElement->selectionEnabled;
649
650         return true;
651 }
652
653 bool
654 _ListViewItem::SetTextCutlinkMask(int elementId, unsigned long mask)
655 {
656         _ListViewItemElementText* pElement = GetElementText(elementId);
657
658         if (pElement == null)
659         {
660                 return false;
661         }
662
663         pElement->cutlinkMaskType = mask;
664
665         return true;
666 }
667
668 bool
669 _ListViewItem::SetTextCutlinkViewMode(int elementId, bool cutlinkViewMode, bool cutlinkParseEnable)
670 {
671         _ListViewItemElementText* pElement = GetElementText(elementId);
672
673         if (pElement == null)
674         {
675                 return false;
676         }
677
678         pElement->cutlinkViewModeEnabled = cutlinkViewMode;
679         pElement->cutlinkParseEnabled = cutlinkParseEnable;
680         pElement->cutlinkMaskType = LINK_TYPE_MAX;
681
682         return true;
683 }
684
685 bool
686 _ListViewItem::SetTextAlignment(int elementId, TextObjectAlignment textAlignment)
687 {
688         TextObject* pTextObject = GetTextObjectInElement(elementId);
689
690         if (pTextObject == null)
691         {
692                 return false;
693         }
694
695         TextObjectAlignment originAlign = pTextObject->GetAlignment();
696
697         // reset original alignment
698         if ((0x0007 & textAlignment) != 0x0000)                 // TextHorizontalAlignment
699         {
700                 originAlign &= 0x0700;
701         }
702         else if ((0x0700 & textAlignment) != 0x0000)    // TextVerticalAlignment
703         {
704                 originAlign &= 0x0007;
705         }
706
707         pTextObject->SetAlignment(originAlign | textAlignment);
708
709         return true;
710 }
711
712 bool
713 _ListViewItem::GetTextAlignment(int elementId, TextObjectAlignment& textAlignment) const
714 {
715         TextObject* pTextObject = GetTextObjectInElement(elementId);
716
717         if (pTextObject == null)
718         {
719                 return false;
720         }
721
722         textAlignment = pTextObject->GetAlignment();
723
724         return true;
725 }
726
727 bool
728 _ListViewItem::SetTextWrapType(int elementId, TextObjectWrapType wrapType)
729 {
730         TextObject* pTextObject = GetTextObjectInElement(elementId);
731
732         if (pTextObject == null)
733         {
734                 return false;
735         }
736
737         pTextObject->SetWrap(wrapType);
738
739         return true;
740 }
741
742 bool
743 _ListViewItem::SetTextSize(int elementId, float textSize)
744 {
745         _ListViewItemElementText* pElement = GetElementText(elementId);
746
747         if ((pElement != null) && (textSize > 0.0f))
748         {
749                 pElement->textSize = textSize;
750
751                 return true;
752         }
753
754         return false;
755 }
756
757 bool
758 _ListViewItem::SetTextColor(int elementId, Color textColor, ListViewItemDrawingStatus status)
759 {
760         _ListViewItemElementText* pElement = GetElementText(elementId);
761
762         if (pElement == null)
763         {
764                 return false;
765         }
766
767         pElement->textColor[status] = textColor;
768
769         return true;
770 }
771
772 bool
773 _ListViewItem::GetTextColor(int elementId, Color& textColor, ListViewItemDrawingStatus status) const
774 {
775         _ListViewItemElementText* pElement = GetElementText(elementId);
776
777         if (pElement == null)
778         {
779                 return false;
780         }
781
782         textColor = pElement->textColor[status];
783
784         return true;
785 }
786
787 bool
788 _ListViewItem::SetProgressValue(int value)
789 {
790         if ((value < 0) || (value > 100))
791         {
792                 if (__pProgress != null)
793                 {
794                         __pProgress->SetVisibleState(false);
795                 }
796
797                 return false;
798         }
799
800         if (__pProgress == null)
801         {
802                 __pProgress = _Progress::CreateProgressN();
803                 SysTryReturn(NID_UI_CTRL, (__pProgress != null), false, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
804
805                 __pProgress->SetRange(0, 100);
806
807                 AttachChild(*__pProgress);
808
809                 AdjustProgressBounds();
810         }
811
812         __pProgress->SetValue(value);
813         __pProgress->SetVisibleState(true);
814
815         return true;
816 }
817
818 bool
819 _ListViewItem::SetProgressMargins(float leftMargin, float rightMargin)
820 {
821         if ((leftMargin < 0.0f) || (rightMargin < 0.0f) || (GetBoundsF().width - leftMargin - rightMargin <= 0.0f))
822         {
823                 return false;
824         }
825
826         __progressLeftMargin = leftMargin;
827         __progressRightMargin = rightMargin;
828
829         AdjustProgressBounds();
830
831         return true;
832 }
833
834 void
835 _ListViewItem::AdjustProgressBounds(void)
836 {
837         if (__pProgress != null)
838         {
839                 FloatRectangle progressRect = GetBoundsF();
840                 float progressHeight = 0.0f;
841                 float bottomMargin = 0.0f;
842
843                 // Calculate progress position
844                 GET_SHAPE_CONFIG(SLIDER::BAR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, progressHeight);
845                 GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, bottomMargin);
846
847                 progressHeight = progressHeight + (bottomMargin * 2.0f);
848                 progressRect.x = __progressLeftMargin;
849                 progressRect.y = progressRect.height - progressHeight;
850                 progressRect.height = progressHeight;
851                 progressRect.width = progressRect.width -  __progressLeftMargin - __progressRightMargin;
852
853                 progressRect.y -= ((__descriptionTextShowState) ? GetDescriptionTextHeight() : 0.0f);
854
855                 __pProgress->SetBounds(progressRect);
856         }
857 }
858
859 bool
860 _ListViewItem::SetDescriptionText(const String& text)
861 {
862         if (text.IsEmpty())
863         {
864                 if (__pDescriptionText != null)
865                 {
866                         DetachChild(*__pDescriptionText);
867
868                         delete __pDescriptionText;
869                         __pDescriptionText = null;
870                 }
871
872                 return true;
873         }
874         else
875         {
876                 if (__pDescriptionText == null)
877                 {
878                         __pDescriptionText = _Label::CreateLabelN();
879                         result r = GetLastResult();
880                         SysTryReturn(NID_UI_CTRL, (__pDescriptionText != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
881
882                         __pDescriptionText->SetVisibleState(false);
883                         __pDescriptionText->SetMargin(0.0f, 0.0f, 0.0f, 0.0f);
884                         __pDescriptionText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
885
886                         AttachChild(*__pDescriptionText);
887                 }
888
889                 FloatRectangle bounds = GetBoundsF();
890                 FloatRectangle textBounds;
891                 float textSize = 0.0f;
892                 bool ret = true;
893
894                 GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, textBounds.x);
895                 GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, textBounds.y);
896                 GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, textSize);
897
898                 textBounds.width = bounds.width - (textBounds.x * 2.0f);
899
900                 TextObject* pText = new (std::nothrow) TextObject();
901                 SysTryReturn(NID_UI_CTRL, (pText != null), false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
902
903                 pText->Construct();
904
905                 TextSimple* pSimpleText = new (std::nothrow) TextSimple((const_cast<wchar_t*>(text.GetPointer())), text.GetLength());
906                 SysTryCatch(NID_UI_CTRL, (pSimpleText != null), (ret = false), E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
907
908                 pText->AppendElement(*pSimpleText);
909                 pText->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP);
910                 pText->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
911                 pText->SetFont(GetFont(FONT_STYLE_PLAIN, textSize), 0, pText->GetTextLength());
912                 pText->SetBounds(FloatRectangle(0.0f, 0.0f, textBounds.width, 1.0f));
913                 pText->Compose();
914
915                 textBounds.height = pText->GetTotalHeight();
916
917                 __pDescriptionText->SetBounds(FloatRectangle(textBounds.x, bounds.height + textBounds.y, textBounds.width, textBounds.height));
918                 __pDescriptionText->SetBackgroundColor(Color(0, 0, 0, 0));
919                 __pDescriptionText->SetTextColor(__descriptionTextColor);
920                 __pDescriptionText->SetTextConfig(textSize, LABEL_TEXT_STYLE_NORMAL);
921                 __pDescriptionText->SetText(text);
922
923 CATCH:
924                 delete pText;
925
926                 return ret;
927         }
928 }
929
930 void
931 _ListViewItem::SetDescriptionTextColor(const Color& color)
932 {
933         __descriptionTextColor = color;
934 }
935
936 float
937 _ListViewItem::GetDescriptionTextHeight(void)
938 {
939         if (__pDescriptionText != null)
940         {
941                 float margin = 0.0f;
942                 GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin);
943
944                 return ((margin * 2.0f) + __pDescriptionText->GetBoundsF().height);
945         }
946
947         return 0.0f;
948 }
949
950 void
951 _ListViewItem::SetDescriptionTextShowState(bool show)
952 {
953         if (__descriptionTextShowState != show)
954         {
955                 __descriptionTextShowState = show;
956
957                 if (__pDescriptionText != null)
958                 {
959                         __pDescriptionText->SetVisibleState(__descriptionTextShowState);
960
961                         FloatDimension itemDimension = GetSizeF();
962                         float descriptionTextHeight = GetDescriptionTextHeight();
963
964                         itemDimension.height += ((__descriptionTextShowState) ? (descriptionTextHeight) : (-descriptionTextHeight));
965
966                         // Set position & item height
967                         SetItemCustomHeight((__descriptionTextShowState ? (itemDimension.height - descriptionTextHeight) : 0.0f));
968                         SetItemHeight(itemDimension.height);
969
970                         SetSize(itemDimension);
971
972                         _AccessibilityContainer* pContainer = GetAccessibilityContainer();
973
974                         if ((__pAccessibilityElement != null) && (pContainer != null))
975                         {
976                                 SetAccessibilityElement();
977
978                                 _AccessibilityManager::GetInstance()->RequestToDrawFocusUi();
979                         }
980                 }
981         }
982 }
983
984 void
985 _ListViewItem::SetContextItemEventListener(_IActionEventListener& listener)
986 {
987         __pContextItemEventListener = &listener;
988 }
989
990 void
991 _ListViewItem::SetContextItemActivationState(bool activate)
992 {
993         _ListViewContextItem* pContextItem = static_cast<_ListViewContextItem*>(GetContextItem());
994
995         if ((pContextItem != null) && (__pContextItemEventListener != null))
996         {
997                 if (activate)
998                 {
999                         pContextItem->AddContextItemEventListener(*__pContextItemEventListener);
1000                 }
1001                 else
1002                 {
1003                         pContextItem->RemoveContextItemEventListener(*__pContextItemEventListener);
1004                 }
1005         }
1006 }
1007
1008 bool
1009 _ListViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1010 {
1011         if ((&source != this) && (source.GetParent() != this))
1012         {
1013                 return false;
1014         }
1015
1016         ClearLastStateChangedInfo();
1017         StopTextSlideTimer();
1018
1019         FloatPoint pos = touchinfo.GetCurrentPosition();
1020         __prevTouchPos.SetPosition(pos.x, pos.y);
1021
1022         __selectedElementId = GetElementIdFromPosition(pos);
1023
1024         _ListViewItemElement* pElement = GetElement(__selectedElementId);
1025
1026         if (pElement != null)
1027         {
1028                 if ((pElement->actionElement) && (pElement->selectionEnabled))
1029                 {
1030                         __selectionEabledBgColor = GetItemBackgroundColor(LIST_ITEM_STATE_PRESSED);
1031                         SetItemBackgroundColor(LIST_ITEM_STATE_PRESSED, GetItemBackgroundColor(LIST_ITEM_STATE_NORMAL));
1032
1033                         __selectionEabled = true;
1034                 }
1035
1036                 if (pElement->elementType == LISTVIEW_ITEM_ELEMENT_TEXT)
1037                 {
1038                         SetCutlinkTextFocus(pos);
1039
1040                         if (pElement->pTextElement->textSlidingEnabled)
1041                         {
1042                                 pElement->pTextElement->pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT);
1043                                 pElement->pTextElement->pTextObject->Compose();
1044
1045                                 if (pElement->pTextElement->pTextObject->IsActionOn())
1046                                 {
1047                                         StartTextSlideTimer();
1048                                 }
1049                         }
1050                 }
1051         }
1052
1053         __touchPressed = true;
1054
1055         SetLastStateChangedInfo();
1056
1057         _TableViewItem::OnTouchPressed(source, touchinfo);
1058
1059         return false;
1060 }
1061
1062 bool
1063 _ListViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1064 {
1065         if ((&source != this) && (source.GetParent() != this))
1066         {
1067                 return false;
1068         }
1069
1070         ResetTextSlide();
1071         ResetCutlinkFocus();
1072
1073         if (__selectionEabled)
1074         {
1075                 SetItemBackgroundColor(LIST_ITEM_STATE_PRESSED, __selectionEabledBgColor);
1076                 __selectionEabled = false;
1077         }
1078
1079         __selectedElementId = -1;
1080         __touchPressed = false;
1081
1082         _TableViewItem::OnTouchReleased(source, touchinfo);
1083
1084         return false;
1085 }
1086
1087 bool
1088 _ListViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1089 {
1090         if (__touchPressed)
1091         {
1092                 ClearLastStateChangedInfo();
1093         }
1094
1095         ResetTextSlide();
1096
1097         __selectedElementId = -1;
1098         __touchPressed = false;
1099
1100         _TableViewItem::OnTouchMoved(source, touchinfo);
1101
1102         return false;
1103 }
1104
1105 bool
1106 _ListViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
1107 {
1108         ResetTextSlide();
1109
1110         if (__selectionEabled)
1111         {
1112                 SetItemBackgroundColor(LIST_ITEM_STATE_PRESSED, __selectionEabledBgColor);
1113                 __selectionEabled = false;
1114         }
1115
1116         _TableViewItem::OnTouchCanceled(source, touchinfo);
1117
1118         return false;
1119 }
1120
1121 void
1122 _ListViewItem::OnDraw(void)
1123 {
1124         _TableViewItem::OnDraw();
1125
1126         DrawElements();
1127         DrawDivider();
1128 }
1129
1130 result
1131 _ListViewItem::OnBoundsChanging(const FloatRectangle& bounds)
1132 {
1133         FloatDimension currentSize = GetSizeF();
1134
1135         if (!_FloatCompare(currentSize.width, bounds.width) || !_FloatCompare(currentSize.height, bounds.height))
1136         {
1137                 __needAlignContextItem = true;
1138         }
1139
1140         return E_SUCCESS;
1141 }
1142
1143 void
1144 _ListViewItem::OnBoundsChanged(void)
1145 {
1146         _TableViewItem::OnBoundsChanged();
1147
1148         if (__needAlignContextItem)
1149         {
1150                 _ListViewContextItem* pContextItem = static_cast<_ListViewContextItem*>(GetContextItem());
1151
1152                 if (pContextItem != null)
1153                 {
1154                         FloatRectangle bounds = GetBoundsF();
1155                         pContextItem->AdjustItemBounds(bounds);
1156
1157                         __needAlignContextItem = false;
1158                 }
1159         }
1160 }
1161
1162 ListViewItemDrawingStatus
1163 _ListViewItem::GetItemDrawingStatus(void)
1164 {
1165         TableViewItemDrawingStatus parentStatus = GetDrawingStatus();
1166         ListViewItemDrawingStatus status;
1167
1168         switch (parentStatus)
1169         {
1170         case TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED:
1171                 status = LISTVIEW_ITEM_STATUS_PRESSED;
1172                 break;
1173
1174         case TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED:
1175                 status = LISTVIEW_ITEM_STATUS_HIGHLIGHTED;
1176                 break;
1177
1178         default:
1179                 status = LISTVIEW_ITEM_STATUS_NORMAL;
1180                 break;
1181         }
1182
1183         return status;
1184 }
1185
1186 void
1187 _ListViewItem::DrawElement(_ListViewItemElement* pElement)
1188 {
1189         // Get Current TableViewItem drawing status
1190         ListViewItemDrawingStatus status = GetItemDrawingStatus();
1191         FloatRectangle elementRect;
1192
1193         // Check element selection enabled
1194         if (status != LISTVIEW_ITEM_STATUS_NORMAL)
1195         {
1196                 if (__selectedElementId == -1)
1197                 {
1198                         if ((pElement->actionElement) && (pElement->selectionEnabled))
1199                         {
1200                                 status = LISTVIEW_ITEM_STATUS_NORMAL;
1201                         }
1202                 }
1203                 else if (__selectedElementId != pElement->elementId)
1204                 {
1205                         bool enabled = false;
1206                         if (GetElementSelectionEnabled(__selectedElementId, enabled) && enabled)
1207                         {
1208                                 status = LISTVIEW_ITEM_STATUS_NORMAL;
1209                         }
1210                         else if ((pElement->actionElement) && (pElement->selectionEnabled))
1211                         {
1212                                 status = LISTVIEW_ITEM_STATUS_NORMAL;
1213                         }
1214                 }
1215         }
1216
1217         Canvas* pCanvas = null;
1218
1219         switch (pElement->elementType)
1220         {
1221         case LISTVIEW_ITEM_ELEMENT_TEXT:
1222                 DrawText(pElement->bounds, status, pElement->pTextElement);
1223                 break;
1224
1225         case LISTVIEW_ITEM_ELEMENT_BITMAP:
1226                 DrawBitmap(pElement->bounds, status, pElement->pBitmapElement);
1227                 break;
1228
1229         case LISTVIEW_ITEM_ELEMENT_OBJ:
1230                 pCanvas = pElement->pCustomElement->pVE->GetCanvasN();
1231
1232                 if (pCanvas != null)
1233                 {
1234                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1235                         pCanvas->Clear();
1236                         elementRect.SetBounds(0.0f, 0.0f, pElement->bounds.width, pElement->bounds.height);
1237
1238                         pElement->pCustomElement->pCustom->DrawElement(pCanvas, elementRect, status);
1239                 }
1240                 break;
1241
1242         default:
1243                 break;
1244         }
1245
1246         delete pCanvas;
1247 }
1248
1249 void
1250 _ListViewItem::DrawElements(void)
1251 {
1252         _LinkedList <_ListViewItemElement>::_Iterator iter;
1253
1254         for (iter = __elements.begin(); iter != __elements.end(); iter++)
1255         {
1256                 DrawElement(&(*iter));
1257         }
1258 }
1259
1260 bool
1261 _ListViewItem::DrawText(FloatRectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementText* pText)
1262 {
1263         SysTryReturn(NID_UI_CTRL, (pText != null), false, E_INVALID_ARG, "[E_INVALID_ARG] This Text element is null.");
1264
1265         FloatRectangle bounds(rect.x, rect.y, rect.width, rect.height);
1266
1267         if (pText->pVE->GetParent() == null)
1268         {
1269                 GetVisualElement()->AttachChild(*(pText->pVE));
1270                 pText->pVE->SetShowState(true);
1271         }
1272
1273         if (pText->textSize > 0)
1274         {
1275                 pText->pTextObject->SetFont(GetFont(FONT_STYLE_PLAIN, pText->textSize), 0, pText->pTextObject->GetTextLength());
1276         }
1277
1278         // Calculate Text element bounds
1279         if (pText->pEnrichedText == null)
1280         {
1281                 FloatDimension textDimension = pText->pTextObject->GetTextExtentF(0, pText->pTextObject->GetTextLength());
1282                 TextObjectAlignment textAlign = pText->pTextObject->GetAlignment();
1283
1284                 if (__itemType == LISTVIEW_ITEM_TYPE_CUSTOM)
1285                 {
1286                         if (textDimension.width < bounds.width)
1287                         {
1288                                 bounds.width = textDimension.width;
1289
1290                                 if ((0x0007 & textAlign) == TEXT_OBJECT_ALIGNMENT_CENTER)
1291                                 {
1292                                         bounds.x = rect.x + ((rect.width - bounds.width) / 2.0f);
1293                                 }
1294                                 else if ((0x0007 & textAlign) == TEXT_OBJECT_ALIGNMENT_RIGHT)
1295                                 {
1296                                         bounds.x = rect.x + (rect.width - bounds.width);
1297                                 }
1298                         }
1299                         if (textDimension.height < bounds.height)
1300                         {
1301                                 bounds.height = textDimension.height;
1302
1303                                 if ((0x0700 & textAlign) == TEXT_OBJECT_ALIGNMENT_MIDDLE)
1304                                 {
1305                                         bounds.y = rect.y + ((rect.height - bounds.height) / 2.0f);
1306                                 }
1307                                 else if ((0x0700 & textAlign) == TEXT_OBJECT_ALIGNMENT_BOTTOM)
1308                                 {
1309                                         bounds.y = rect.y + (rect.height - bounds.height);
1310                                 }
1311                         }
1312                 }
1313                 else
1314                 {
1315                         if ((!_FloatCompare(bounds.width, textDimension.width)) || (!_FloatCompare(bounds.height, textDimension.height)))
1316                         {
1317                                 float itemWidth = GetBoundsF().width;
1318
1319                                 bounds.x = rect.x;
1320                                 bounds.y = rect.y + ((rect.height - textDimension.height) / 2.0f);
1321                                 bounds.width = ((itemWidth > bounds.x + textDimension.width) ? textDimension.width : (itemWidth - bounds.x));
1322                                 bounds.height = textDimension.height;
1323
1324                                 rect = bounds;
1325                         }
1326                 }
1327         }
1328
1329         pText->pVE->SetBounds(bounds);
1330
1331         // Check to EnrichedText contains Cutlink
1332         if ((pText->pEnrichedText != null) && (pText->cutlinkViewModeEnabled) && (pText->cutlinkParseEnabled)
1333                         && (pText->pTextObject->GetTotalCutLinkElementCount() <= 0))
1334         {
1335                 if (ParseCutlinkText(pText))
1336                 {
1337                         pText->pTextObject->SetCutLinkViewMode(true);
1338                 }
1339         }
1340         else
1341         {
1342                 if (IsItemEnabled())
1343                 {
1344                         pText->pTextObject->SetForegroundColor(pText->textColor[status], 0, pText->pTextObject->GetTextLength());
1345                 }
1346                 else
1347                 {
1348                         Color disableTextColor;
1349                         GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_DISABLED, disableTextColor);
1350
1351                         pText->pTextObject->SetForegroundColor(disableTextColor, 0, pText->pTextObject->GetTextLength());
1352                 }
1353         }
1354
1355         pText->pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1356         pText->pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
1357
1358         Canvas* pCanvas = pText->pVE->GetCanvasN();
1359         SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1360
1361         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1362         pCanvas->Clear();
1363
1364         pText->pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
1365
1366         delete pCanvas;
1367
1368         return true;
1369 }
1370
1371 bool
1372 _ListViewItem::DrawBitmap(FloatRectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementBitmap* pBitmap)
1373 {
1374         SysTryReturn(NID_UI_CTRL, (pBitmap != null), false, E_INVALID_ARG, "[E_INVALID_ARG] This Bitmap element is null.");
1375
1376         Bitmap* pDrawBitmap = pBitmap->pBitmap[status];
1377         if ((pDrawBitmap == null) && (status != LISTVIEW_ITEM_STATUS_NORMAL))
1378         {
1379                 pDrawBitmap = pBitmap->pBitmap[LISTVIEW_ITEM_STATUS_NORMAL];
1380         }
1381
1382         SysTryReturn(NID_UI_CTRL, (pDrawBitmap != null), false, E_INVALID_ARG, "[E_INVALID_ARG] This Bitmap element is null.");
1383
1384         if (pBitmap->pVE->GetParent() == null)
1385         {
1386                 GetVisualElement()->AttachChild(*(pBitmap->pVE));
1387                 pBitmap->pVE->SetShowState(true);
1388         }
1389
1390         pBitmap->pVE->SetBounds(rect);
1391
1392         Canvas* pCanvas = pBitmap->pVE->GetCanvasN();
1393         SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1394
1395         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1396         pCanvas->Clear();
1397
1398         if (pDrawBitmap->IsNinePatchedBitmap())
1399         {
1400                 pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap);
1401         }
1402         else
1403         {
1404                 pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap);
1405         }
1406
1407         delete pCanvas;
1408
1409         return true;
1410 }
1411
1412 void
1413 _ListViewItem::DrawDivider(void)
1414 {
1415         if ((__itemType == LISTVIEW_ITEM_TYPE_GROUP) && (GetItemBackgroundBitmap(LIST_ITEM_STATE_NORMAL) == null))
1416         {
1417                 float lineHeight = 0.0f;
1418                 float lineLeftMargin = 0.0f;
1419                 float lineBottomMargin = 0.0f;
1420                 float lineTopMargin = 0.0f;
1421                 GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight);
1422                 GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin);
1423                 GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineBottomMargin);
1424
1425                 FloatRectangle textBounds;
1426                 FloatRectangle bitmapBounds;
1427                 _ListViewItemElementText* pElementText = GetElementText(LIST_ITEM_RESERVED_ID_3);
1428                 _ListViewItemElementBitmap* pElementBitmap = GetElementBitmap(LIST_ITEM_RESERVED_ID_2);
1429
1430                 if ((pElementText != null) && (pElementText->pVE != null))
1431                 {
1432                         textBounds = pElementText->pVE->GetBounds();
1433                 }
1434
1435                 if ((pElementBitmap != null) && (pElementBitmap->pVE != null))
1436                 {
1437                         bitmapBounds = pElementBitmap->pVE->GetBounds();
1438                 }
1439
1440                 float textBottomPos = textBounds.y + textBounds.height;
1441                 float bitmapBottomPos = bitmapBounds.y + bitmapBounds.height;
1442
1443                 lineTopMargin = (textBottomPos > bitmapBottomPos) ? textBottomPos : bitmapBottomPos;
1444
1445                 FloatRectangle bounds = GetBoundsF();
1446                 float defaultMargin = bounds.height - lineBottomMargin;
1447                 lineTopMargin = (lineTopMargin > defaultMargin) ? lineTopMargin : defaultMargin;
1448
1449                 if (bounds.height <= lineTopMargin)
1450                 {
1451                         return;
1452                 }
1453
1454                 if (__pDivider == null)
1455                 {
1456                         __pDivider = _Label::CreateLabelN();
1457                         SysTryReturnVoidResult(NID_UI_CTRL, __pDivider != null, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1458
1459                         AttachSystemChild(*__pDivider);
1460
1461                         _AccessibilityContainer* pContainer = __pDivider->GetAccessibilityContainer();
1462                         if (pContainer != null)
1463                         {
1464                                 pContainer->Activate(false);
1465                         }
1466                 }
1467
1468                 Color underLineColor;
1469                 GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_NORMAL, underLineColor);
1470
1471                 __pDivider->SetBounds(FloatRectangle(lineLeftMargin, lineTopMargin, bounds.width - lineLeftMargin * 2.0f, lineHeight));
1472                 __pDivider->SetBackgroundColor(underLineColor);
1473                 __pDivider->Invalidate();
1474         }
1475 }
1476
1477 void
1478 _ListViewItem::StartTextSlideTimer(void)
1479 {
1480         result r = E_SUCCESS;
1481
1482         if (__pTextSlideTimer == null)
1483         {
1484                 __pTextSlideTimer = new (std::nothrow) Timer();
1485
1486                 r = __pTextSlideTimer->Construct(*this);
1487                 SysTryCatch(NID_UI, (r == E_SUCCESS), ,E_SYSTEM, ("[E_SYSTEM] Timer cannot construct."));
1488         }
1489         else
1490         {
1491                 __pTextSlideTimer->Cancel();
1492         }
1493
1494         r = __pTextSlideTimer->Start(TEXT_SLIDING_TIMER_DURATION);
1495         SysTryCatch(NID_UI, (r == E_SUCCESS), , E_SYSTEM, ("[E_SYSTEM] Timer Start failed."));
1496
1497         return;
1498
1499 CATCH:
1500         StopTextSlideTimer();
1501 }
1502
1503 void
1504 _ListViewItem::StopTextSlideTimer(void)
1505 {
1506         delete __pTextSlideTimer;
1507         __pTextSlideTimer = null;
1508 }
1509
1510 bool
1511 _ListViewItem::IsTextSlideTimerRunning(void)
1512 {
1513         return (__pTextSlideTimer != null);
1514 }
1515
1516 void
1517 _ListViewItem::OnTextSlideTimerExpired(void)
1518 {
1519         if (__selectedElementId != -1)
1520         {
1521                 _ListViewItemElement* pElement = GetElement(__selectedElementId);
1522
1523                 if ((pElement != null) && (pElement->pTextElement->pTextObject != null))
1524                 {
1525                         TextObject* pTextObject = pElement->pTextElement->pTextObject;
1526
1527                         Canvas* pCanvas = (pElement->pTextElement->pVE)->GetCanvasN();
1528                         SysTryReturnVoidResult(NID_UI_CTRL, (pCanvas != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1529
1530                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1531                         pCanvas->Clear();
1532
1533                         pTextObject->SetForegroundColor(pElement->pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED], 0, pTextObject->GetTextLength());
1534                         pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT);
1535                         pTextObject->Compose();
1536                         pTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pCanvas));
1537
1538                         pCanvas->Show(_CoordinateSystemUtils::ConvertToInteger(pElement->bounds));
1539                         StartTextSlideTimer();
1540
1541                         delete pCanvas;
1542                         pCanvas = null;
1543                 }
1544         }
1545 }
1546
1547 void
1548 _ListViewItem::ResetTextSlide(void)
1549 {
1550         if (IsTextSlideTimerRunning())
1551         {
1552                 StopTextSlideTimer();
1553
1554                 _ListViewItemElement* pElement = GetElement(__selectedElementId);
1555
1556                 if ((pElement != null) && (pElement->pTextElement->pTextObject != null))
1557                 {
1558                         pElement->pTextElement->pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1559                         pElement->pTextElement->pTextObject->SetForegroundColor(pElement->pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL],
1560                                         0, pElement->pTextElement->pTextObject->GetTextLength());
1561                 }
1562         }
1563 }
1564
1565 void
1566 _ListViewItem::OnTimerExpired(Timer& timer)
1567 {
1568         _TableViewItem::OnTimerExpired(timer);
1569
1570         if (&timer == __pTextSlideTimer)
1571         {
1572                 OnTextSlideTimerExpired();
1573         }
1574 }
1575
1576 bool
1577 _ListViewItem::ParseCutlinkText(_ListViewItemElementText* pElementText)
1578 {
1579         if ((pElementText == null) || (pElementText->pEnrichedText == null))
1580         {
1581                 return false;
1582         }
1583
1584         TextObject* pTextObject = pElementText->pTextObject;
1585         unsigned long cutlinkMaskType = pElementText->cutlinkMaskType;
1586         TextLinkInfo* pTextLinkInfo = null;
1587         TextLinkInfo* pNextLinkInfo = null;
1588         int currentOffset = 0;
1589         bool isChangingCutlink = false;
1590         wchar_t* pCutlinkString = null;
1591         bool ret = true;
1592
1593         int strLength = pTextObject->GetTextLength();
1594         wchar_t* pStr = new (std::nothrow) wchar_t[strLength + 1];
1595         SysTryReturn(NID_UI, (pStr != null), false, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient."));
1596
1597         pTextObject->GetText(pStr, strLength);
1598
1599         TextCutLinkParser* pParser = new (std::nothrow) TextCutLinkParser();
1600         SysTryCatch(NID_UI, (pParser != null), (ret = false), E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient."));
1601
1602         pParser->SetCutLinkMask(cutlinkMaskType);
1603
1604         pTextLinkInfo = pParser->Parse(pStr, strLength, 0);
1605         SysTryCatch(NID_UI, (pTextLinkInfo != null), (ret = false), E_SYSTEM, ("[E_SYSTEM] TextLinkInfo is not valid."));
1606
1607         // remove all text element in _EnrichedTextImpl
1608         pElementText->pEnrichedText->RemoveAllTextElements(true);
1609
1610         while (pTextLinkInfo != null)
1611         {
1612                 isChangingCutlink = false;
1613
1614                 switch (pTextLinkInfo->linkType)
1615                 {
1616                 case LINK_TYPE_URL:
1617                         if (cutlinkMaskType & LINK_TYPE_URL)
1618                         {
1619                                 isChangingCutlink = true;
1620                         }
1621                         break;
1622
1623                 case LINK_TYPE_EMAIL:
1624                         if (cutlinkMaskType & LINK_TYPE_EMAIL)
1625                         {
1626                                 isChangingCutlink = true;
1627                         }
1628                         break;
1629
1630                 case LINK_TYPE_TEL_NUM:
1631                         if (cutlinkMaskType & LINK_TYPE_TEL_NUM)
1632                         {
1633                                 isChangingCutlink = true;
1634                         }
1635                         break;
1636
1637                 case LINK_TYPE_APPCONTROL:
1638                         if (cutlinkMaskType & LINK_TYPE_APPCONTROL)
1639                         {
1640                                 isChangingCutlink = true;
1641                         }
1642                         break;
1643
1644                 case LINK_TYPE_MIME:
1645                         if (cutlinkMaskType & LINK_TYPE_MIME)
1646                         {
1647                                 isChangingCutlink = true;
1648                         }
1649                         break;
1650
1651                 default:
1652                         break;
1653                 }
1654
1655                 pCutlinkString = new (std::nothrow) wchar_t[pTextLinkInfo->length + 1];
1656
1657                 if (pCutlinkString == null)
1658                 {
1659                         while (pTextLinkInfo != null)
1660                         {
1661                                 pNextLinkInfo = pTextLinkInfo->pNextLinkInfo;
1662                                 delete pTextLinkInfo;
1663                                 pTextLinkInfo = pNextLinkInfo;
1664                         }
1665                         SysTryCatch(NID_UI, (pTextLinkInfo != null), (ret = false), E_SYSTEM, ("[E_SYSTEM] TextLinkInfo is not valid."));
1666                 }
1667
1668                 for (int i = 0; i < pTextLinkInfo->length; i++)
1669                 {
1670                         pCutlinkString[i] = pStr[pTextLinkInfo->srcOffset + i];
1671                 }
1672
1673                 pCutlinkString[pTextLinkInfo->length] = null;
1674
1675                 if (currentOffset < pTextLinkInfo->srcOffset)
1676                 {
1677                         TextSimple* pSimpleText = new (std::nothrow) TextSimple(pStr + currentOffset, pTextLinkInfo->srcOffset - currentOffset);
1678                         pTextObject->AppendElement(*pSimpleText);
1679                 }
1680
1681                 if (isChangingCutlink == true)
1682                 {
1683                         TextCutLink* pTextElement = new (std::nothrow) TextCutLink(false, pTextLinkInfo->linkType, pStr + pTextLinkInfo->srcOffset,
1684                                                                                                                                            pTextLinkInfo->length);
1685                         pTextElement->SetEditModeEnable(true);
1686                         pTextObject->AppendElement(*pTextElement);
1687                 }
1688                 else
1689                 {
1690                         TextSimple* pSimpleText = new (std::nothrow) TextSimple(pCutlinkString, pTextLinkInfo->length);
1691                         pTextObject->AppendElement(*pSimpleText);
1692                 }
1693
1694                 currentOffset = pTextLinkInfo->srcOffset + pTextLinkInfo->length;
1695
1696                 pNextLinkInfo = pTextLinkInfo->pNextLinkInfo;
1697                 delete pTextLinkInfo;
1698                 pTextLinkInfo = pNextLinkInfo;
1699
1700                 delete[] pCutlinkString;
1701                 pCutlinkString = null;
1702         }
1703
1704         if (strLength != currentOffset)
1705         {
1706                 TextSimple* pSimpleText = new (std::nothrow) TextSimple(pStr + currentOffset, strLength - currentOffset);
1707                 pTextObject->AppendElement(*pSimpleText);
1708         }
1709
1710         //pTextObject->SetRange(0, pTextObject->GetLength());
1711         //pTextObject->NotifyTextChanged(0, pTextObject->GetLength());
1712         pTextObject->Compose();
1713
1714 CATCH:
1715         delete pParser;
1716         pParser = null;
1717
1718         if (pStr != null)
1719         {
1720                 delete[] pStr;
1721                 pStr = null;
1722         }
1723
1724         return ret;
1725 }
1726
1727 bool
1728 _ListViewItem::IsCutlinkTextSelected(const FloatPoint& position, int* index, _ListViewItemUiLinkInfo** ppInfo) const
1729 {
1730         int elementId = GetElementIdFromPosition(position);
1731         _ListViewItemElementText* pElement = GetElementText(elementId);
1732
1733         if ((pElement != null) && (pElement->pTextObject) && (pElement->cutlinkViewModeEnabled))
1734         {
1735                 TextObject* pTextObject = pElement->pTextObject;
1736                 FloatRectangle displayRect = pTextObject->GetBoundsF();
1737                 int selectedIndex = pTextObject->GetCutLinkIndexFromPositionData(position.x - displayRect.x, position.y - displayRect.y);
1738
1739                 if (selectedIndex >= 0)
1740                 {
1741                         *index = selectedIndex;
1742                         TextCutLink* pCutLinkObject = dynamic_cast<TextCutLink*>(pTextObject->GetCutLinkElementAtCutLinkElementIndex(selectedIndex));
1743                         if (pCutLinkObject == null)
1744                         {
1745                                 return false;
1746                         }
1747
1748                         String cutLinkString(pCutLinkObject->GetText());
1749                         LinkType baseLinkType = pCutLinkObject->GetCutLinkType();
1750
1751                         if (baseLinkType & pElement->cutlinkMaskType)
1752                         {
1753                                 _ListViewItemUiLinkInfo* pUiLinkInfo = new (std::nothrow) _ListViewItemUiLinkInfo();
1754
1755                                 pUiLinkInfo->textInfo = cutLinkString;
1756                                 pUiLinkInfo->linkType = baseLinkType;
1757                                 pUiLinkInfo->linkInfo = cutLinkString;
1758
1759                                 *ppInfo = pUiLinkInfo;
1760                         }
1761                 }
1762
1763                 return true;
1764         }
1765
1766         return false;
1767 }
1768
1769 bool
1770 _ListViewItem::SetCutlinkTextFocus(const FloatPoint& position)
1771 {
1772         int elementId = GetElementIdFromPosition(position);
1773         _ListViewItemElementText* pElement = GetElementText(elementId);
1774
1775         if ((pElement != null) && (pElement->pTextObject != null) && (pElement->cutlinkViewModeEnabled))
1776         {
1777                 TextObject* pTextObject = pElement->pTextObject;
1778                 FloatRectangle displayRect = pTextObject->GetBoundsF();
1779
1780                 int index = pTextObject->GetCutLinkIndexFromPositionData(position.x - displayRect.x, position.y - displayRect.y);
1781
1782                 if (index >= 0)
1783                 {
1784                         pTextObject->ChangeCutLinkState(index, true);
1785                         return true;
1786                 }
1787         }
1788
1789         return false;
1790 }
1791
1792 bool
1793 _ListViewItem::ResetCutlinkFocus(void)
1794 {
1795         _LinkedList <_ListViewItemElement>::_Iterator iter;
1796
1797         for (iter = __elements.begin(); iter != __elements.end(); iter++)
1798         {
1799                 if ((iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT) && (iter->pTextElement->pTextObject))
1800                 {
1801                         iter->pTextElement->pTextObject->ResetAllCutLinkElementsState();
1802                 }
1803         }
1804
1805         return true;
1806 }
1807
1808 Font*
1809 _ListViewItem::GetFont(unsigned long fontStyle, float fontSize)
1810 {
1811         __fontStyle = fontStyle;
1812         __fontSize = fontSize;
1813
1814         return GetFallbackFont();
1815 }
1816
1817 void
1818 _ListViewItem::OnFontChanged(Font* pFont)
1819 {
1820         __fontName = _Control::GetFont();
1821
1822         if (__pDescriptionText != null)
1823         {
1824                 __pDescriptionText->SetFont(__fontName);
1825         }
1826
1827         if (GetContextItem() != null)
1828         {
1829                 GetContextItem()->SetFont(__fontName);
1830         }
1831 }
1832
1833 void
1834 _ListViewItem::OnFontInfoRequested(unsigned long& style, int& size)
1835 {
1836         style = __fontStyle;
1837         size = _CoordinateSystemUtils::ConvertToInteger(__fontSize);
1838 }
1839
1840 void
1841 _ListViewItem::OnFontInfoRequested(unsigned long& style, float& size)
1842 {
1843         style = __fontStyle;
1844         size =  __fontSize;
1845 }
1846 void
1847 _ListViewItem::OnAncestorEnableStateChanged(const _Control& control)
1848 {
1849         _LinkedList <_ListViewItemElement>::_Iterator iter;
1850
1851         for (iter = __elements.begin(); iter != __elements.end(); iter++)
1852         {
1853                 if (iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT)
1854                 {
1855                         DrawText(iter->bounds, GetItemDrawingStatus(), iter->pTextElement);
1856                 }
1857         }
1858 }
1859
1860 bool
1861 CompareAccessibilityElement(_ListViewItemElement* a, _ListViewItemElement* b)
1862 {
1863         if (_FloatCompare(a->bounds.y, b->bounds.y))
1864         {
1865                 return (a->bounds.x < b->bounds.x);
1866         }
1867
1868         return (a->bounds.y < b->bounds.y);
1869 }
1870
1871 void
1872 _ListViewItem::SetAccessibilityElement(void)
1873 {
1874         if (!_AccessibilityManager::IsActivated())
1875         {
1876                 return;
1877         }
1878
1879         _AccessibilityContainer* pContainer = GetAccessibilityContainer();
1880
1881         if (pContainer != null)
1882         {
1883                 if (__pAccessibilityElement == null)
1884                 {
1885                         _LinkedList <_ListViewItemElement*> accessibilityElementList;
1886                         _LinkedList <_ListViewItemElement>::_Iterator iter;
1887
1888                         for (iter = __elements.begin(); iter != __elements.end(); iter++)
1889                         {
1890                                 if (iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT)
1891                                 {
1892                                         accessibilityElementList.push_back(&(*iter));
1893                                 }
1894                         }
1895
1896                         accessibilityElementList.sort(CompareAccessibilityElement);
1897
1898                         _LinkedList <_ListViewItemElement*>::_Iterator accessibilityIter;
1899                         _ListViewItemElement* pElement = null;
1900                         String accessibilityLable;
1901
1902                         for (accessibilityIter = accessibilityElementList.begin(); accessibilityIter != accessibilityElementList.end(); accessibilityIter++)
1903                         {
1904                                 pElement = *accessibilityIter;
1905
1906                                 int textLength = pElement->pTextElement->pTextObject->GetTextLength();
1907
1908                                 if (textLength > 0)
1909                                 {
1910                                         wchar_t* pAccessibilityText = new (std::nothrow) wchar_t[textLength + 1];
1911                                         SysTryReturnVoidResult(NID_UI_CTRL, (pAccessibilityText != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
1912
1913                                         pElement->pTextElement->pTextObject->GetText(pAccessibilityText, textLength);
1914
1915                                         accessibilityLable += String(pAccessibilityText);
1916
1917                                         delete[] pAccessibilityText;
1918                                 }
1919                         }
1920
1921                         accessibilityElementList.clear();
1922
1923                         __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
1924                         SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityElement != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
1925
1926                         __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height)));
1927                         __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
1928                         __pAccessibilityElement->SetName(L"ListViewItem");
1929
1930                         if (accessibilityLable.IsEmpty())
1931                         {
1932                                 accessibilityLable = L"ListViewItem";
1933                         }
1934
1935                         __pAccessibilityElement->SetLabel(accessibilityLable);
1936
1937                         pContainer->AddElement(*__pAccessibilityElement);
1938                 }
1939                 else
1940                 {
1941                         __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height)));
1942                 }
1943         }
1944 }
1945
1946 void
1947 _ListViewItem::SetAccessibilityElementLabel(void)
1948 {
1949         // nothing
1950 }
1951
1952 _ListViewItemHitTestVEDelegator::_ListViewItemHitTestVEDelegator(void)
1953 {
1954 }
1955
1956 _ListViewItemHitTestVEDelegator::~_ListViewItemHitTestVEDelegator(void)
1957 {
1958 }
1959
1960 HitTestResult
1961 _ListViewItemHitTestVEDelegator::HitTest(VisualElement& target, const FloatPoint& point)
1962 {
1963         return HIT_TEST_NOWHERE;
1964 }
1965
1966 }}} // Tizen::Ui::Controls