X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontrols%2FFWebCtrl_PromptPopup.cpp;h=9a6ab1aef1a21b039e0f3da60336f8950c506921;hb=68830af363a01550e0d5ad00d02ebd19688598ac;hp=7920137390273429067e44fcedf3acdd6e822451;hpb=f41c613e80a5fcbc7f08febb707a7745ca26a461;p=framework%2Fosp%2Fweb.git diff --git a/src/controls/FWebCtrl_PromptPopup.cpp b/src/controls/FWebCtrl_PromptPopup.cpp index 7920137..9a6ab1a 100755 --- a/src/controls/FWebCtrl_PromptPopup.cpp +++ b/src/controls/FWebCtrl_PromptPopup.cpp @@ -19,44 +19,53 @@ * @file FWebCtrl_AuthConfirmPopup.cpp * @brief The file contains the definition of _AuthConfirmPopup class. */ +#include +#include +#include +#include #include #include #include #include #include #include +#include +#include #include #include #include -#include -#include +#include +#include #include #include -#include -#include #include -#include -#include "FWebCtrl_WebImpl.h" #include "FWebCtrl_PromptPopup.h" +#include "FWebCtrl_WebImpl.h" + using namespace Tizen::Base; +using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; -using namespace Tizen::Web::Controls; -using namespace Tizen::Ui::Controls; +using namespace Tizen::System; 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) - : __pPopup(null) - , __pEditField(null) + : __pEditField(null) + , __pWebView(null) + , __pImpl(null) { } + _PromptPopup::~_PromptPopup(void) { } @@ -64,172 +73,103 @@ _PromptPopup::~_PromptPopup(void) // Prompt popup result -_PromptPopup::Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultVale) +_PromptPopup::Construct(const String& message, const String& defaultVale, Evas_Object* pView, _WebImpl* pImpl) { result r = E_SUCCESS; - String buttonStr; - Dimension dim; - Dimension editDim; Rectangle rect(0, 0, 0, 0); - int spacePad = 0; - int buttonHeight = 0; - int sideMargin = 0; - int buttonWidth = 0; - int popupWidth = 0; int popupHeight = 0; - int gapForControls = 0; - _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; + __pImpl = pImpl; + __pWebView = pView; - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, popupWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, popupHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, buttonHeight); - GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, spacePad); - r = GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, editDim); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, gapForControls); + _WebPopupData* pPopupData = _WebPopup::GetPopupData(); + SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r)); - VerticalBoxLayout layout; - r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD); - - Tizen::System::_SystemResource* pSysResource = Tizen::System::_SystemResource::GetInstance(); - SysAssertf(pSysResource != null, "Failed to get _SystemResource instance"); + popupHeight = pPopupData->editDim.height + pPopupData->labelDim.height + pPopupData->panelHeight + (2 * pPopupData->spacePad); - std::unique_ptr pPopup(new (std::nothrow) Popup()); - SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - - popupHeight = LABEL_HEIGHT + (2 * editDim.height + gapForControls) + buttonHeight + (4 * spacePad) ; - - r = pPopup->Construct(layout, layout, true, Tizen::Graphics::Dimension(popupWidth, popupHeight)); + r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupHeight)); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - pPopup->SetTitleText("Prompt Dialog"); - - //Temp Label for Y position adjustment using Vertical layout. - rect.x = 0; - rect.y = 0; - rect.height = LABEL_HEIGHT; - rect.width = popupWidth - 2*sideMargin;; - - std::unique_ptr