From 3a15d1f3961326722997f0a6a575716786876e00 Mon Sep 17 00:00:00 2001 From: Sudha Date: Fri, 7 Jun 2013 16:57:56 +0530 Subject: [PATCH] Fix for VPSS-963 Change-Id: I0baa9c974866d12bb36047fa19b77a92d925655d Signed-off-by: Sudha --- src/ui/controls/FUiCtrl_Edit.cpp | 4 ++-- src/ui/controls/FUiCtrl_EditPresenter.cpp | 2 +- .../controls/FUiCtrl_ExpandableEditAreaEvent.cpp | 20 ++++++++++---------- src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp | 4 ++-- .../FUiCtrl_PublicExpandableEditAreaEvent.cpp | 22 ++++++++++++---------- src/ui/inc/FUiCtrl_Edit.h | 2 +- src/ui/inc/FUiCtrl_ExpandableEditAreaEvent.h | 3 +-- src/ui/inc/FUiCtrl_PublicExpandableEditAreaEvent.h | 2 +- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/ui/controls/FUiCtrl_Edit.cpp b/src/ui/controls/FUiCtrl_Edit.cpp index 8bb9d1b..568b69b 100644 --- a/src/ui/controls/FUiCtrl_Edit.cpp +++ b/src/ui/controls/FUiCtrl_Edit.cpp @@ -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); diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index 4c3cb26..38267e3 100755 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -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); diff --git a/src/ui/controls/FUiCtrl_ExpandableEditAreaEvent.cpp b/src/ui/controls/FUiCtrl_ExpandableEditAreaEvent.cpp index f4749fe..40082e6 100644 --- a/src/ui/controls/FUiCtrl_ExpandableEditAreaEvent.cpp +++ b/src/ui/controls/FUiCtrl_ExpandableEditAreaEvent.cpp @@ -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; diff --git a/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp b/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp index 890820d..93f8777 100644 --- a/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp +++ b/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp @@ -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)); diff --git a/src/ui/controls/FUiCtrl_PublicExpandableEditAreaEvent.cpp b/src/ui/controls/FUiCtrl_PublicExpandableEditAreaEvent.cpp index 43289ce..c411e6f 100644 --- a/src/ui/controls/FUiCtrl_PublicExpandableEditAreaEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicExpandableEditAreaEvent.cpp @@ -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 (const_cast (__pSource)), 0); + pExpandableEditAreaEventListener->OnExpandableEditAreaLineAdded(*dynamic_cast (const_cast (__pSource)), + pArg->GetNewLineCount()); } else if (status == EXPANDABLE_EDITAREA_EVENT_REMOVED) { - pExpandableEditAreaEventListener->OnExpandableEditAreaLineRemoved(*dynamic_cast (const_cast (__pSource)), 0); + pExpandableEditAreaEventListener->OnExpandableEditAreaLineRemoved(*dynamic_cast (const_cast (__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; diff --git a/src/ui/inc/FUiCtrl_Edit.h b/src/ui/inc/FUiCtrl_Edit.h index 178b783..7fcfca6 100644 --- a/src/ui/inc/FUiCtrl_Edit.h +++ b/src/ui/inc/FUiCtrl_Edit.h @@ -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); diff --git a/src/ui/inc/FUiCtrl_ExpandableEditAreaEvent.h b/src/ui/inc/FUiCtrl_ExpandableEditAreaEvent.h index 94e2828..820a625 100644 --- a/src/ui/inc/FUiCtrl_ExpandableEditAreaEvent.h +++ b/src/ui/inc/FUiCtrl_ExpandableEditAreaEvent.h @@ -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: diff --git a/src/ui/inc/FUiCtrl_PublicExpandableEditAreaEvent.h b/src/ui/inc/FUiCtrl_PublicExpandableEditAreaEvent.h index e83bbdb..f779fd4 100644 --- a/src/ui/inc/FUiCtrl_PublicExpandableEditAreaEvent.h +++ b/src/ui/inc/FUiCtrl_PublicExpandableEditAreaEvent.h @@ -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: -- 2.7.4