Revert "remove APIs to apply [ACR][03/30][Remove] Remove APIs in Tizen::Ui namespace"
authorSeungwanWoo <s-w.woo@samsung.com>
Wed, 20 Mar 2013 12:52:20 +0000 (21:52 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 20 Mar 2013 12:52:20 +0000 (21:52 +0900)
This reverts commit 061522eada653d92f953c0a4102ba5c9e61832ee

19 files changed:
inc/FUiCtrlCustomListItem.h
inc/FUiCtrlGroupedList.h
inc/FUiCtrlListItemBase.h
inc/FUiCtrlSlidableGroupedList.h
inc/FUiIFastScrollEventListener.h
src/ui/controls/FUiCtrlCustomListItem.cpp
src/ui/controls/FUiCtrlGroupedList.cpp
src/ui/controls/FUiCtrlListItemBase.cpp
src/ui/controls/FUiCtrlSlidableGroupedList.cpp
src/ui/controls/FUiCtrl_CustomListItemImpl.cpp
src/ui/controls/FUiCtrl_GroupedListImpl.cpp
src/ui/controls/FUiCtrl_ListItemBaseImpl.cpp
src/ui/controls/FUiCtrl_ListViewItem.cpp
src/ui/controls/FUiCtrl_SlidableGroupedListImpl.cpp
src/ui/inc/FUiCtrl_CustomListItemImpl.h
src/ui/inc/FUiCtrl_GroupedListImpl.h
src/ui/inc/FUiCtrl_ListItemBaseImpl.h
src/ui/inc/FUiCtrl_ListViewItem.h
src/ui/inc/FUiCtrl_SlidableGroupedListImpl.h

index 85d188b..b44408d 100644 (file)
@@ -262,6 +262,23 @@ public:
 
        /**
         * @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>
index b268a32..a7c5c53 100644 (file)
@@ -960,6 +960,24 @@ public:
 
        /**
         * @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>
index e4e554b..ade9aa9 100644 (file)
@@ -143,6 +143,45 @@ public:
        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
index c1b8122..e0b69ec 100644 (file)
@@ -806,6 +806,27 @@ public:
         */
        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.
index 54d94fd..442dad1 100755 (executable)
@@ -84,6 +84,21 @@ public:
 
        /**
          * @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>
@@ -96,6 +111,21 @@ public:
         */
        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) {}
index 1888df0..343c1d1 100644 (file)
@@ -154,6 +154,17 @@ CustomListItem::SetCheckBox(int elementId)
        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
 {
index e198a56..131b79f 100644 (file)
@@ -598,6 +598,18 @@ GroupedList::SetFastScrollMainIndex(const String& text)
 }
 
 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);
index abe3dff..d1bb77a 100644 (file)
@@ -116,6 +116,28 @@ ListItemBase::SetDescriptionTextColor(const Color& color)
        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)
 {
index 5ea2a64..4602ace 100644 (file)
@@ -356,6 +356,16 @@ SlidableGroupedList::SetFastScrollMainIndex(const String& text)
        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)
 {
index 2e9bc5f..8e1195d 100644 (file)
@@ -523,6 +523,13 @@ _CustomListItemImpl::UpdateBitmaps(void)
        return;
 }
 
+result
+_CustomListItemImpl::SetValue(int value)
+{
+       __percentValue = value;
+       return E_SUCCESS;
+}
+
 _CheckElementModel*
 _CustomListItemImpl::GetCheckElement(void)
 {
index c94bba6..7bd29ff 100644 (file)
@@ -1347,6 +1347,17 @@ _GroupedListImpl::OnUiFastScrollIndexSelected(_Control& source, _FastScrollIndex
                        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;
@@ -1373,6 +1384,41 @@ _GroupedListImpl::SetFastScrollMainIndex(const String& text)
        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
 {
index 1979509..fc78d46 100644 (file)
@@ -125,6 +125,7 @@ _ListItemBaseImpl::Construct(const FloatDimension& itemSize, ListAnnexStyle styl
        __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;
@@ -271,6 +272,30 @@ _ListItemBaseImpl::SetDescriptionTextColor(const Color& color)
        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)
 {
index 80e32eb..6ebcab5 100644 (file)
@@ -784,6 +784,53 @@ _ListViewItem::GetTextColor(int elementId, Color& textColor, ListViewItemDrawing
        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)
 {
index 1cd814a..f76ac2b 100644 (file)
@@ -784,6 +784,47 @@ _SlidableGroupedListImpl::SetFastScrollMainIndex(const String& text)
        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
 {
@@ -2109,6 +2150,26 @@ _SlidableGroupedListImpl::OnUiFastScrollIndexSelected(_Control& source, _FastScr
                                __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);
 }
index b8bf957..238c0da 100644 (file)
@@ -128,6 +128,7 @@ public:
        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);
index fed6428..c8dddaa 100644 (file)
@@ -141,6 +141,8 @@ public:
        //@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);
index 1b8b001..d41ea34 100644 (file)
@@ -74,6 +74,10 @@ public:
 
        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);
index b1dec6e..8f3e1ed 100644 (file)
@@ -182,6 +182,10 @@ public:
 
        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);
index 0064a6f..dee2f14 100644 (file)
@@ -141,6 +141,8 @@ public:
        //@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;