#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;
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)
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));
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));
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));
{
+static const int EDIT_TEXT_SIZE = 30;
+
+
_CertificateConfirmPopup::_CertificateConfirmPopup(void)
: __certPopupMode(CERTIFICATE_POPUP_MODE_USER_CONFIRM)
, __confirm(false)
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;
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);
db.CommitTransaction();
}
+
result
_CertificateConfirmPopup::GenerateCertifiate(String& certString)
{
#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"
* @file FWebCtrl_FormDataWindow.cpp
* @brief The file contains the definition of _FormDataWindow class.
*/
-
#include <ewk_view.h>
#include <unique_ptr.h>
#include <FBaseSysLog.h>
#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;
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)
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)
{
}
_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));
//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.");
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());
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.");
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);
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()
{
* @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_
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");
return (*pLeft - *pRight);
}
+
//Internal class for maintaining states of list elements
class _ListElement
: public Object
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;
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();
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;
}
__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)
{
if (__userConfirmMode == USER_SCRIPT_ALERT)
{
- popupMaxHeight -= pPopupData->labelDim.height;
+ popupMaxHeight -= 2*pPopupData->sideMargin;
hasTitle = false;
}
}
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;
}
return E_SUCCESS;
}
+
void
_UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow)
{
}
}
+
}}} // Tizen::Web::Controls
* @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_
pNotificationWindow->SetText(String(text));
pNotificationWindow->LaunchNotification();
- pNotificationWindow.release();
+ pImpl->SetWebNotification(pNotificationWindow.release());
ewk_notification_showed(pContext, notificationId);
}
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));
{
_ContainerImpl::OnChangeLayout(orientation);
+ __isOrientationChanged = true;
+
if (__pColorPicker.get())
{
__pColorPicker->ChangeLayout(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();
+ }
}
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);
class _SelectBox;
class _InputPickerPopup;
class _FormDataWindow;
+class _WebNotification;
struct _TextSearch
{
void HideFormDataWindow(bool delWindow = true);
+ void SetWebNotification(_WebNotification* pWebNotification);
+
+ void ClearWebNotification(_WebNotification* pWebNotification);
+
private:
result InitializeSetting(void);
result InitJsBridgeList(void);
Tizen::Base::Collection::ArrayList __callbackList;
+ Tizen::Base::Collection::ArrayList __webNotificationList;
+
DecisionPolicy __policy;
Tizen::Base::String __defaultUserAgent;
* @file FWebCtrl_WebNotification.cpp
* @brief The file contains the definition of _WebNotification class.
*/
-
#include <FBaseRtTimer.h>
#include <FBaseSysLog.h>
#include <FSysVibrator.h>
#include <FUiAnimFloatAnimation.h>
#include <FUiAnimAnimationTransaction.h>
#include <FUiCtrlButton.h>
-
#include "FWebCtrl_WebImpl.h"
#include "FWebCtrl_WebNotificationHandler.h"
#include "FWebCtrl_WebNotification.h"
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)
{
}
{
}
+
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;
r = __pTimer->Construct(*this);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Error Propogating.", GetErrorMessage(r));
+ __pWebImpl = pImpl;
+
return r;
}
__pNotificationHandler->SetText(text);
}
+
String
_WebNotification::GetText(void) const
{
ewk_notification_clicked(__pContext,__notificationId);
}
+
+void
+_WebNotification::OnChangeLayout(void)
+{
+ SetShowState(false);
+ SetShowState(true);
+ Window::Show();
+}
+
+
result
_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());
void
_WebNotification::OnTimerExpired(Timer& timer)
{
-
int transactionId = 0;
int duration = 1000;
float start = 1.0f;
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;
}
+
}}}
result LaunchNotification();
void OnClicked();
+ void OnChangeLayout(void);
+
private:
void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
uint64_t __notificationId;
std::unique_ptr<Tizen::Base::Runtime::Timer> __pTimer;
Tizen::Graphics::Dimension __screenRect;
+ _WebImpl* __pWebImpl;
}; // _WebNotification
}}}
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));
{
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;
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);
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;
int labelFontSize;
int spacePad;
int sideMargin;
+ int titleHeight;
+ int bottomMargin;
};
class _WebPopup