/**
* @if OSPDEPREC
+ * Sets the percent value of %CustomListItem.
+ *
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated. Instead of using this class, use CustomItem class
+ * @since 2.0
+ *
+ * @return An error code
+ * @param[in] value The percent value of %CustomListItem @n
+ * The valid range of integers is from @c 0 to @c 100
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ * @endif
+ */
+ result SetValue(int value);
+
+ /**
+ * @if OSPDEPREC
* Gets the percentage value of %CustomListItem.
*
* @brief <i> [Deprecated] </i>
/**
* @if OSPDEPREC
+ * Sets the second index list of scroll by text.
+ *
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated. Instead of using this class, use GroupedListView class.
+ * @since 2.0
+ *
+ * @return An error code
+ * @param[in] text The text of the second index @n
+ * Separate each second index of the first index by ',';.
+ * @param[in] indexDigit The index digit count
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ * @endif
+ */
+ result SetFastScrollSubIndex(const Tizen::Base::String& text, FastScrollIndexDigit indexDigit = SCROLL_INDEX_DIGIT_NUM_1);
+
+ /**
+ * @if OSPDEPREC
* Adds the fast scroll event listener.
*
* @brief <i> [Deprecated] </i>
result SetDescriptionTextColor(const Tizen::Graphics::Color& color);
/**
+ * Sets the progress value of a list item.
+ *
+ * @since 2.0
+ *
+ * @return An error code
+ * @param[in] value The progress value of the list item @n
+ * The valid values are integers from @c 0 to @c 100.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result SetProgressValue(int value);
+
+ /**
+ * Sets the margin of the progress bar.
+ *
+ * @since 2.0
+ *
+ * @return An error code
+ * @param[in] leftMargin The left margin of the progress bar
+ * @param[in] rightMargin The right margin of the progress bar
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result SetProgressMargins(int leftMargin, int rightMargin);
+
+ /**
+ * Sets the margin of the progress bar.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] leftMargin The left margin of the progress bar
+ * @param[in] rightMargin The right margin of the progress bar
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result SetProgressMargins(float leftMargin, float rightMargin);
+
+ /**
* Gets the width of the annex area.
*
* @since 2.0
*/
result SetFastScrollMainIndex(const Tizen::Base::String& text);
+
+ /**
+ * @if OSPDEPREC
+ * Sets the second index list of the scroll by text.
+ *
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated. Instead of using this class, use the %GroupedListView class.
+ * @since 2.0
+ *
+ * @return An error code
+ * @param[in] text The text of the second index @n
+ * Each second index of the first index has to be separated by ','
+ * @param[in] indexDigit The index digit count
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ * @remarks The sub-index of fast scroll does not support SCROLL_INDEX_DIGIT_NUM_2. Therefore, when SCROLL_INDEX_DIGIT_NUM_2 is passed to
+ * @c indexDigit, this method returns E_SYSTEM.
+ * @endif
+ */
+ result SetFastScrollSubIndex(const Tizen::Base::String& text, FastScrollIndexDigit indexDigit = SCROLL_INDEX_DIGIT_NUM_1);
+
/**
* @if OSPDEPREC
* Sets the background color of this control.
/**
* @if OSPDEPREC
+ * Called when a sub index is selected.
+ *
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated. Instead of using this class, use the IFastScrollListener class.
+ * @since 2.0
+ *
+ * @param[in] source The source of the event
+ * @param[in] mainIndex The main index
+ * @param[in] subIndex The sub index
+ * @endif
+ */
+ virtual void OnSubIndexChanged(const Tizen::Ui::Control& source, Tizen::Base::Character& mainIndex, Tizen::Base::Character& subIndex) = 0;
+
+ /**
+ * @if OSPDEPREC
* Called when a main index is expanded.
*
* @brief <i> [Deprecated] </i>
*/
virtual void OnMainIndexSelected(const Tizen::Ui::Control& source, Tizen::Base::Character& mainIndex) = 0;
+ /**
+ * @if OSPDEPREC
+ * Called when a sub index is expanded.
+ *
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated. Instead of using this class, use the IFastScrollListener class.
+ * @since 2.0
+ *
+ * @param[in] source The source of the event
+ * @param[in] mainIndex The main index
+ * @param[in] subIndex The sub index
+ * @endif
+ */
+ virtual void OnSubIndexSelected(const Tizen::Ui::Control& source, Tizen::Base::Character& mainIndex, Tizen::Base::Character& subIndex) = 0;
+
protected:
virtual void IFastScrollEventListener_Reserved1(void) {}
return E_SUCCESS;
}
+result
+CustomListItem::SetValue(int value)
+{
+ SysAssertf((__pCustomListItemImpl != null), "Not yet constructed. Construct() should be called before use.");
+
+ result r = __pCustomListItemImpl->SetValue(value);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Failed to set the value.");
+
+ return r;
+}
+
int
CustomListItem::GetValue(void) const
{
}
result
+GroupedList::SetFastScrollSubIndex(const String& text, FastScrollIndexDigit indexDigit)
+{
+ _GroupedListImpl* pImpl = _GroupedListImpl::GetInstance(*this);
+ SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = pImpl->SetFastScrollSubIndex(text, indexDigit);
+ SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return r;
+}
+
+result
GroupedList::RefreshItem(int groupIndex, int itemIndex)
{
_GroupedListImpl* pImpl = _GroupedListImpl::GetInstance(*this);
return _pImpl->SetDescriptionTextColor(color);
}
+result
+ListItemBase::SetProgressValue(int value)
+{
+ SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return _pImpl->SetProgressValue(value);
+}
+
+result
+ListItemBase::SetProgressMargins(int leftMargin, int rightMargin)
+{
+ return SetProgressMargins(_CoordinateSystemUtils::ConvertToFloat(leftMargin), _CoordinateSystemUtils::ConvertToFloat(rightMargin));
+}
+
+result
+ListItemBase::SetProgressMargins(float leftMargin, float rightMargin)
+{
+ SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return _pImpl->SetProgressMargins(leftMargin, rightMargin);
+}
+
int
ListItemBase::GetAnnexWidth(ListAnnexStyle style)
{
return pImpl->SetFastScrollMainIndex(text);
}
+result
+SlidableGroupedList::SetFastScrollSubIndex(const String& text, FastScrollIndexDigit indexDigit)
+{
+ _SlidableGroupedListImpl* pImpl = _SlidableGroupedListImpl::GetInstance(*this);
+
+ SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pImpl->SetFastScrollSubIndex(text, indexDigit);
+}
+
void
SlidableGroupedList::SetBackgroundColor(const Color& color)
{
return;
}
+result
+_CustomListItemImpl::SetValue(int value)
+{
+ __percentValue = value;
+ return E_SUCCESS;
+}
+
_CheckElementModel*
_CustomListItemImpl::GetCheckElement(void)
{
Character mainIndex(mch);
pFastScrollListener->OnMainIndexChanged(control, mainIndex);
}
+ else
+ {
+ Character subIndex(mch);
+ pIndexText = __pMainIndex->GetIndexText();
+ if (pIndexText != null)
+ {
+ pIndexText->GetCharAt(0, mch);
+ Character mainIndex(mch);
+ pFastScrollListener->OnSubIndexChanged(control, mainIndex, subIndex);
+ }
+ }
}
SetLastResult(E_SUCCESS);
return;
return E_SUCCESS;
}
+result
+_GroupedListImpl::SetFastScrollSubIndex(const String& text, FastScrollIndexDigit indexDigit)
+{
+ SysTryReturn(NID_UI_CTRL, (text.GetLength() > 0), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Empty string");
+
+ SysTryReturn(NID_UI_CTRL, (indexDigit == SCROLL_INDEX_DIGIT_NUM_1), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. indexDigit is not SCROLL_INDEX_DIGIT_NUM_1");
+
+ _FastScroll* pFastScroll = GetCore().GetFastScrollBar();
+ SysTryReturn(NID_UI_CTRL, pFastScroll, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. FastScroll doesn't exist.");
+
+ SysTryReturn(NID_UI_CTRL, (__mainIndexText.GetLength() > 0), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Main index of the fast scroll isn't set");
+
+ _FastScrollIndex* pRootIndex = pFastScroll->GetIndex();
+ SysTryReturn(NID_UI_CTRL, pRootIndex, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. RootIndex doesn't exist.");
+
+ int subIndexDigit = 1 ;
+ String delim(L",");
+ StringTokenizer strTok(text, delim);
+ String token;
+ int i = 0;
+
+ while (strTok.HasMoreTokens())
+ {
+ strTok.GetNextToken(token);
+ _FastScrollIndex* pSecondaryIndex = pRootIndex->GetChildIndex(i++);
+ if (pSecondaryIndex != null)
+ {
+ pSecondaryIndex->AddChildTextIndexArray(0, token.GetPointer(), subIndexDigit, token.GetLength());
+ }
+ }
+ pFastScroll->UpdateIndex();
+
+ return E_SUCCESS;
+}
+
class _GroupedListMaker
: public _UiBuilderControlMaker
{
__pListViewItem->SetSize(itemSize);
__pListViewItem->SetBounds(FloatRectangle(0.0f, 0.0f, itemSize.width, itemSize.height));
__pListViewItem->SetBackgroundColor(Color(0, 0, 0, 0));
+ __pListViewItem->SetProgressValue(-1);
__pListViewItem->SetSelectionStyle(TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE);
__itemSize = itemSize;
return E_SUCCESS;
}
+result
+_ListItemBaseImpl::SetProgressValue(int value)
+{
+ SysTryReturn(NID_UI_CTRL, (__pListViewItem->SetProgressValue(value) == true), E_SYSTEM, E_SYSTEM,
+ ("[E_SYSTEM] Unable to set progress value."));
+
+ return E_SUCCESS;
+}
+
+result
+_ListItemBaseImpl::SetProgressMargins(float leftMargin, float rightMargin)
+{
+ SysTryReturn(NID_UI_CTRL, (leftMargin >= 0.0f) && (rightMargin >= 0.0f), E_INVALID_ARG, E_INVALID_ARG,
+ ("[E_INVALID_ARG] It is invalid argument."));
+
+ SysTryReturn(NID_UI_CTRL, (leftMargin < (__itemSize.width - rightMargin)), E_INVALID_ARG, E_INVALID_ARG,
+ ("[E_INVALID_ARG] It is invalid argument."));
+
+ SysTryReturn(NID_UI_CTRL, (__pListViewItem->SetProgressMargins(leftMargin, rightMargin) == true), E_SYSTEM, E_SYSTEM,
+ ("[E_SYSTEM] Unable to set progress bar margin."));
+
+ return E_SUCCESS;
+}
+
float
_ListItemBaseImpl::GetAnnexWidth(ListAnnexStyle style)
{
return true;
}
+bool
+_ListViewItem::SetProgressValue(int value)
+{
+ if ((value < 0) || (value > 100))
+ {
+ if (__pProgress != null)
+ {
+ __pProgress->SetVisibleState(false);
+ }
+
+ return false;
+ }
+
+ if (__pProgress == null)
+ {
+ __pProgress = _Progress::CreateProgressN();
+ SysTryReturn(NID_UI_CTRL, (__pProgress != null), false, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pProgress->SetRange(0, 100);
+
+ AttachChild(*__pProgress);
+
+ AdjustProgressBounds();
+ }
+
+ __pProgress->SetValue(value);
+ __pProgress->SetVisibleState(true);
+
+ return true;
+}
+
+bool
+_ListViewItem::SetProgressMargins(float leftMargin, float rightMargin)
+{
+ if ((leftMargin < 0.0f) || (rightMargin < 0.0f) || (GetBoundsF().width - leftMargin - rightMargin <= 0.0f))
+ {
+ return false;
+ }
+
+ __progressLeftMargin = leftMargin;
+ __progressRightMargin = rightMargin;
+
+ AdjustProgressBounds();
+
+ return true;
+}
+
void
_ListViewItem::AdjustProgressBounds(void)
{
return E_SUCCESS;
}
+
+result
+_SlidableGroupedListImpl::SetFastScrollSubIndex(const String& text, FastScrollIndexDigit indexDigit)
+{
+ SysTryReturn(NID_UI_CTRL, (text.GetLength() > 0), E_SYSTEM, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. Text is empty.");
+
+ SysTryReturn(NID_UI_CTRL, (indexDigit == SCROLL_INDEX_DIGIT_NUM_1), E_SYSTEM, E_INVALID_ARG,
+ "[E_INVALID_ARG] Invalid argument is used. indexDigit is not SCROLL_INDEX_DIGIT_NUM_1.");
+
+ _FastScroll* pFastScroll = GetCore().GetFastScrollBar();
+ SysTryReturn(NID_UI_CTRL, pFastScroll, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get FastScroll Object.");
+
+ SysTryReturn(NID_UI_CTRL, (__mainScrollIndex.GetLength() > 0), E_SYSTEM, E_SYSTEM,
+ "[E_SYSTEM] A system error has occurred. Main index of the fast scroll is not set.");
+
+ __subScrollIndex = text;
+
+ _FastScrollIndex* pRootIndex = pFastScroll->GetIndex();
+ SysTryReturn(NID_UI_CTRL, pRootIndex, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get rootIndex.");
+
+ int subIndexDigit = 1;
+ String delim(L",");
+ StringTokenizer strTok(text, delim);
+ String token;
+ int i = 0;
+
+ while (strTok.HasMoreTokens())
+ {
+ strTok.GetNextToken(token);
+ _FastScrollIndex* pSecondaryIndex = pRootIndex->GetChildIndex(i++);
+ if (pSecondaryIndex != null)
+ {
+ pSecondaryIndex->AddChildTextIndexArray(0, token.GetPointer(), subIndexDigit, token.GetLength());
+ }
+ }
+
+ pFastScroll->UpdateIndex();
+ return E_SUCCESS;
+}
+
+
result
_SlidableGroupedListImpl::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const
{
__pFastScrollListener->OnMainIndexChanged(control, mainIndex);
}
}
+ else
+ {
+ // __subScrollIndex
+ int itemIndex = 0;
+ result r = __subScrollIndex.IndexOf(*pIndexText, 0, itemIndex);
+ const Control& control = GetPublic();
+ _FastScrollIndex* pMainIndex = index.GetParentIndex();
+
+ if (!IsFailed(r))
+ {
+ Character subIndex(mch);
+ pIndexText = pMainIndex->GetIndexText();
+ if (pIndexText != null)
+ {
+ pIndexText->GetCharAt(0, mch);
+ Character mainIndex(mch);
+ __pFastScrollListener->OnSubIndexChanged(control, mainIndex, subIndex);
+ }
+ }
+ }
}
SetLastResult(E_SUCCESS);
}
void SetNormalItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
void SetHighlightedItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
void UpdateBitmaps(void);
+ result SetValue(int value);
_CheckElementModel* GetCheckElement(void);
result SetTextSliding(int elementId, bool enable);
//@See doxygen
result SetFastScrollMainIndex(const Tizen::Base::String& text);
//@See doxygen
+ result SetFastScrollSubIndex(const Tizen::Base::String& text, FastScrollIndexDigit indexDigit);
+ //@See doxygen
void ScrollToBottom(void);
//@See doxygen
void ScrollToTop(void);
result SetDescriptionTextColor(const Tizen::Graphics::Color& color);
+ result SetProgressValue(int value);
+
+ result SetProgressMargins(float leftMargin, float rightMargin);
+
static float GetAnnexWidth(ListAnnexStyle style);
ListAnnexStyle GetListItemAnnexStyle(void);
bool GetTextColor(int elementId, Tizen::Graphics::Color& textColor, ListViewItemDrawingStatus status = LISTVIEW_ITEM_STATUS_NORMAL) const;
+ bool SetProgressValue(int value);
+
+ bool SetProgressMargins(float leftMargin, float rightMargin);
+
bool SetDescriptionText(const Tizen::Base::String& text);
void SetDescriptionTextColor(const Tizen::Graphics::Color& color);
//@See doxygen
result SetFastScrollMainIndex(const Tizen::Base::String& text);
//@See doxygen
+ result SetFastScrollSubIndex(const Tizen::Base::String& text, FastScrollIndexDigit indexDigit);
+ //@See doxygen
result GetItemIndexFromPosition(int x, int y, int& groupIndex, int& itemIndex) const;
//@See doxygen
result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const;