ui corrections to popups and notification window
authorBINDUCHAITANYA TUMMALA <bc.tummala@samsung.com>
Wed, 26 Jun 2013 15:30:30 +0000 (21:00 +0530)
committerBINDUCHAITANYA TUMMALA <bc.tummala@samsung.com>
Wed, 26 Jun 2013 15:37:05 +0000 (21:07 +0530)
Change-Id: I95ccebfe97836368d698019b3f47b0bf8e6478c5
Signed-off-by: BINDUCHAITANYA TUMMALA <bc.tummala@samsung.com>
16 files changed:
src/controls/FWebCtrl_AuthConfirmPopup.cpp
src/controls/FWebCtrl_CertificateConfirmPopup.cpp
src/controls/FWebCtrl_CertificateConfirmPopup.h
src/controls/FWebCtrl_FormDataWindow.cpp
src/controls/FWebCtrl_PromptPopup.cpp
src/controls/FWebCtrl_PromptPopup.h
src/controls/FWebCtrl_SelectBox.cpp
src/controls/FWebCtrl_UserConfirmPopup.cpp
src/controls/FWebCtrl_UserConfirmPopup.h
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_WebImpl.h
src/controls/FWebCtrl_WebNotification.cpp
src/controls/FWebCtrl_WebNotification.h
src/controls/FWebCtrl_WebNotificationHandler.cpp
src/controls/FWebCtrl_WebPopup.cpp
src/controls/FWebCtrl_WebPopup.h

index 9182343..62a8632 100755 (executable)
@@ -35,8 +35,8 @@
 #include <FSys_VibratorImpl.h>
 #include <FUi_ControlManager.h>
 #include <FUi_ResourceManager.h>
-#include "FWebCtrl_WebImpl.h"
 #include "FWebCtrl_AuthConfirmPopup.h"
+#include "FWebCtrl_WebImpl.h"
 
 
 using namespace Tizen::Base;
@@ -47,13 +47,13 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 
 
-static const int AUTH_POPUP_TMP_LABLE_HEIGHT = 10;
-
-
 namespace Tizen { namespace Web { namespace Controls
 {
 
 
+static const int EDIT_TEXT_SIZE = 35;
+
+
 _AuthConfirmPopup::_AuthConfirmPopup(void)
        : __pIdEditField(null)
        , __pPwdEditField(null)
@@ -84,7 +84,7 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica
 
        Rectangle rect(0, 0, 0, 0);
        rect.width = pPopupData->popupDim.width;
-       rect.height = (5*pPopupData->spacePad) + (pPopupData->editDim.height*2) + pPopupData->btnDim.height + (2*pPopupData->labelDim.height);
+       rect.height = (2*pPopupData->spacePad) + (pPopupData->editDim.height*2) + pPopupData->btnDim.height + (2*pPopupData->labelDim.height);
        r = _WebPopup::Construct(true, Dimension(rect.width, rect.height));
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -124,7 +124,7 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica
 
        pIdEditField->SetGuideText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_AUTHUSERNAME"));
        pIdEditField->SetGuideTextColor(Color::GetColor(COLOR_ID_GREY));
-       pIdEditField->SetTextSize(35);;
+       pIdEditField->SetTextSize(EDIT_TEXT_SIZE);;
 
        r = AddControl(*pIdEditField);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -139,7 +139,7 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica
 
        pPwdEditField->SetGuideText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_AUTHPASSWORD"));
        pPwdEditField->SetGuideTextColor(Color::GetColor(COLOR_ID_GREY));
-       pPwdEditField->SetTextSize(35);;
+       pPwdEditField->SetTextSize(EDIT_TEXT_SIZE);;
 
        r = AddControl(*pPwdEditField);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
index 85118f4..a28b4a0 100755 (executable)
@@ -58,6 +58,9 @@ namespace Tizen { namespace Web { namespace Controls
 {
 
 
+static const int EDIT_TEXT_SIZE = 30;
+
+
 _CertificateConfirmPopup::_CertificateConfirmPopup(void)
                                                : __certPopupMode(CERTIFICATE_POPUP_MODE_USER_CONFIRM)
                                                , __confirm(false)
@@ -100,18 +103,18 @@ _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Cer
        if( __certPopupMode == CERTIFICATE_POPUP_MODE_VIEW )
        {
                titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_CERTIFICATES");
-               popupMaxHeight = pPopupData->popupDim.height;
+               popupMaxHeight = 4*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin;
 
-               rect.height = pPopupData->popupDim.height - 4*pPopupData->sideMargin - 2*pPopupData->btnDim.height;
+               rect.height = 4*pPopupData->labelDim.height;
                rect.width = pPopupData->labelDim.width;
 
                idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_CLOSE)));
-               titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_COM_SK_DONE"))));
+               titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_BODY_DONE"))));
        }
        else    // CERTIFICATE_POPUP_MODE_CONFIRM
        {
                titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_SECURITY_WARNING");
-               popupMaxHeight = 2*pPopupData->labelDim.height + 2*pPopupData->btnDim.height + 6*pPopupData->sideMargin;
+               popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin;
 
                rect.height = 2*pPopupData->labelDim.height;
                rect.width = pPopupData->labelDim.width;
@@ -145,7 +148,7 @@ _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Cer
                r = pTextBox->Construct(rect, TEXT_BOX_BORDER_ROUNDED);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               r = pTextBox->SetTextSize(30);
+               r = pTextBox->SetTextSize(EDIT_TEXT_SIZE);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
                r = pTextBox->SetAutoLinkMask(LINK_TYPE_NONE);
@@ -291,6 +294,7 @@ _CertificateConfirmPopup::AddCertificateDb(const String& pem, bool allow)
        db.CommitTransaction();
 }
 
+
 result
 _CertificateConfirmPopup::GenerateCertifiate(String& certString)
 {
index 76ace71..74ab120 100755 (executable)
@@ -23,8 +23,8 @@
 #ifndef _FWEB_CTRL_INTERNAL_CERTIFICATE_CONFIRM_POPUP_H_
 #define _FWEB_CTRL_INTERNAL_CERTIFICATE_CONFIRM_POPUP_H_
 
-#include <unique_ptr.h>
 #include <EWebKit2.h>
+#include <unique_ptr.h>
 #include <FBaseString.h>
 #include "FWebCtrl_WebPopup.h"
 
index df3aedd..cb8c5fd 100644 (file)
@@ -19,7 +19,6 @@
  * @file               FWebCtrl_FormDataWindow.cpp
  * @brief              The file contains the definition of _FormDataWindow class.
  */
-
 #include <ewk_view.h>
 #include <unique_ptr.h>
 #include <FBaseSysLog.h>
@@ -29,8 +28,9 @@
 #include <FUiVerticalBoxLayout.h>
 #include <FBase_StringConverter.h>
 #include <FUi_ResourceManager.h>
-#include "FWebCtrl_WebImpl.h"
 #include "FWebCtrl_FormDataWindow.h"
+#include "FWebCtrl_WebImpl.h"
+
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -40,11 +40,14 @@ using namespace Tizen::System;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 
+
 namespace Tizen { namespace Web { namespace Controls
 {
 
+
 static const int MAX_LIST_ITEM_COUNT = 3;
 
+
 _FormDataWindow::_FormDataWindow(void)
                                        : __pListView(null)
                                        , __pWebView(null)
index 7fe1909..4135087 100755 (executable)
@@ -50,19 +50,20 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 
 
-static const int LABEL_HEIGHT = 10;
-
-
 namespace Tizen { namespace Web { namespace Controls
 {
 
 
+static const int EDIT_TEXT_SIZE = 35;
+
+
 _PromptPopup::_PromptPopup(void)
        : __pEditField(null)
        , __pWebView(null)
 {
 }
 
+
 _PromptPopup::~_PromptPopup(void)
 {
 }
@@ -82,7 +83,7 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
        _WebPopupData* pPopupData = _WebPopup::GetPopupData();
        SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-       popupHeight = LABEL_HEIGHT + (2 * pPopupData->editDim.height + pPopupData->spacePad)  + pPopupData->btnDim.height + (4 * pPopupData->spacePad) ;
+       popupHeight = pPopupData->editDim.height + pPopupData->labelDim.height  + pPopupData->btnDim.height + (2 * pPopupData->spacePad);
 
        r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupHeight));
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -90,9 +91,9 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
 
        //Text box
        rect = GetClientAreaBounds();
-       rect.width = pPopupData->popupDim.width - 2 * pPopupData->sideMargin;
+       rect.width = pPopupData->labelDim.width;
        rect.y = 0;
-       rect.height = pPopupData->editDim.height + 10;
+       rect.height = pPopupData->labelDim.height;
 
        std::unique_ptr<TextBox> pTextBox(new (std::nothrow) TextBox());
        SysTryReturnResult(NID_WEB_CTRL, pTextBox.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
@@ -100,6 +101,7 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
        r = pTextBox->Construct(rect, TEXT_BOX_BORDER_ROUNDED);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       pTextBox->SetTextSize(EDIT_TEXT_SIZE);
        pTextBox->SetText(message);
        pTextBox->SetColor(TEXT_BOX_STATUS_NORMAL, GetColor());
        pTextBox->SetColor(TEXT_BOX_STATUS_HIGHLIGHTED, GetColor());
@@ -109,10 +111,9 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
 
        TextBox* pTmpTextBox = pTextBox.release();
 
-
        //Edit Field
        rect.y = 0;
-       rect.height = pPopupData->editDim.height + 10;
+       rect.height = pPopupData->editDim.height;
 
        std::unique_ptr<EditField> pEditField(new (std::nothrow) EditField());
        SysTryReturnResult(NID_WEB_CTRL, pEditField.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
@@ -120,6 +121,7 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
        r = pEditField->Construct(rect, EDIT_FIELD_STYLE_NORMAL);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       pEditField->SetTextSize(EDIT_TEXT_SIZE);
        pEditField->SetText(defaultVale);
 
        r = AddControl(*pEditField);
@@ -157,13 +159,13 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
        pLayout->SetHorizontalAlignment(*__pEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
        pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
 
-       pLayout->SetSpacing(*pTmpTextBox, pPopupData->spacePad);
        pLayout->SetSpacing(*__pEditField, pPopupData->spacePad);
        pLayout->SetSpacing(*pButtonPanel, pPopupData->spacePad);
 
        return r;
 }
 
+
 const String
 _PromptPopup::GetPromptText()
 {
index 0496595..8539ab4 100755 (executable)
@@ -19,7 +19,6 @@
  * @file       FWebCtrl_PromptPopup.h
  * @brief      The file contains the definition of _PromptPopup class.
  */
-
 #ifndef _FWEB_CTRL_PROMPT_POPUP_H_
 #define _FWEB_CTRL_PROMPT_POPUP_H_
 
index 44caf60..ba1084b 100755 (executable)
@@ -52,14 +52,17 @@ using namespace Tizen::Ui::Controls;
 namespace Tizen { namespace Web { namespace Controls
 {
 
+
 static const int POSITION_INVALID = -1;
 
+
 template< class Type > Type
 Max(Type a, Type b)
 {
        return a > b ? a : b;
 }
 
+
 int CompareChangedItems(const void* pData1, const void* pData2)
 {
        SysAssertf(pData1 && pData2, "input parameters are null");
@@ -70,6 +73,7 @@ int CompareChangedItems(const void* pData1, const void* pData2)
     return (*pLeft - *pRight);
 }
 
+
 //Internal class for maintaining states of list elements
 class _ListElement
        : public Object
@@ -166,22 +170,18 @@ _SelectBox::Construct(bool isMultiSelect, const String& title, int listCount, Ev
 
        int listItemHeight = 0;
        int listMaxHeihgt = 0;
-       int popupWinTopMargin = 0;
-       int popupWinBottomMargin = 0;
        int listViewHeight = 0;
 
        __pWebView = pWebView;
 
        GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, __orientation, listItemHeight);
-       GET_SHAPE_CONFIG(POPUP::TOP_BORDER, __orientation, popupWinTopMargin);
-       GET_SHAPE_CONFIG(POPUP::BOTTOM_BORDER, __orientation, popupWinBottomMargin);
 
        __multiSelection = isMultiSelect;
 
        _WebPopupData* pPopupData = _WebPopup::GetPopupData();
        SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-       listMaxHeihgt = listCount * listItemHeight + pPopupData->btnDim.height + 2 * ( pPopupData->spacePad + popupWinTopMargin + popupWinBottomMargin);
+       listMaxHeihgt = listCount * listItemHeight + pPopupData->btnDim.height + pPopupData->spacePad;
 
        rect.height = listMaxHeihgt;
        rect.width = pPopupData->popupDim.width;
@@ -196,11 +196,11 @@ _SelectBox::Construct(bool isMultiSelect, const String& title, int listCount, Ev
                Popup::SetTitleText(title);
        }
 
-       listViewHeight = GetClientAreaBounds().height - popupWinTopMargin - popupWinBottomMargin - pPopupData->btnDim.height;
+       listViewHeight = listCount * listItemHeight;
        std::unique_ptr<ListView> pListView(new (std::nothrow) ListView());
        SysTryReturnResult(NID_WEB_CTRL, pListView.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-       r = pListView->Construct(Rectangle(0, popupWinTopMargin, GetClientAreaBounds().width, listViewHeight), true, SCROLL_STYLE_FADE_OUT);
+       r = pListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, listViewHeight), true, SCROLL_STYLE_FADE_OUT);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = __listElementArray.Construct();
@@ -248,7 +248,7 @@ _SelectBox::Construct(bool isMultiSelect, const String& title, int listCount, Ev
        std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
        SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pLayout->SetSpacing(*pButtonPanel,  pPopupData->sideMargin);
+       pLayout->SetSpacing(*pButtonPanel,  pPopupData->spacePad);
 
        return r;
 }
index 2ee0b45..287cb39 100755 (executable)
@@ -91,7 +91,7 @@ _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo,
        __sync = sync;
 
        bool hasTitle = true;
-       int popupMaxHeight = 2*pPopupData->labelDim.height + 2*pPopupData->btnDim.height + 6*pPopupData->sideMargin;
+       int popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin;
 
        if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
        {
@@ -100,7 +100,7 @@ _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo,
 
        if (__userConfirmMode == USER_SCRIPT_ALERT)
        {
-               popupMaxHeight -=  pPopupData->labelDim.height;
+               popupMaxHeight -=  2*pPopupData->sideMargin;
                hasTitle = false;
        }
 
@@ -193,7 +193,10 @@ _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo,
        }
        pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
 
-       pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
+       if ( __userConfirmMode != USER_SCRIPT_ALERT )
+       {
+               pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
+       }
 
        return E_SUCCESS;
 }
@@ -398,6 +401,7 @@ _UserConfirmPopup::AddGeolocationDb(Ewk_Geolocation_Permission_Request* pPolicy,
        return E_SUCCESS;
 }
 
+
 void
 _UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow)
 {
@@ -462,4 +466,5 @@ _UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow)
        }
 }
 
+
 }}} // Tizen::Web::Controls
index bc57332..b6d1374 100755 (executable)
@@ -19,7 +19,6 @@
  * @file       FWebCtrl_UserConfirmPopup.h
  * @brief      The file contains the definition of _UserConfirmPopup class.
  */
-
 #ifndef _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
 #define _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
 
index 76d3171..ccd279b 100755 (executable)
@@ -707,7 +707,7 @@ OnNotificationShow(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
        pNotificationWindow->SetText(String(text));
        pNotificationWindow->LaunchNotification();
-       pNotificationWindow.release();
+       pImpl->SetWebNotification(pNotificationWindow.release());
 
        ewk_notification_showed(pContext, notificationId);
 }
@@ -2370,6 +2370,9 @@ _WebImpl::Construct(void)
        r = __callbackList.Construct();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       r = __webNotificationList.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
        r = InitJsBridgeList();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -4863,6 +4866,8 @@ _WebImpl::OnChangeLayout(_ControlOrientation orientation)
 {
        _ContainerImpl::OnChangeLayout(orientation);
 
+       __isOrientationChanged = true;
+
        if (__pColorPicker.get())
        {
                __pColorPicker->ChangeLayout(orientation);
@@ -4870,7 +4875,14 @@ _WebImpl::OnChangeLayout(_ControlOrientation orientation)
 
        HideFormDataWindow();
 
-       __isOrientationChanged = true;
+       std::unique_ptr< IEnumerator > pEnum(__webNotificationList.GetEnumeratorN());
+       _WebNotification* pWebNotification = null;
+
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               pWebNotification = static_cast< _WebNotification* >(pEnum->GetCurrent());
+               pWebNotification->OnChangeLayout();
+       }
 }
 
 
@@ -5289,6 +5301,20 @@ _WebImpl::HideFormDataWindow(bool delWindow)
 
 
 void
+_WebImpl::ClearWebNotification(_WebNotification* pWebNotification)
+{
+       __webNotificationList.Remove(*pWebNotification);
+}
+
+
+void
+_WebImpl::SetWebNotification(_WebNotification* pWebNotification)
+{
+       __webNotificationList.Add(pWebNotification);
+}
+
+
+void
 _WebImpl::OnDownloadCompleted(RequestId reqId, const String &path)
 {
        _ContentManagerImpl::ScanFile(path);
index 30a0761..7a61ef8 100755 (executable)
@@ -109,6 +109,7 @@ class _WebDataHandler;
 class _SelectBox;
 class _InputPickerPopup;
 class _FormDataWindow;
+class _WebNotification;
 
 struct _TextSearch
 {
@@ -415,6 +416,10 @@ public:
 
        void HideFormDataWindow(bool delWindow = true);
 
+       void SetWebNotification(_WebNotification* pWebNotification);
+
+       void ClearWebNotification(_WebNotification* pWebNotification);
+
 private:
        result InitializeSetting(void);
        result InitJsBridgeList(void);
@@ -490,6 +495,8 @@ private:
 
        Tizen::Base::Collection::ArrayList __callbackList;
 
+       Tizen::Base::Collection::ArrayList __webNotificationList;
+
        DecisionPolicy __policy;
 
        Tizen::Base::String __defaultUserAgent;
index 7084006..f46f224 100755 (executable)
@@ -19,7 +19,6 @@
  * @file               FWebCtrl_WebNotification.cpp
  * @brief              The file contains the definition of _WebNotification class.
  */
-
 #include <FBaseRtTimer.h>
 #include <FBaseSysLog.h>
 #include <FSysVibrator.h>
@@ -29,7 +28,6 @@
 #include <FUiAnimFloatAnimation.h>
 #include <FUiAnimAnimationTransaction.h>
 #include <FUiCtrlButton.h>
-
 #include "FWebCtrl_WebImpl.h"
 #include "FWebCtrl_WebNotificationHandler.h"
 #include "FWebCtrl_WebNotification.h"
@@ -42,14 +40,17 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
 using namespace Tizen::Ui::Controls;
 
+
 namespace Tizen { namespace Web { namespace Controls
 {
 
+
 _WebNotification::_WebNotification(void)
                                : __pNotificationHandler(null)
                                , __pContext(null)
                                , __notificationId(0)
                                , __pTimer(null)
+                               , __pWebImpl(null)
 {
 }
 
@@ -58,13 +59,10 @@ _WebNotification::~_WebNotification(void)
 {
 }
 
+
 result
 _WebNotification::Construct(Ewk_Context *pContext, uint64_t notificationId, Tizen::Web::Controls::_WebImpl* pImpl)
 {
-
-//     _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
-//     Dimension screenRect = _ControlManager::GetInstance()->GetScreenSize();
-
        Rectangle rect(NOTIFCATION_RECT_AREA);
        result r = E_SUCCESS;
 
@@ -89,6 +87,8 @@ _WebNotification::Construct(Ewk_Context *pContext, uint64_t notificationId, Tize
        r = __pTimer->Construct(*this);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Error Propogating.", GetErrorMessage(r));
 
+       __pWebImpl = pImpl;
+
        return r;
 }
 
@@ -99,6 +99,7 @@ _WebNotification::SetText(const String& text)
        __pNotificationHandler->SetText(text);
 }
 
+
 String
 _WebNotification::GetText(void) const
 {
@@ -128,6 +129,16 @@ _WebNotification::OnClicked()
        ewk_notification_clicked(__pContext,__notificationId);
 }
 
+
+void
+_WebNotification::OnChangeLayout(void)
+{
+       SetShowState(false);
+       SetShowState(true);
+       Window::Show();
+}
+
+
 result
 _WebNotification::LaunchNotification()
 {
@@ -138,7 +149,7 @@ _WebNotification::LaunchNotification()
        r = pButton->Construct(Rectangle(NOTIFCATION_BUTTON_AREA));
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Error Propogating.", GetErrorMessage(r));
 
-       pButton->SetText(L"x"); //Need to add bit map
+       pButton->SetText(L"x"); //Need to add bitmap
        pButton->AddActionEventListener(*this);
 
        r = AddControl(pButton.get());
@@ -171,7 +182,6 @@ _WebNotification::LaunchNotification()
 void
 _WebNotification::OnTimerExpired(Timer& timer)
 {
-
        int transactionId = 0;
        int duration = 1000;
        float start = 1.0f;
@@ -188,15 +198,21 @@ _WebNotification::OnTimerExpired(Timer& timer)
        pAnimator->SetShowState(static_cast< int >(start));
 
        AnimationTransaction::Commit();
+       __pWebImpl->ClearWebNotification(this);
+
        delete this;
 }
 
+
 void
 _WebNotification::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 {
        SetShowState(false);
 
+       __pWebImpl->ClearWebNotification(this);
+
        delete this;
 }
 
+
 }}}
index 30e8201..ef43b6c 100755 (executable)
@@ -67,6 +67,8 @@ public:
                result LaunchNotification();
                void OnClicked();
 
+               void OnChangeLayout(void);
+
 private:
                void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
                void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
@@ -77,6 +79,7 @@ private:
                uint64_t __notificationId;
                std::unique_ptr<Tizen::Base::Runtime::Timer> __pTimer;
                Tizen::Graphics::Dimension __screenRect;
+               _WebImpl* __pWebImpl;
 }; // _WebNotification
 
 }}}
index 99cd681..614a094 100755 (executable)
@@ -141,7 +141,6 @@ _WebNotificationHandler::OnTouchReleased(Control &source, const TouchEventInfo &
 result
 _WebNotificationHandler::DrawNotification(Canvas& canvas)
 {
-
        canvas.SetBackgroundColor(Color(0, 0, 0, 0));
        canvas.Clear();
        canvas.FillRoundRectangle(__pallete[NOTIFCATION_COLOR_BG_NORMAL], Rectangle(0, 0 , __bounds.width, __bounds.height), Dimension(5, 5));
index a661278..5b4948b 100644 (file)
@@ -59,10 +59,18 @@ _WebPopup::Construct(bool hasTitle, const Dimension& popupDim)
 {
        VerticalBoxLayout layout;
 
+       Dimension dim(popupDim);
+       dim.height += __pWebPopupData->bottomMargin;
+
+       if (hasTitle)
+       {
+               dim.height += __pWebPopupData->titleHeight;
+       }
+
        result r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = Popup::Construct(layout, layout, hasTitle, popupDim);
+       r = Popup::Construct(layout, layout, hasTitle, dim);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return E_SUCCESS;
@@ -216,6 +224,8 @@ _WebPopup::GetPopupData(bool refresh)
        GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, __pWebPopupData->popupDim.width);
        GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, __pWebPopupData->popupDim.height);
        GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, __pWebPopupData->sideMargin);
+       GET_SHAPE_CONFIG(POPUP::BOTTOM_BORDER, orientation, __pWebPopupData->bottomMargin);
+       GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, __pWebPopupData->titleHeight);
 
        GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, __pWebPopupData->btnDim.height);
        GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, __pWebPopupData->spacePad);
@@ -225,7 +235,6 @@ _WebPopup::GetPopupData(bool refresh)
 
        GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, __pWebPopupData->editDim);
 
-       __pWebPopupData->popupDim.width -= 2*__pWebPopupData->sideMargin;
        __pWebPopupData->labelDim.width = __pWebPopupData->popupDim.width - 2*__pWebPopupData->sideMargin;
        __pWebPopupData->labelDim.height = 3*__pWebPopupData->labelFontSize;
 
index 0000606..752e345 100755 (executable)
@@ -71,6 +71,8 @@ struct _WebPopupData
        int labelFontSize;
        int spacePad;
        int sideMargin;
+       int titleHeight;
+       int bottomMargin;
 };
 
 class _WebPopup