Merge "Modified #ifndef in FWebCtrlIWebUIEventListnerF.h" into tizen_2.1
authorSeongjun Yim <se201.yim@samsung.com>
Thu, 11 Apr 2013 09:09:19 +0000 (18:09 +0900)
committerGerrit Code Review <gerrit2@kim11>
Thu, 11 Apr 2013 09:09:19 +0000 (18:09 +0900)
17 files changed:
inc/FWebBookmarkItem.h
inc/FWebCtrlWeb.h
inc/FWebCtrlWebSetting.h
src/FWeb_WebBookmarkImpl.cpp
src/controls/FWebCtrlWeb.cpp
src/controls/FWebCtrlWebStorageManager.cpp
src/controls/FWebCtrl_AppControlListener.cpp
src/controls/FWebCtrl_EflWebkit.cpp
src/controls/FWebCtrl_GestureState.cpp
src/controls/FWebCtrl_SelectBox.cpp
src/controls/FWebCtrl_UserConfirmPopup.cpp
src/controls/FWebCtrl_Web.cpp
src/controls/FWebCtrl_Web.h
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_WebImpl.h
src/controls/FWebCtrl_WebMaker.cpp
src/controls/FWebCtrl_WebStorageManagerImpl.cpp

index 06e05e5..0295eec 100755 (executable)
@@ -75,7 +75,7 @@ public:
         *
         * @since               2.1
         *
-        * @param[in] setting An instance of %BookmarkItem
+        * @param[in] rhs An instance of %BookmarkItem
         */
        BookmarkItem(const BookmarkItem& rhs);
 
@@ -160,14 +160,14 @@ public:
         * @param[in]   obj                             The object to compare with the current instance
         * @see Tizen::Base::Object::Equals()
         */
-       virtual bool Equals(const Object& obj) const;
+       virtual bool Equals(const Tizen::Base::Object& obj) const;
 
        /**
         * Copying of objects using this copy assignment operator is allowed. 
         *
         * @since               2.1
         *
-        * @param[in]   setting                 The instance of the %BookmarkItem class to assign from
+        * @param[in]   rhs                     The instance of the %BookmarkItem class to assign from
         */
        BookmarkItem& operator =(const BookmarkItem& rhs);
 
index f0028c5..b3cfb5c 100755 (executable)
@@ -597,6 +597,7 @@ public:
         * @param[in]   enable                  Set to @c true to enable the scrolling of the web page, @n
         *                                                                      else @c false
         * @exception   E_SUCCESS                       The method is successful.
+        * @remarks             This method doesn't affect javascript touch event.
         */
        result SetScrollEnabled(bool enable);
 
@@ -720,7 +721,7 @@ public:
         *
         * @since               2.1
         *
-        * @privleve    public
+        * @privlevel   public
         * @privilege   %http://tizen.org/privilege/web.service
         *
         * @return              An error code
@@ -799,7 +800,7 @@ public:
 
        /**
         * Registers a keypad event listener. @n
-        * The registered listener is notified when the keypad associated with @c <input> tag or with @c <textarea> tag is opened or closed.
+        * The registered listener is notified when the keypad associated with <input> tag or with <textarea> tag is opened or closed.
         *
         * @since               2.0
         *
index ae3531c..719bedf 100755 (executable)
@@ -382,7 +382,7 @@ public:
         * @remarks             This method returns @c true if and only if the two instances contain the same elements.
         * @see                 Tizen::Base::Object::Equals()
         */
-       virtual bool Equals(const Object& obj) const;
+       virtual bool Equals(const Tizen::Base::Object& obj) const;
 
        /**
         * Copying of objects using this copy assignment operator is allowed. 
index 86ddead..2b7632e 100755 (executable)
@@ -99,8 +99,6 @@ CATCH:
 result
 _WebBookmarkImpl::AddFolder(const String& title, RecordId parentId, RecordId& folderId)
 {
-       result r = E_SUCCESS;
-
        std::unique_ptr<char[]> pTitle(_StringConverter::CopyToCharArrayN(title));
        SysTryReturn(NID_WEB, pTitle.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
index 1c0ebd2..a609f08 100755 (executable)
@@ -506,8 +506,6 @@ Web::ReleaseBlock(void)
        _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
        SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
 
-       result r = E_SUCCESS;
-
        pWebImpl->ReleaseBlock();
 
        return E_SUCCESS;
@@ -520,8 +518,6 @@ Web::GetBlockRange(Point& startPoint, Point& endPoint) const
        const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
        SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
 
-       result r = E_SUCCESS;
-
        pWebImpl->GetBlockRange(startPoint, endPoint);
 
        return E_SUCCESS;
@@ -534,8 +530,6 @@ Web::GetBlockRange(FloatPoint& startPoint, FloatPoint& endPoint) const
        const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
        SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
 
-       result r = E_SUCCESS;
-
        pWebImpl->GetBlockRange(startPoint, endPoint);
 
        return E_SUCCESS;
index f0e31d8..201000d 100755 (executable)
@@ -44,8 +44,6 @@ WebStorageManager* WebStorageManager::__pInstance = null;
 WebStorageManager::WebStorageManager(void)
        : __pWebStorageManagerImpl(null)
 {
-       result r = E_SUCCESS;
-
        std::unique_ptr<_WebStorageManagerImpl> pWebStorageManagerImpl(new (std::nothrow) _WebStorageManagerImpl());
        SysTryReturnVoidResult(NID_WEB_CTRL, pWebStorageManagerImpl.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
index 8c0dbf3..73e0349 100755 (executable)
@@ -54,7 +54,7 @@ _CertificateListener::OnAppControlCompleteResponseReceived(const Tizen::App::App
        {
                SysTryReturnVoidResult(NID_WEB_CTRL, pAppData, E_SYSTEM, "[E_SYSTEM] Certificate Manager AppControl failed");
 
-               String* pCertID = static_cast< String* >(const_cast< Object* >(pAppData->GetValue(String(L"Id"))));
+               //String* pCertID = static_cast< String* >(const_cast< Object* >(pAppData->GetValue(String(L"Id"))));
                // TODO : test if the result of Certificate AppControl complies with the following
                // const char* pCertificateFile;
                // ewk_set_certificate_file(pCertificateFile);
index e559c83..558aa6c 100755 (executable)
@@ -125,7 +125,10 @@ _EflWebkit::SetWebConfiguration(void) const
        Ewk_Context* pContext = ewk_view_context_get(__pWebFrame);
        SysAssertf(pContext, "Failed to request.");
 
-       ewk_view_text_selection_enable_set(__pWebFrame, EINA_FALSE);
+       Ewk_Settings* pSettings = ewk_view_settings_get(__pWebFrame);
+       SysAssertf(pSettings, "Failed to get webkit instance.");
+
+       ewk_settings_text_selection_enabled_set(pSettings, EINA_FALSE);
 
        ewk_context_additional_plugin_path_set(pContext, PLUGIN_DIRECTORY_PATH);
 
index a7bd5a0..19bfb84 100755 (executable)
@@ -204,15 +204,18 @@ _PanningGestureState::OnTouchPressed(const _Control& source, const _TouchInfo& t
 bool
 _PanningGestureState::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo)
 {
-       const Ewk_View_Smart_Data* pSmartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get( __pWebCore->GetWebNativeNode()));
-       SysAssertf(pSmartData, "Failed to get webkit smart data.");
+       if (_WebSettingImpl::GetInstance(__pWebCore->GetSetting())->IsScrollEnabled())
+       {
+               const Ewk_View_Smart_Data* pSmartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get( __pWebCore->GetWebNativeNode()));
+               SysAssertf(pSmartData, "Failed to get webkit smart data.");
 
-       Ewk_Event_Gesture gestureEvent;
+               Ewk_Event_Gesture gestureEvent;
 
-       Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
+               Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
 
-       SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0.0, 0);
-       pSmartData->api->gesture_move(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
+               SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0.0, 0);
+               pSmartData->api->gesture_move(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
+       }
 
        return true;
 }
index 17a249c..07c172b 100755 (executable)
@@ -289,7 +289,6 @@ _SelectBox::CreateItem(int index, int itemWidth)
        int listItemXPos = 0;
        int listItemYPos = 0;
        int checkBoxWidth = 0;
-       int listItemTxtHeight = 0;
        int listItemHeight = 0;
        int popupBetweenListNBtnGap = 0;
 
index 6035a92..1407af4 100755 (executable)
@@ -58,8 +58,8 @@ namespace Tizen { namespace Web { namespace Controls
 _UserConfirmPopup::_UserConfirmPopup(void)
        : __pUserPolicyData(null)
        , __userConfirmMode(USER_CONFIRM_USERMEDIA)
-       , __sync(false)
        , __pCheckButton(null)
+       , __sync(false)
 {
 }
 
index 52a9ed2..9824302 100755 (executable)
@@ -119,8 +119,7 @@ static const char WEB_CTRL[] = "webcontrol";
 
 
 _Web::_Web(void)
-       : __gestureType(WEB_GESTURE_TYPE_TAP)
-       , __pGestureHandler(null)
+       : __pGestureHandler(null)
        , __pEflWebkit(null)
        , __pWebSetting(null)
        , __pGestureFlick(null)
@@ -132,6 +131,8 @@ _Web::_Web(void)
        , __pPanningGestureHandler(null)
        , __pFlickGestureHandler(null)
        , __pPinchGestureHandler(null)
+       , __gestureType(WEB_GESTURE_TYPE_TAP)
+       , __pTextElement(null)
 {
        SetBackgroundColor(Color(0, 0, 0, 0));
 }
@@ -301,6 +302,19 @@ _Web::InitializeWebNativeNode(void)
        _AccessibilityContainer* pContainer = GetAccessibilityContainer();
        SysTryReturn(NID_WEB_CTRL, pContainer, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(E_SYSTEM));
 
+       if (pContainer)
+       {
+               __pTextElement = new (std::nothrow) _AccessibilityElement(true);
+               SysTryReturn(NID_WEB_CTRL, __pTextElement, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory shortage.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+               __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
+               //__pTextElement->SetLabel(GetText());
+               //__pTextElement->SetTrait(L"Web");
+               //__pTextElement->SetName(L"WebText");
+
+               pContainer->AddElement(*__pTextElement);
+       }
+
        pContainer->Activate(true);
        _WebAccessibilityFocusHandler* pFocusHandler = new (std::nothrow) _WebAccessibilityFocusHandler();
        pContainer->SetFocusHandler(dynamic_cast<_IAccessibilityFocusHandler*>(pFocusHandler));
@@ -434,16 +448,9 @@ _Web::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo)
 {
        if (__pEflWebkit.get())
        {
-               if (_WebSettingImpl::GetInstance(__pWebSetting.get())->IsScrollEnabled())
-               {
-                       SendTouchEventForJavaScript(touchInfo);
+               SendTouchEventForJavaScript(touchInfo);
 
-                       return __pGestureHandler->OnTouchMoved(source, touchInfo);
-               }
-               else if (__gestureType == WEB_GESTURE_TYPE_TAP)
-               {
-                       return __pGestureHandler->OnTouchMoved(source, touchInfo);
-               }
+               return __pGestureHandler->OnTouchMoved(source, touchInfo);
        }
 
        return true;
index db2f32e..23d118f 100755 (executable)
@@ -35,6 +35,7 @@
 
 namespace Tizen { namespace Ui
 {
+class _AccessibilityElement;
 class _TouchInfo;
 }} // Tizen::Ui
 
@@ -176,6 +177,8 @@ private:
        std::unique_ptr<_PinchGestureState> __pPinchGestureHandler;
 
        _WebGestureType __gestureType;
+
+       Tizen::Ui::_AccessibilityElement* __pTextElement;
 }; // _Web
 
 }}} // Tizen::Web::Controls
index e88ea04..c52d4d5 100755 (executable)
@@ -1616,12 +1616,15 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                }
 
                _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+               if (pFormCore)
                {
-                       pImpl->SetFooterVisibleState(true);
-                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+                       {
+                               pImpl->SetFooterVisibleState(true);
+                               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       }
+
+                       pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                }
 
                if (pImpl->GetWebKeypadEventListener())
@@ -1635,7 +1638,6 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                        }
                        else
                        {
-                               pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                                pImpl->GetWebKeypadEventListener()->OnWebKeypadWillOpen(*dynamic_cast< Web* >(&pImpl->GetPublic()));
                        }
                }
@@ -1669,18 +1671,19 @@ OnWebKeypadClosed(void* pUserData, Evas_Object* pView, void* pEventInfo)
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        SysAssertf(pImpl, "Failed to request");
 
-       _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
-
        if (pImpl->IsKeypadVisible())
        {
-               if (pFormCore->HasFooter() && pImpl->IsFooterVisible())
+               _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
+               if (pFormCore)
                {
-                       pImpl->SetFooterVisibleState(false);
-                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
-               }
+                       if (pFormCore->HasFooter() && pImpl->IsFooterVisible())
+                       {
+                               pImpl->SetFooterVisibleState(false);
+                               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+                       }
 
-               pFormCore->DeflateClientRectHeight(0);
+                       pFormCore->DeflateClientRectHeight(0);
+               }
 
                if (pImpl->GetWebKeypadEventListener())
                {
@@ -2126,9 +2129,6 @@ _WebImpl::InitializeSetting(void)
 
        SetEventListenerCallback();
 
-       _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
-
        return E_SUCCESS;
 }
 
@@ -4019,8 +4019,6 @@ _WebImpl::OnHandleWebDownloadEvent(const IEventArg& arg)
 result
 _WebImpl::OnHandleWebUiEvent(const IEventArg& arg)
 {
-       result r = E_SUCCESS;
-
        const _WebUiEventArg* pEventArg = dynamic_cast< const _WebUiEventArg* >(&arg);
        SysTryReturnResult(NID_WEB_CTRL, pEventArg, E_INVALID_ARG, "Invalid argument(s) is used. Type casting failed. argument must be IEventArg type.");
 
@@ -4084,8 +4082,6 @@ _WebImpl::OnHandleWebUiEvent(const IEventArg& arg)
 result
 _WebImpl::OnHandleWebUiEventF(const IEventArg& arg)
 {
-       result r = E_SUCCESS;
-
        const _WebUiEventArg* pEventArg = dynamic_cast< const _WebUiEventArg* >(&arg);
        SysTryReturnResult(NID_WEB_CTRL, pEventArg, E_INVALID_ARG, "Invalid argument(s) is used. Type casting failed. argument must be IEventArg type.");
 
@@ -4328,24 +4324,13 @@ _WebImpl::GetParentFormCore(_Control* pControlCore)
        _Form* pFormCore = null;
 
        _Control* pParentControlCore = dynamic_cast< _Control* >(pControlCore->GetParent());
-
-       if (pParentControlCore == null)
-       {
-               _Window* pWindowCore = dynamic_cast< _Window* >(pControlCore);
-               SysAssertf(pWindowCore, "Failed to get parent control and window core.");
-               pFormCore = dynamic_cast< _Form* >(pWindowCore->GetOwner());
-               if (pFormCore == null)
-               {
-                       pParentControlCore = dynamic_cast< _Control* >(pWindowCore->GetOwner());
-                       SysTryReturn(NID_WEB_CTRL, pParentControlCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-               }
-       }
-       else
+       if (!pParentControlCore)
        {
-               pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+               return null;
        }
 
-       if (pFormCore != null)
+       pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+       if (pFormCore)
        {
                return pFormCore;
        }
@@ -4421,9 +4406,10 @@ _WebImpl::OnChangeLayout(_ControlOrientation orientation)
                ecore_imf_context_input_panel_geometry_get(ecore_imf_context_add(ecore_imf_context_default_id_get()), &x, &y, &w, &h);
 
                _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               pFormCore->DeflateClientRectHeight(h);
+               if (pFormCore)
+               {
+                       pFormCore->DeflateClientRectHeight(h);
+               }
        }
 
        if (__pColorPicker.get())
index 3253c16..51ecc49 100755 (executable)
@@ -124,7 +124,6 @@ class _WebImpl
        : public Tizen::Ui::_ContainerImpl
        , public Tizen::Ui::ITextEventListener
        , public Tizen::Web::Controls::_IWebEventListener
-       , virtual public Tizen::Base::Runtime::IEventListener
 {
 public:
        _WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore);
index ebe3522..8976de2 100755 (executable)
@@ -28,6 +28,7 @@
 #include <FWebCtrlWebSetting.h>
 #include <FBaseSysLog.h>
 #include <FUi_UiBuilder.h>
+#include <FUi_CoordinateSystemUtils.h>
 
 
 using namespace Tizen::Graphics;
@@ -109,7 +110,7 @@ protected:
                if (pControl->GetElement(L"fontSize", elementString) || pControl->GetElement(L"FontSize", elementString))
                {
                        int fontSize;
-                       Base::Integer::Parse(elementString, fontSize);
+                       fontSize= _CoordinateSystemUtils::ConvertToFloat(elementString);
                        setting.SetFontSize(fontSize);
                }
 
index 3fd9552..b16f2de 100755 (executable)
@@ -80,7 +80,7 @@ _WebStorageManagerImpl::GetOriginListN(WebStorageType storageType)
        result r = E_SUCCESS;
 
        Ewk_Context* pDefaultContext = ewk_context_default_get();
-       Eina_List* pOriginEinaList;
+       Eina_List* pOriginEinaList = null;
 
        _WebPresenter presenter;
        presenter.InitAsyncProcess();
@@ -301,7 +301,7 @@ _WebStorageManagerImpl::CompareOrigin(WebStorageType storageType, const String&
 {
        Ewk_Context* pDefaultContext = ewk_context_default_get();
        _WebPresenter presenter;
-       Eina_List* pOriginList;
+       Eina_List* pOriginList = null;
        presenter.InitAsyncProcess();
 
        switch (storageType)