, __redrawListView(true)
, __isOrientationChanged(false)
, __needReloadItems(false)
- , __pItemNeedsLazyDeletion(null)
, __pPropagatedTouchEventListener(null)
{
GET_COLOR_CONFIG(TABLEVIEW::EMPTY_CONTENTS_TEXT_NORMAL, __emptyTextColor);
{
result r = E_SUCCESS;
- // for lazy delete item
- SetItemNeedsLazyDeletion();
-
if (itemAlignment == LIST_SCROLL_ITEM_ALIGNMENT_TOP)
{
r = GetCore().SetTopDrawnItemIndex(groupIndex, itemIndex);
return E_OUT_OF_RANGE;
}
- _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
-
- // for lazy delete item
- if (type != LIST_REFRESH_TYPE_ITEM_ADD)
- {
- if (__pItemNeedsLazyDeletion == pListViewItem)
- {
- SetItemNeedsLazyDeletion();
- }
- }
-
if (type == LIST_REFRESH_TYPE_ITEM_MODIFY)
{
int sweepGroupIndex = -1;
}
else
{
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
_ListViewItemStatus itemStatus;
memset(&itemStatus, 0, sizeof(_ListViewItemStatus));
bool needChangeEventTarget = false;
{
__needReloadItems = true;
- // for lazy delete item
- SetItemNeedsLazyDeletion();
-
result r = GetCore().UpdateTableView();
CheckEmptyListShowState();
}
void
-_GroupedListViewImpl::SetItemNeedsLazyDeletion(void)
+_GroupedListViewImpl::SetItemNeedsLazyDeletion(_ListViewItem* pItem)
{
- if (__pItemNeedsLazyDeletion != null)
- {
- _GroupedListViewItemProviderAdaptor* pProviderAdaptor =
- static_cast <_GroupedListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor());
+ _GroupedListViewItemProviderAdaptor* pProviderAdaptor =
+ static_cast <_GroupedListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor());
- if (pProviderAdaptor != null)
- {
- pProviderAdaptor->SetItemNeedsLazyDeletion(__pItemNeedsLazyDeletion);
- }
+ if (pProviderAdaptor != null)
+ {
+ pProviderAdaptor->SetItemNeedsLazyDeletion(pItem);
}
}
{
GetCore().ResetSweepItem();
- __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
+
+ SetItemNeedsLazyDeletion(pListViewItem);
_ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, elementId, 0, NOTIFY_TYPE_SELCTED_CONTEXT_ITEM);
__pListItemEvent->Fire(*pArg);
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
}
}
{
if (__pListItemEvent != null)
{
- __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
+
+ SetItemNeedsLazyDeletion(pListViewItem);
_ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, direction, 0, NOTIFY_TYPE_SWEPT_ITEM);
__pListItemEvent->Fire(*pArg);
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
}
}
{
_ListViewItem* pListViewItem = static_cast<_ListViewItem*>(pItem);
- __pItemNeedsLazyDeletion = pListViewItem;
-
if (pListViewItem != null)
{
+ SetItemNeedsLazyDeletion(pListViewItem);
+
_ListViewItemStateChangedInfo itemInfo;
pListViewItem->GetLastStateChangedInfo(itemInfo);
}
pListViewItem->ClearLastStateChangedInfo();
- }
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
+ }
}
}
if ((GetItemIndexFromPosition(GetCurrentTouchPosition(), groupIndex, itemIndex, elementId) == E_SUCCESS) && (itemIndex != -1))
{
- __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex));
- if ((__pItemNeedsLazyDeletion != null) && (!__pItemNeedsLazyDeletion->IsContextItem()))
+ if ((pListViewItem != null) && (!pListViewItem->IsContextItem()))
{
+ SetItemNeedsLazyDeletion(pListViewItem);
+
_ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, elementId, 0, NOTIFY_TYPE_LONG_PRESSED_ITEM);
__pListItemEvent->Fire(*pArg);
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
}
}
}
, __countOfAllGroups(0)
, __countOfAllItems(0)
, __pItemNeedsLazyDeletion(null)
+ , __pLazyDeletionItem(null)
, __usingFloatingPoint(false)
{
}
, __countOfAllGroups(0)
, __countOfAllItems(0)
, __pItemNeedsLazyDeletion(null)
+ , __pLazyDeletionItem(null)
, __usingFloatingPoint(true)
{
}
{
__descriptionTextShowItem.clear();
- SetItemNeedsLazyDeletion(null);
+ SetItemLazyDeletion(null);
}
void
_ListViewItem* pListViewItem = pItemBaseImpl->GetListViewItem();
SysAssert(pListViewItem != null);
- pListViewItem->SetFont(__fontName);
pListViewItem->AddRef();
pListViewItem->SetItemStyle(static_cast<TableViewAnnexStyle>(pItemBaseImpl->GetListItemAnnexStyle()));
pListViewItem->SetItemWidth(GetListWidth());
+ pListViewItem->SetFont(__fontName);
if (itemIndex == -1)
{
if (pListViewItem == __pItemNeedsLazyDeletion)
{
- pListViewItem->AddRef();
+ SetItemLazyDeletion(pListViewItem);
}
if (pListViewItem->Release() != 0)
{
delete pItemBase;
}
-
}
}
}
if (pListViewItem == __pItemNeedsLazyDeletion)
{
- pListViewItem->AddRef();
+ SetItemLazyDeletion(pListViewItem);
}
if (pListViewItem->Release() != 0)
void
_GroupedListViewItemProviderAdaptor::SetItemNeedsLazyDeletion(_ListViewItem* pItem)
{
- if (__pItemNeedsLazyDeletion != pItem)
+ __pItemNeedsLazyDeletion = pItem;
+}
+
+void
+_GroupedListViewItemProviderAdaptor::SetItemLazyDeletion(_ListViewItem* pItem)
+{
+ if (__pLazyDeletionItem != pItem)
{
- if (__pItemNeedsLazyDeletion != null)
+ if (__pLazyDeletionItem != null)
{
- __pItemNeedsLazyDeletion->Release();
+ __pLazyDeletionItem->Release();
+ }
+ if (pItem != null)
+ {
+ pItem->AddRef();
}
- __pItemNeedsLazyDeletion = pItem;
+ __pLazyDeletionItem = pItem;
}
}
+
}}} // Tizen::Ui::Controls
, __redrawListView(true)
, __isOrientationChanged(false)
, __needReloadItems(false)
- , __pItemNeedsLazyDeletion(null)
, __pPropagatedTouchEventListener(null)
{
GET_COLOR_CONFIG(TABLEVIEW::EMPTY_CONTENTS_TEXT_NORMAL, __emptyTextColor);
{
result r = E_SUCCESS;
- // for lazy delete item
- SetItemNeedsLazyDeletion();
-
if (itemAlignment == LIST_SCROLL_ITEM_ALIGNMENT_TOP)
{
r = GetCore().SetTopDrawnItemIndex(0, index);
return E_OUT_OF_RANGE;
}
- _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(0, index));
-
- // for lazy delete item
- if (type != LIST_REFRESH_TYPE_ITEM_ADD)
- {
- if (__pItemNeedsLazyDeletion == pListViewItem)
- {
- SetItemNeedsLazyDeletion();
- }
- }
-
if (type == LIST_REFRESH_TYPE_ITEM_MODIFY)
{
int sweepGroupIndex = -1;
if ((topItemIndex <= index) && (bottomItemIndex >= index))
{
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(0, index));
_ListViewItemStatus itemStatus;
memset(&itemStatus, 0, sizeof(_ListViewItemStatus));
bool needChangeEventTarget = false;
{
__needReloadItems = true;
- // for lazy delete item
- SetItemNeedsLazyDeletion();
-
result r = GetCore().UpdateTableView();
CheckEmptyListShowState();
}
void
-_ListViewImpl::SetItemNeedsLazyDeletion(void)
+_ListViewImpl::SetItemNeedsLazyDeletion(_ListViewItem* pItem)
{
- if (__pItemNeedsLazyDeletion != null)
- {
- _ListViewItemProviderAdaptor* pProviderAdaptor = static_cast <_ListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor());
+ _ListViewItemProviderAdaptor* pProviderAdaptor = static_cast <_ListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor());
- if (pProviderAdaptor != null)
- {
- pProviderAdaptor->SetItemNeedsLazyDeletion(__pItemNeedsLazyDeletion);
- }
+ if (pProviderAdaptor != null)
+ {
+ pProviderAdaptor->SetItemNeedsLazyDeletion(pItem);
}
}
{
GetCore().ResetSweepItem();
- __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex));
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex));
+
+ SetItemNeedsLazyDeletion(pListViewItem);
_ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, elementId, 0, 0, NOTIFY_TYPE_SELCTED_CONTEXT_ITEM);
__pListItemEvent->Fire(*pArg);
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
}
}
{
_ListViewItem* pListViewItem = static_cast<_ListViewItem*>(pItem);
- __pItemNeedsLazyDeletion = pListViewItem;
-
if (pListViewItem != null)
{
+ SetItemNeedsLazyDeletion(pListViewItem);
+
_ListViewItemStateChangedInfo itemInfo;
pListViewItem->GetLastStateChangedInfo(itemInfo);
}
pListViewItem->ClearLastStateChangedInfo();
- }
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
+ }
}
}
{
if (__pListItemEvent != null)
{
- __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex));
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex));
+
+ SetItemNeedsLazyDeletion(pListViewItem);
_ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, direction, 0, 0, NOTIFY_TYPE_SWEPT_ITEM);
__pListItemEvent->Fire(*pArg);
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
}
}
if (GetItemIndexFromPosition(GetCurrentTouchPosition(), itemIndex, elementId) == E_SUCCESS)
{
- __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex));
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex));
- if ((__pItemNeedsLazyDeletion != null) && (!__pItemNeedsLazyDeletion->IsContextItem()))
+ if ((pListViewItem != null) && (!pListViewItem->IsContextItem()))
{
+ SetItemNeedsLazyDeletion(pListViewItem);
+
_ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, elementId, 0, 0, NOTIFY_TYPE_LONG_PRESSED_ITEM);
__pListItemEvent->Fire(*pArg);
- __pItemNeedsLazyDeletion = null;
+ SetItemNeedsLazyDeletion(null);
}
}
}
, __itemLoadedCount(0)
, __countOfAllItems(0)
, __pItemNeedsLazyDeletion(null)
+ , __pLazyDeletionItem(null)
, __usingFloatingPoint(false)
{
}
, __itemLoadedCount(0)
, __countOfAllItems(0)
, __pItemNeedsLazyDeletion(null)
+ , __pLazyDeletionItem(null)
, __usingFloatingPoint(true)
{
}
{
__descriptionTextShowItem.clear();
- SetItemNeedsLazyDeletion(null);
+ SetItemLazyDeletion(null);
}
void
_ListViewItem* pListViewItem = pItemBaseImpl->GetListViewItem();
SysAssert(pListViewItem != null);
- pListViewItem->SetFont(__fontName);
pListViewItem->AddRef();
pListViewItem->SetAppInfo(pItemBase);
pListViewItem->SetItemStyle(static_cast<TableViewAnnexStyle>(pItemBaseImpl->GetListItemAnnexStyle()));
pListViewItem->SetItemWidth(GetListWidth());
+ pListViewItem->SetFont(__fontName);
if (IsDescriptionTextShown(itemIndex))
{
if (pListViewItem == __pItemNeedsLazyDeletion)
{
- pListViewItem->AddRef();
+ SetItemLazyDeletion(pListViewItem);
}
if (pListViewItem->Release() != 0)
{
delete pItemBase;
}
-
}
}
if (pListViewItem == __pItemNeedsLazyDeletion)
{
- pListViewItem->AddRef();
+ SetItemLazyDeletion(pListViewItem);
}
if (pListViewItem->Release() != 0)
void
_ListViewItemProviderAdaptor::SetItemNeedsLazyDeletion(_ListViewItem* pItem)
{
- if (__pItemNeedsLazyDeletion != pItem)
+ __pItemNeedsLazyDeletion = pItem;
+}
+
+void
+_ListViewItemProviderAdaptor::SetItemLazyDeletion(_ListViewItem* pItem)
+{
+ if (__pLazyDeletionItem != pItem)
{
- if (__pItemNeedsLazyDeletion != null)
+ if (__pLazyDeletionItem != null)
+ {
+ __pLazyDeletionItem->Release();
+ }
+ if (pItem != null)
{
- __pItemNeedsLazyDeletion->Release();
+ pItem->AddRef();
}
- __pItemNeedsLazyDeletion = pItem;
+ __pLazyDeletionItem = pItem;
}
}
void FireListViewItemLongPressedEvent(void);
- void SetItemNeedsLazyDeletion(void);
+ void SetItemNeedsLazyDeletion(_ListViewItem* pItem);
virtual result OnTouchEventListenerAdded(void);
_GroupedListViewItemProviderAdaptor& operator =(const _GroupedListViewItemProviderAdaptor& rhs);
+ void SetItemLazyDeletion(_ListViewItem* pItem);
+
// Variable
private:
IGroupedListViewItemProvider* __pGroupedListViewProvider;
int __countOfAllGroups;
int __countOfAllItems;
_ListViewItem* __pItemNeedsLazyDeletion;
+ _ListViewItem* __pLazyDeletionItem;
bool __usingFloatingPoint;
}; // _GroupedListViewItemProviderAdaptor
Tizen::Graphics::FloatPoint GetCurrentTouchPosition(void);
- void SetItemNeedsLazyDeletion(void);
+ void SetItemNeedsLazyDeletion(_ListViewItem* pItem);
virtual result OnTouchEventListenerAdded(void);
bool __redrawListView;
bool __isOrientationChanged;
bool __needReloadItems;
- _ListViewItem* __pItemNeedsLazyDeletion;
class _ListViewPropagatedTouchEventListener;
_ListViewPropagatedTouchEventListener* __pPropagatedTouchEventListener;
_ListViewItemProviderAdaptor& operator =(const _ListViewItemProviderAdaptor& rhs);
+ void SetItemLazyDeletion(_ListViewItem* pItem);
+
// Variable
private:
IListViewItemProvider* __pListViewProvider;
int __itemLoadedCount;
int __countOfAllItems;
_ListViewItem* __pItemNeedsLazyDeletion;
+ _ListViewItem* __pLazyDeletionItem;
bool __usingFloatingPoint;
}; // _ListViewItemProviderAdaptor