#include "FUi_EcoreEvas.h"
#include "FUi_ControlImplManager.h"
#include "FUi_OrientationAgent.h"
+#include "FUi_ImeOrientationAgent.h"
#include "FUi_UiBuilder.h"
#include "FUi_CoordinateSystemUtils.h"
#include "FUi_DataBindingContextImpl.h"
#include "FUiCtrl_FooterImpl.h"
#include "FUiCtrl_Form.h"
#include "FUiCtrl_Frame.h"
+#include "FUiCtrl_FrameImpl.h"
#include "FUiCtrl_TabImpl.h"
#include "FUiCtrl_Indicator.h"
, __pForm(null)
, __pFormBackEventListener(null)
, __pOriAgent(null)
+ , __pImeOriAgent(null)
, __pLeftSoftkeyActionEvent(null)
, __pRightSoftkeyActionEvent(null)
, __pOptionMenuActionEvent(null)
{
__pForm = pCore;
- __pOriAgent = _OrientationAgent::CreateInstanceN(*pPublic);
- SysTryReturnVoidResult(NID_UI_CTRL, __pOriAgent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ int appType = _AppInfo::GetAppType();
+ if (appType & _APP_TYPE_IME_APP)
+ {
+ __pImeOriAgent = _ImeOrientationAgent::CreateInstanceN(*pPublic);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pImeOriAgent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ }
+ else
+ {
+ __pOriAgent = _OrientationAgent::CreateInstanceN(*pPublic);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pOriAgent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ }
}
_FormImpl::~_FormImpl(void)
{
- delete __pOriAgent;
- __pOriAgent = null;
+ if (__pImeOriAgent)
+ {
+ delete __pImeOriAgent;
+ __pImeOriAgent = null;
+ }
+
+ if (__pOriAgent)
+ {
+ delete __pOriAgent;
+ __pOriAgent = null;
+ }
if (__pLeftSoftkeyActionEvent)
{
}
}
+ if ((formStyle & FORM_STYLE_INDICATOR) && (formStyle & FORM_STYLE_INDICATOR_AUTO_HIDE))
+ {
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid form style. FORM_STYLE_INDICATOR and FORM_STYLE_INDICATOR_AUTO_HIDE can't use each other.");
+ return;
+ }
+
// check formstyle
if (((formStyle & FORM_STYLE_TITLE) || (formStyle & FORM_STYLE_TEXT_TAB) || (formStyle & FORM_STYLE_ICON_TAB)) && (formStyle & FORM_STYLE_HEADER))
{
if (FORM_STYLE_INDICATOR & formStyle)
{
+ GetCore().SetIndicatorShowState(true);
indicatorBounds = GetCore().GetIndicatorBoundsF();
r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ }
+ else if(FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle)
+ {
+ r = GetCore().SetIndicatorShowState(false, true);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ else
+ {
+ r = GetCore().SetIndicatorShowState(false);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
if (formStyle & FORM_STYLE_HEADER)
GetCore().SetHeader(&pHeader->GetCore());
GetCore().AdjustClientBounds();
+ if (GetCore().IsIndicatorTranslucent())
+ {
+ if (!GetCore().IsHeaderTranslucent())
+ {
+ indicatorBounds.height = 0.0f;
+ }
+ else
+ {
+ if (GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
+ {
+ indicatorBounds.height = 0.0f;
+ }
+ }
+ }
+
FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
GetCore().SetHeaderBounds(bounds);
void
_FormImpl::OnDraw(void)
{
- __pOriAgent->FireOrientationEvent();
+ if (__pOriAgent)
+ {
+ __pOriAgent->FireOrientationEvent();
+ }
_ContainerImpl::OnDraw();
}
void
_FormImpl::AddOrientationEventListener(IOrientationEventListener& listener)
{
- __pOriAgent->AddListener(listener);
+ if (__pOriAgent)
+ {
+ __pOriAgent->AddListener(listener);
+ }
+ else if (__pImeOriAgent)
+ {
+ __pImeOriAgent->AddListener(listener);
+ }
}
void
void
_FormImpl::RemoveOrientationEventListener(IOrientationEventListener& listener)
{
- __pOriAgent->RemoveListener(listener);
+ if (__pOriAgent)
+ {
+ __pOriAgent->RemoveListener(listener);
+ }
+ else if (__pImeOriAgent)
+ {
+ __pImeOriAgent->RemoveListener(listener);
+ }
}
void
void
_FormImpl::SetOrientation(Orientation orientation)
{
- __pOriAgent->SetMode(orientation);
+ if (__pOriAgent)
+ {
+ __pOriAgent->SetMode(orientation);
+ }
}
Orientation
_FormImpl::GetOrientation(void) const
{
- return __pOriAgent->GetMode();
+ if (__pOriAgent)
+ {
+ return __pOriAgent->GetMode();
+ }
+
+ return ORIENTATION_NONE;
}
OrientationStatus
_FormImpl::GetOrientationStatus(void) const
{
- return __pOriAgent->GetStatus();
+ if (__pOriAgent)
+ {
+ return __pOriAgent->GetStatus();
+ }
+
+ return ORIENTATION_STATUS_NONE;
}
void
_FormImpl::UpdateOrientationStatus(bool draw)
{
- __pOriAgent->Update(draw);
+ if (__pOriAgent)
+ {
+ __pOriAgent->Update(draw);
+ }
+}
+
+#if defined(WINDOW_BASE_ROTATE)
+void
+_FormImpl::UpdateOrientation(void)
+{
+ if (__pOriAgent)
+ {
+ __pOriAgent->UpdateOrientation();
+ }
+}
+#endif
+
+void
+_FormImpl::UpdateOrientation(int angle)
+{
+ SysLog(NID_UI_CTRL, "[Ime Rotation]");
+
+ if (__pImeOriAgent)
+ {
+ __pImeOriAgent->UpdateOrientation(angle);
+ }
}
bool
const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
+ // Adjust the position of the partial Frame.
+ _FrameImpl* pFrameImpl = dynamic_cast<_FrameImpl*>(GetParent());
+ if (pFrameImpl)
+ {
+ FrameShowMode frameShowMode = pFrameImpl->GetShowMode();
+
+ if ((frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN) || (frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING))
+ {
+ bool movable = pFrameImpl->GetCore().IsMovable();
+ pFrameImpl->GetCore().SetMovable(true);
+
+ FloatPoint prevPoint = pFrameImpl->GetPositionF();
+ FloatPoint curPoint(0.0f, 0.0f);
+
+ if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x;
+ curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y;
+ }
+ else
+ {
+ curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x;
+ curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y;
+ }
+
+ pFrameImpl->SetPosition(curPoint);
+
+ pFrameImpl->GetCore().SetMovable(movable);
+ }
+ }
+
// Change layout.
_ContainerImpl::OnChangeLayout(orientation);
SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
_Indicator* pIndicator = GetCore().GetIndicator();
if (pIndicator)
{
- pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+ if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight);
+ pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+ }
}
GetCore().AdjustClientBounds();
}
if (GetCore().IsIndicatorVisible())
{
indicatorBounds = GetCore().GetIndicatorBoundsF();
+ if (GetCore().IsIndicatorTranslucent())
+ {
+ if (!GetCore().IsHeaderTranslucent())
+ {
+ indicatorBounds.height = 0.0f;
+ }
+ else
+ {
+ if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
+ {
+ indicatorBounds.height = 0.0f;
+ }
+ }
+ }
}
FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
if (pHeader)
{
+ if (GetCore().IsIndicatorTranslucent())
+ {
+ if (!GetCore().IsHeaderTranslucent())
+ {
+ indicatorBounds.height = 0.0f;
+ }
+ else
+ {
+ if (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
+ {
+ indicatorBounds.height = 0.0f;
+ }
+ }
+ }
FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
GetCore().SetHeaderBounds(bounds);
}
UpdateOrientationStatus();
- __pOriAgent->RequestOrientationEvent();
+ if (__pOriAgent)
+ {
+ __pOriAgent->RequestOrientationEvent();
+ }
return r;
}
{
if (*pString == _REQUEST_ORIENTATION_EVENT)
{
- __pOriAgent->FireOrientationEvent();
+ if (__pOriAgent)
+ {
+ __pOriAgent->FireOrientationEvent();
+ }
pArgs->RemoveAll(true);
delete pArgs;
}
if (styleString.Contains(L"FORM_STYLE_INDICATOR"))
{
- style |= FORM_STYLE_INDICATOR;
+ if (styleString.Contains(L"FORM_STYLE_INDICATOR_AUTO_HIDE"))
+ {
+ style |= FORM_STYLE_INDICATOR_AUTO_HIDE;
+ }
+ else
+ {
+ style |= FORM_STYLE_INDICATOR;
+ }
}
if (styleString.Contains(L"FORM_STYLE_TEXT_TAB"))
{