, __pDateChangeEvent(null)
, __pDateTimeBar(null)
, __absoluteBounds(FloatRectangle())
+ , __previousSize(0.0f, 0.0f)
, __title()
, __pAccessibilityEditDateElement(null)
, __pAccessibilityYearElement(null)
, __pAccessibilityMonthElement(null)
, __pAccessibilityDayElement(null)
+ , __isCalledBoundsChanged(false)
+ , __isXmlBoundsExist(false)
{
}
r = SettingInfo::AddSettingEventListener(*this);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ GET_SHAPE_CONFIG(EDITDATE::WIDTH, GetOrientation(), __previousSize.width);
+ GET_SHAPE_CONFIG(EDITDATE::HEIGHT, GetOrientation(), __previousSize.height);
+
return r;
CATCH:
void
_EditDate::OnBoundsChanged(void)
{
+ FloatDimension newSize = GetSizeF();
+
+ if (newSize.width != __previousSize.width || newSize.height != __previousSize.height)
+ {
+ __isCalledBoundsChanged = true;
+ }
+
__pEditDatePresenter->Initialize();
if (__pAccessibilityEditDateElement)
void
_EditDate::OnChangeLayout(_ControlOrientation orientation)
{
- FloatDimension dim;
+ if (!__isCalledBoundsChanged && !__isXmlBoundsExist)
+ {
+ FloatDimension dim;
- GET_SHAPE_CONFIG(EDITDATE::WIDTH, GetOrientation(), dim.width);
- GET_SHAPE_CONFIG(EDITDATE::HEIGHT, GetOrientation(), dim.height);
+ GET_SHAPE_CONFIG(EDITDATE::WIDTH, GetOrientation(), dim.width);
+ GET_SHAPE_CONFIG(EDITDATE::HEIGHT, GetOrientation(), dim.height);
- SetSize(dim);
+ SetSize(dim);
+ }
__pEditDatePresenter->Initialize();
__pEditDatePresenter->SetLastSelectedId(DATETIME_ID_NONE);
return;
}
+void
+_EditDate::SetXmlBoundsExist(bool isXmlBoundsExist)
+{
+ __isXmlBoundsExist = isXmlBoundsExist;
+}
+
}}} // Tizen::Ui::Controls
return;
}
+bool
+_EditDateImpl::IsXmlBoundsExist(void)
+{
+ FloatRectangle builderBounds;
+ _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
+ bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+ if(!exist)
+ {
+ return false;
+ }
+
+ controlOrientation = GetCore().GetOrientation();
+
+ if (controlOrientation == _CONTROL_ORIENTATION_LANDSCAPE)
+ {
+ exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+ }
+
+ if(!exist)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+void
+_EditDateImpl::OnChangeLayout(_ControlOrientation orientation)
+{
+ GetCore().SetXmlBoundsExist(IsXmlBoundsExist());
+
+ return _ControlImpl::OnChangeLayout(orientation);
+}
+
class _EditDateMaker
: public _UiBuilderControlMaker
{
, __pTimeChangeEvent(null)
, __pDateTimeBar(null)
, __absoluteBounds(FloatRectangle())
+ , __previousSize(0.0f, 0.0f)
, __title()
, __pAccessibilityEditTimeElement(null)
, __pAccessibilityHourElement(null)
, __pAccessibilityMinuteElement(null)
, __pAccessibilityAmPmElement(null)
+ , __isCalledBoundsChanged(false)
+ , __isXmlBoundsExist(false)
{
}
r = SettingInfo::AddSettingEventListener(*this);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ GET_SHAPE_CONFIG(EDITTIME::WIDTH, GetOrientation(), __previousSize.width);
+ GET_SHAPE_CONFIG(EDITTIME::HEIGHT, GetOrientation(), __previousSize.height);
+
return r;
CATCH:
void
_EditTime::OnBoundsChanged(void)
{
+ FloatDimension newSize = GetSizeF();
+
+ if (newSize.width != __previousSize.width || newSize.height != __previousSize.height)
+ {
+ __isCalledBoundsChanged = true;
+ }
+
__pEditTimePresenter->Initialize();
if (__pAccessibilityEditTimeElement)
void
_EditTime::OnChangeLayout(_ControlOrientation orientation)
{
- FloatDimension dim;
+ if (!__isCalledBoundsChanged && !__isXmlBoundsExist)
+ {
+ FloatDimension dim;
- GET_SHAPE_CONFIG(EDITTIME::WIDTH, GetOrientation(), dim.width);
- GET_SHAPE_CONFIG(EDITTIME::HEIGHT, GetOrientation(), dim.height);
+ GET_SHAPE_CONFIG(EDITTIME::WIDTH, GetOrientation(), dim.width);
+ GET_SHAPE_CONFIG(EDITTIME::HEIGHT, GetOrientation(), dim.height);
- SetSize(dim);
+ SetSize(dim);
+ }
__pEditTimePresenter->Initialize();
__pEditTimePresenter->SetLastSelectedId(DATETIME_ID_NONE);
}
void
+_EditTime::SetXmlBoundsExist(bool isXmlBoundsExist)
+{
+ __isXmlBoundsExist = isXmlBoundsExist;
+}
+
+void
_EditTime::UpdateAccessibilityElement(void)
{
String string;
return;
}
+bool
+_EditTimeImpl::IsXmlBoundsExist(void)
+{
+ FloatRectangle builderBounds;
+ _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
+ bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+ if(!exist)
+ {
+ return false;
+ }
+
+ controlOrientation = GetCore().GetOrientation();
+
+ if (controlOrientation == _CONTROL_ORIENTATION_LANDSCAPE)
+ {
+ exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+ }
+
+ if(!exist)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+void
+_EditTimeImpl::OnChangeLayout(_ControlOrientation orientation)
+{
+ GetCore().SetXmlBoundsExist(IsXmlBoundsExist());
+
+ return _ControlImpl::OnChangeLayout(orientation);
+}
+
class _EditTimeMaker
: public _UiBuilderControlMaker
{
virtual void OnFontInfoRequested(unsigned long& style, float& size);
virtual void OnSettingChanged(Tizen::Base::String& key);
Tizen::Graphics::FloatRectangle GetParentWindowBounds(void) const;
+ void SetXmlBoundsExist(bool isXmlBoundsExist);
private:
_EditDate(void);
_DateTimeChangeEvent* __pDateChangeEvent;
_DateTimeBar* __pDateTimeBar;
Tizen::Graphics::FloatRectangle __absoluteBounds;
+ Tizen::Graphics::FloatDimension __previousSize;
Tizen::Base::String __title;
Tizen::Ui::_AccessibilityElement* __pAccessibilityEditDateElement;
Tizen::Ui::_AccessibilityElement* __pAccessibilityYearElement;
Tizen::Ui::_AccessibilityElement* __pAccessibilityMonthElement;
Tizen::Ui::_AccessibilityElement* __pAccessibilityDayElement;
+ bool __isCalledBoundsChanged;
+ bool __isXmlBoundsExist;
}; // _EditDate
virtual void OnDateTimeChanged(const Tizen::Ui::_Control& source, int year, int month, int day, int hour, int minute);
virtual void OnDateTimeChangeCanceled(const Tizen::Ui::_Control& source);
+ bool IsXmlBoundsExist(void);
+ virtual void OnChangeLayout(_ControlOrientation orientation);
public:
static _EditDateImpl* GetInstance(EditDate& editDate);
void OnFontInfoRequested(unsigned long& style, float& size);
virtual void OnSettingChanged(Tizen::Base::String& key);
Tizen::Graphics::FloatRectangle GetParentWindowBounds(void) const;
+ void SetXmlBoundsExist(bool isXmlBoundsExist);
void CreateAccessibilityElement(void);
void UpdateAccessibilityElement(void);
_DateTimeChangeEvent* __pTimeChangeEvent;
_DateTimeBar* __pDateTimeBar;
Tizen::Graphics::FloatRectangle __absoluteBounds;
+ Tizen::Graphics::FloatDimension __previousSize;
Tizen::Base::String __title;
Tizen::Ui::_AccessibilityElement* __pAccessibilityEditTimeElement;
Tizen::Ui::_AccessibilityElement* __pAccessibilityHourElement;
Tizen::Ui::_AccessibilityElement* __pAccessibilityMinuteElement;
Tizen::Ui::_AccessibilityElement* __pAccessibilityAmPmElement;
+ bool __isCalledBoundsChanged;
+ bool __isXmlBoundsExist;
}; // _EditTime
}}} // Tizen::Ui::Controls
virtual void OnDateTimeChanged(const Tizen::Ui::_Control& source, int year, int month, int day, int hour, int minute);
virtual void OnDateTimeChangeCanceled(const Tizen::Ui::_Control& source);
+ bool IsXmlBoundsExist(void);
+ virtual void OnChangeLayout(_ControlOrientation orientation);
public:
static _EditTimeImpl* GetInstance(EditTime& editTime);
static const _EditTimeImpl* GetInstance(const EditTime& editTime);