Fix for VPSS-963
authorSudha <sudha.reddy@samsung.com>
Fri, 7 Jun 2013 11:27:56 +0000 (16:57 +0530)
committerSudha <sudha.reddy@samsung.com>
Fri, 7 Jun 2013 12:04:55 +0000 (17:34 +0530)
Change-Id: I0baa9c974866d12bb36047fa19b77a92d925655d
Signed-off-by: Sudha <sudha.reddy@samsung.com>
src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_ExpandableEditAreaEvent.cpp
src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp
src/ui/controls/FUiCtrl_PublicExpandableEditAreaEvent.cpp
src/ui/inc/FUiCtrl_Edit.h
src/ui/inc/FUiCtrl_ExpandableEditAreaEvent.h
src/ui/inc/FUiCtrl_PublicExpandableEditAreaEvent.h

index 8bb9d1b..568b69b 100644 (file)
@@ -2616,11 +2616,11 @@ _Edit::GetClipboardHeight(void) const
 }
 
 result
-_Edit::SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int selectedTokenIndex)
+_Edit::SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int newLineCount)
 {
        if (__pExpandableEditAreaEvent)
        {
-               IEventArg* pEventArg = _ExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(status, selectedTokenIndex);
+               IEventArg* pEventArg = _ExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(status, newLineCount);
                SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
 
                __pExpandableEditAreaEvent->Fire(*pEventArg);
index 4c3cb26..38267e3 100755 (executable)
@@ -9135,7 +9135,7 @@ _EditPresenter::SetFlexBounds(const FloatRectangle& bounds)
        __pEdit->Invalidate();
 
        __prevTotalTextHeight = __pTextObject->GetTotalHeightF();
-       __pEdit->SendExpandableEditAreaEvent(expandableEditAreaStatus);
+       __pEdit->SendExpandableEditAreaEvent(expandableEditAreaStatus, __pTextObject->GetTotalLineCount());
 
        pVisualElement->SetImplicitAnimationEnabled(false);
 
index f4749fe..40082e6 100644 (file)
@@ -74,7 +74,7 @@ public:
        */
        _ExpandableEditAreaEventStatus GetStatus(void) const;
 
-       int GetSelectedTokenIndex(void) const;
+       int GetNewLineCount(void) const;
 
 
 // Attribute
@@ -84,12 +84,12 @@ private:
        */
        _ExpandableEditAreaEventStatus __status;
 
-       int __selecteTokenIndex;
+       int __newLineCount;
 };     // _CoreExpandableEditAreaEventArg
 
-_CoreExpandableEditAreaEventArg::_CoreExpandableEditAreaEventArg(_ExpandableEditAreaEventStatus status, int selectedTokenIndex)
+_CoreExpandableEditAreaEventArg::_CoreExpandableEditAreaEventArg(_ExpandableEditAreaEventStatus status, int newLineCount)
        : __status(status)
-       , __selecteTokenIndex(selectedTokenIndex)
+       , __newLineCount(newLineCount)
 {
        // nothing
 }
@@ -109,9 +109,9 @@ _CoreExpandableEditAreaEventArg::GetStatus(void) const
 }
 
 int
-_CoreExpandableEditAreaEventArg::GetSelectedTokenIndex(void) const
+_CoreExpandableEditAreaEventArg::GetNewLineCount(void) const
 {
-       return __selecteTokenIndex;
+       return __newLineCount;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -180,11 +180,11 @@ _ExpandableEditAreaEvent::FireImpl(IEventListener& listener, const IEventArg& ar
        _ExpandableEditAreaEventStatus status = pArg->GetStatus();
        if (status == _EXPANDABLE_EDITAREA_EVENT_ADDED)
        {
-               pExpandableEditAreaEventListener->OnExpandableEditAreaLineAdded(*__pSource, 0);
+               pExpandableEditAreaEventListener->OnExpandableEditAreaLineAdded(*__pSource, pArg->GetNewLineCount());
        }
        else if (status == _EXPANDABLE_EDITAREA_EVENT_REMOVED)
        {
-               pExpandableEditAreaEventListener->OnExpandableEditAreaLineRemoved(*__pSource, 0);
+               pExpandableEditAreaEventListener->OnExpandableEditAreaLineRemoved(*__pSource, pArg->GetNewLineCount());
        }
 
        SetLastResult(E_SUCCESS);
@@ -193,9 +193,9 @@ _ExpandableEditAreaEvent::FireImpl(IEventListener& listener, const IEventArg& ar
 }
 
 IEventArg*
-_ExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(_ExpandableEditAreaEventStatus status, int selectedTokenIndex)
+_ExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(_ExpandableEditAreaEventStatus status, int newLineCount)
 {
-       _CoreExpandableEditAreaEventArg* pEventArg = new (std::nothrow) _CoreExpandableEditAreaEventArg(status, selectedTokenIndex);
+       _CoreExpandableEditAreaEventArg* pEventArg = new (std::nothrow) _CoreExpandableEditAreaEventArg(status, newLineCount);
        SysTryReturn(NID_UI_CTRL, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
 
        return pEventArg;
index 890820d..93f8777 100644 (file)
@@ -1429,7 +1429,7 @@ _ExpandableEditAreaImpl::OnExpandableEditAreaLineAdded(const _Control& source, i
        if (__pPublicExpandableEditAreaEvent)
        {
                IEventArg* pEventArg = _PublicExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(
-                       EXPANDABLE_EDITAREA_EVENT_ADDED);
+                               EXPANDABLE_EDITAREA_EVENT_ADDED, newLineCount);
                result r = GetLastResult();
                SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1443,7 +1443,7 @@ _ExpandableEditAreaImpl::OnExpandableEditAreaLineRemoved(const _Control& source,
        if (__pPublicExpandableEditAreaEvent)
        {
                IEventArg* pEventArg = _PublicExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(
-                       EXPANDABLE_EDITAREA_EVENT_REMOVED);
+                               EXPANDABLE_EDITAREA_EVENT_REMOVED, newLineCount);
                result r = GetLastResult();
                SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, r, "[%s] Propagating.", GetErrorMessage(r));
 
index 43289ce..c411e6f 100644 (file)
@@ -74,7 +74,7 @@ public:
        */
        ExpandableEditAreaEventStatus GetStatus(void) const;
 
-       int GetSelectedTokenIndex(void) const;
+       int GetNewLineCount(void) const;
 
 
 // Attribute
@@ -84,12 +84,12 @@ private:
        */
        ExpandableEditAreaEventStatus __status;
 
-       int __selecteTokenIndex;
+       int __newLineCount;
 };     // _PublicExpandableEditAreaEventArg
 
-_PublicExpandableEditAreaEventArg::_PublicExpandableEditAreaEventArg(ExpandableEditAreaEventStatus status, int selectedTokenIndex)
+_PublicExpandableEditAreaEventArg::_PublicExpandableEditAreaEventArg(ExpandableEditAreaEventStatus status, int newLineCount)
        : __status(status)
-       , __selecteTokenIndex(selectedTokenIndex)
+       , __newLineCount(newLineCount)
 {
        // nothing
 }
@@ -108,9 +108,9 @@ _PublicExpandableEditAreaEventArg::GetStatus(void) const
 }
 
 int
-_PublicExpandableEditAreaEventArg::GetSelectedTokenIndex(void) const
+_PublicExpandableEditAreaEventArg::GetNewLineCount(void) const
 {
-       return __selecteTokenIndex;
+       return __newLineCount;
 }
 
 
@@ -180,11 +180,13 @@ _PublicExpandableEditAreaEvent::FireImpl(Tizen::Base::Runtime::IEventListener& l
        ExpandableEditAreaEventStatus status = pArg->GetStatus();
        if (status == EXPANDABLE_EDITAREA_EVENT_ADDED)
        {
-               pExpandableEditAreaEventListener->OnExpandableEditAreaLineAdded(*dynamic_cast <ExpandableEditArea*>(const_cast <Control*>(__pSource)), 0);
+               pExpandableEditAreaEventListener->OnExpandableEditAreaLineAdded(*dynamic_cast <ExpandableEditArea*>(const_cast <Control*>(__pSource)),
+                               pArg->GetNewLineCount());
        }
        else if (status == EXPANDABLE_EDITAREA_EVENT_REMOVED)
        {
-               pExpandableEditAreaEventListener->OnExpandableEditAreaLineRemoved(*dynamic_cast <ExpandableEditArea*>(const_cast <Control*>(__pSource)), 0);
+               pExpandableEditAreaEventListener->OnExpandableEditAreaLineRemoved(*dynamic_cast <ExpandableEditArea*>(const_cast <Control*>(__pSource)),
+                               pArg->GetNewLineCount());
        }
        SetLastResult(E_SUCCESS);
 
@@ -192,9 +194,9 @@ _PublicExpandableEditAreaEvent::FireImpl(Tizen::Base::Runtime::IEventListener& l
 }
 
 IEventArg*
-_PublicExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(ExpandableEditAreaEventStatus status, int index)
+_PublicExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(ExpandableEditAreaEventStatus status, int newLineCount)
 {
-       _PublicExpandableEditAreaEventArg* pEventArg = new (std::nothrow) _PublicExpandableEditAreaEventArg(status, index);
+       _PublicExpandableEditAreaEventArg* pEventArg = new (std::nothrow) _PublicExpandableEditAreaEventArg(status, newLineCount);
        SysTryReturn(NID_UI_CTRL, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
 
        return pEventArg;
index 178b783..7fcfca6 100644 (file)
@@ -454,7 +454,7 @@ public:
        result AttachScrollPanelEvent(void);
        result DetachScrollPanelEvent(void);
 
-       result SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int selectedTokenIndex = -1);
+       result SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int newLineCount = 0);
        result SendKeypadEvent(CoreKeypadAction keypadAction, CoreKeypadEventStatus eventstatus);
        result SendLanguageEvent(Tizen::Locales::LanguageCode prevLanguageCode, Tizen::Locales::LanguageCode currentLanguageCode);
        result SendLinkEvent(const Tizen::Base::String& text, Tizen::Base::Utility::LinkType linkType, const Tizen::Base::String& link);
index 94e2828..820a625 100644 (file)
@@ -39,7 +39,6 @@ enum _ExpandableEditAreaEventStatus
 {
        _EXPANDABLE_EDITAREA_EVENT_ADDED = 0,
        _EXPANDABLE_EDITAREA_EVENT_REMOVED
-//     _EXPANDABLE_EDITAREA_EVENT_TOKEN_SELECTED
 };
 
 /**
@@ -71,7 +70,7 @@ public:
         */
        const Tizen::Ui::_Control* GetSource(void) const;
 
-       static Tizen::Base::Runtime::IEventArg* CreateExpandableEditAreaEventArgN(_ExpandableEditAreaEventStatus status, int selectedTokenIndex);
+    static Tizen::Base::Runtime::IEventArg* CreateExpandableEditAreaEventArgN(_ExpandableEditAreaEventStatus status, int newLineCount);
 
 // Operations
 protected:
index e83bbdb..f779fd4 100644 (file)
@@ -105,7 +105,7 @@ protected:
        virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
 
 public:
-       static Tizen::Base::Runtime::IEventArg* CreateExpandableEditAreaEventArgN(ExpandableEditAreaEventStatus status, int index = -1);
+       static Tizen::Base::Runtime::IEventArg* CreateExpandableEditAreaEventArgN(ExpandableEditAreaEventStatus status, int newLineCount = 0);
 
 //Attributess
 private: