, __updatedSoftkeyCount(0)
, __keypadShowstate(false)
, __clipboardShowstate(false)
+ , __pFormOrientationstatusEventListener(null)
{
Color color;
result r = GET_COLOR_CONFIG(FORM::BG_NORMAL,color);
}
}
+void
+_Form::SetFormOrientationStatusEventListener(_IFormOrientationStatusEventListener* pFormOrientationstatusEventListener)
+{
+ __pFormOrientationstatusEventListener = pFormOrientationstatusEventListener;
+}
+
+Tizen::Ui::OrientationStatus
+_Form::GetFormOrientationStatus(void) const
+{
+ if (__pFormOrientationstatusEventListener)
+ {
+ return __pFormOrientationstatusEventListener->OnFormOrientationStatusRequested();
+ }
+}
+
}}} // Tizen::Ui::Controls
}
SysAssert(r == E_SUCCESS);
+ pCore->SetFormOrientationStatusEventListener(pImpl);
+
// Make surface opaque.
pVisualElement = pCore->GetVisualElement();
SysTryCatch(NID_UI_CTRL, pVisualElement, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
}
}
+OrientationStatus
+_FormImpl::OnFormOrientationStatusRequested(void)
+{
+ _ControlImplManager* pImplManager = _ControlImplManager::GetInstance();
+ SysAssert(pImplManager);
+
+ OrientationStatus status = pImplManager->GetOrientationStatus(GetOrientation());
+ return status;
+}
+
+
bool
_FormImpl::IsOpaque(void) const
{
ecore_evas_callback_msg_handle_set(pPortraitEe, _Indicator::OnMessageHandle);
ecore_evas_callback_msg_handle_set(pLandscapeEe, _Indicator::OnMessageHandle);
- _ControlRotation controlRotation = _ControlManager::GetInstance()->GetOrientationStatus();
- int rotation = 0;
+ OrientationStatus status = ORIENTATION_STATUS_PORTRAIT;
+ if (pForm)
+ {
+ status = pForm->GetFormOrientationStatus();
+ }
- switch(controlRotation)
+ int rotation = 0;
+ switch(status)
{
- case _CONTROL_ROTATION_0 :
+ case ORIENTATION_STATUS_PORTRAIT :
rotation = 0;
break;
- case _CONTROL_ROTATION_90 :
+ case ORIENTATION_STATUS_LANDSCAPE :
rotation = 90;
break;
- case _CONTROL_ROTATION_180 :
+ case ORIENTATION_STATUS_PORTRAIT_REVERSE :
rotation = 180;
break;
- case _CONTROL_ROTATION_270 :
+ case ORIENTATION_STATUS_LANDSCAPE_REVERSE :
rotation = 270;
break;
default :
#define _FUI_CTRL_INTERNAL_FORM_H_
#include <unique_ptr.h>
+#include <FUiIOrientationEventListener.h>
#include <FUiCtrlControlsTypes.h>
#include <FUiCtrlOverlayRegion.h>
#include "FUi_Control.h"
_SOFTKEY_COUNT /**< This is internal. If used in an application, the application can get rejected during the certification process. Define the softkey count */
};
+class _IFormOrientationStatusEventListener
+ : virtual public Tizen::Base::Runtime::IEventListener
+{
+ // Lifecycle
+ public:
+ virtual ~_IFormOrientationStatusEventListener(void) {}
+
+ // Operation
+ public:
+ virtual Tizen::Ui::OrientationStatus OnFormOrientationStatusRequested(void) = 0;
+};
+
/**
* @class _Form
* @brief
result SetNotificationTrayOpenEnabled(bool enable);
bool IsNotificationTrayOpenEnabled(void) const;
+ void SetFormOrientationStatusEventListener(Tizen::Ui::Controls::_IFormOrientationStatusEventListener* pFormOrientationstatusEventListener);
+ Tizen::Ui::OrientationStatus GetFormOrientationStatus(void) const;
+
//callback
virtual void OnDraw(void);
virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
Tizen::Graphics::Bitmap* __pSoftkeyPressedIcon[_SOFTKEY_COUNT+1];
Tizen::Graphics::Bitmap* __pSoftkeyHighlightedIcon[_SOFTKEY_COUNT+1];
+ Tizen::Ui::Controls::_IFormOrientationStatusEventListener* __pFormOrientationstatusEventListener;
+
//Back button action ID
static const int ID_BACK_BUTTON = -10;
, public Tizen::Ui::Controls::_IActionEventListener
, public Tizen::Ui::Controls::_IFormBackEventListener
, virtual public Tizen::Base::Runtime::IEventListener
+ , public _IFormOrientationStatusEventListener
{
public:
class FormSizeInfo : public _ControlImpl::SizeInfo
virtual void OnFormBackRequested(Tizen::Ui::Controls::_Form& source);
+ virtual Tizen::Ui::OrientationStatus OnFormOrientationStatusRequested(void);
+
static const _FormImpl* GetInstance(const Form& form);
static _FormImpl* GetInstance(Form& form);
void OnScreenRotated(int rotation);
OrientationStatus GetFormOrientationStatus(_ControlImpl *pControlImpl);
+ OrientationStatus GetOrientationStatus(Orientation mode) const;
private:
void SetOrientationStatus(OrientationStatus orientationStatus);
static void RotateScreen(_ControlImpl* pControlImpl, OrientationStatus orientationStatus);
- OrientationStatus GetOrientationStatus(Orientation mode) const;
private:
_ControlImplManager(void);