2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
20 #include <FUiControls.h>
21 #include <FBaseInteger.h>
22 #include <FBaseColLinkedListT.h>
23 #include <FUiCtrlHeader.h>
24 #include <FUiCtrlFooter.h>
25 #include <FUiCtrlTab.h>
26 #include <FUiLayout.h>
27 #include <FBaseSysLog.h>
28 #include <FApp_AppInfo.h>
29 #include <FGrpFloatRectangle.h>
30 #include "FUi_LayoutImpl.h"
31 #include "FUi_EcoreEvasMgr.h"
32 #include "FUi_EcoreEvas.h"
33 #include "FUi_ControlImplManager.h"
34 #include "FUi_OrientationAgent.h"
35 #include "FUi_UiBuilder.h"
36 #include "FUi_CoordinateSystemUtils.h"
37 #include "FUi_DataBindingContextImpl.h"
38 #include "FUi_ResourceSizeInfo.h"
39 #include "FUi_ResourceManager.h"
40 #include "FUiAnim_VisualElement.h"
41 #include "FUiCtrl_FormImpl.h"
42 #include "FUiCtrl_HeaderImpl.h"
43 #include "FUiCtrl_FooterImpl.h"
44 #include "FUiCtrl_Form.h"
45 #include "FUiCtrl_Frame.h"
46 #include "FUiCtrl_TabImpl.h"
47 #include "FUiCtrl_Indicator.h"
49 using namespace Tizen::App;
50 using namespace Tizen::Base;
51 using namespace Tizen::Base::Runtime;
52 using namespace Tizen::Base::Collection;
53 using namespace Tizen::Graphics;
54 using namespace Tizen::Ui;
55 using namespace Tizen::Ui::Animations;
57 #define OPTIONKEY SOFTKEY_COUNT
59 namespace Tizen { namespace Ui { namespace Controls
63 _FormImpl::FormSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const
66 Dimension dimension(0, 0);
73 _FormImpl::GetInstance(const Form& form)
75 return static_cast<const _FormImpl*> (form._pControlImpl);
79 _FormImpl::GetInstance(Form& form)
81 return static_cast<_FormImpl*> (form._pControlImpl);
84 _FormImpl::_FormImpl(Form* pPublic, _Form* pCore, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout)
85 : _ContainerImpl(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout)
87 , __pFormBackEventListener(null)
89 , __pLeftSoftkeyActionEvent(null)
90 , __pRightSoftkeyActionEvent(null)
91 , __pOptionMenuActionEvent(null)
95 __pOriAgent = _OrientationAgent::CreateInstanceN(*pPublic);
96 SysTryReturnVoidResult(NID_UI_CTRL, __pOriAgent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
99 _FormImpl::~_FormImpl(void)
104 if (__pLeftSoftkeyActionEvent)
106 delete __pLeftSoftkeyActionEvent;
107 __pLeftSoftkeyActionEvent = null;
110 if (__pRightSoftkeyActionEvent)
112 delete __pRightSoftkeyActionEvent;
113 __pRightSoftkeyActionEvent = null;
116 if (__pOptionMenuActionEvent)
118 delete __pOptionMenuActionEvent;
119 __pOptionMenuActionEvent = null;
122 __leftSoftkeyActionList.RemoveAll(false);
123 __rightSoftkeyActionList.RemoveAll(false);
135 _FormImpl::CreateFormImplN(Form* pControl, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout)
137 result r = E_SUCCESS;
138 _VisualElement* pVisualElement = null;
140 _Form* pCore = _Form::CreateFormN();
142 SysTryReturn(NID_UI_CTRL, pCore, null, r, "[%s] Propagating.", GetErrorMessage(r)); // [ToDo] interpret last result.
144 _FormImpl* pImpl = new (std::nothrow) _FormImpl(pControl, pCore, pPublicPortraitLayout, pPublicLandscapeLayout);
146 r = _ControlImpl::CheckConstruction(pCore, pImpl);
147 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
149 const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize();
150 const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width);
152 _ControlOrientation orientation = pCore->GetOrientation();
154 if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
156 r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(Form), portraitSize, orientation);
160 r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(Form), landscapeSize, orientation);
162 SysAssert(r == E_SUCCESS);
164 // Make surface opaque.
165 pVisualElement = pCore->GetVisualElement();
166 SysTryCatch(NID_UI_CTRL, pVisualElement, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
167 r = pVisualElement->SetSurfaceOpaque(true);
168 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); // [ToDo] interpret last result.
170 SetLastResult(E_SUCCESS);
182 _FormImpl::GetPublicClassName(void) const
184 return "Tizen::Ui::Controls::Form";
188 _FormImpl::GetPublic(void) const
190 return static_cast<const Form&>(_ControlImpl::GetPublic());
194 _FormImpl::GetPublic(void)
196 return static_cast<Form&>(_ControlImpl::GetPublic());
200 _FormImpl::GetCore(void) const
202 return static_cast<const _Form&>(_ControlImpl::GetCore());
206 _FormImpl::GetCore(void)
208 return static_cast<_Form&>(_ControlImpl::GetCore());
212 _FormImpl::GetFocusControl(void)
218 _FormImpl::GetFormStyle(void) const
220 return GetCore().GetFormStyle();
224 _FormImpl::HasIndicator(void) const
226 return GetCore().HasIndicator();
230 _FormImpl::SetFormStyle(unsigned long formStyle)
232 result r = E_SUCCESS;
234 _HeaderImpl* pHeader = GetHeader();
235 _FooterImpl* pFooter = GetFooter();
236 _TabImpl* pTabImpl = GetTabImpl();
238 if (IsAttachedToMainTree())
240 if (FORM_STYLE_INDICATOR & formStyle)
242 _Frame* pFrame = dynamic_cast<_Frame*>(GetCore().GetParent());
243 SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_INVALID_ARG, "A Form which has FORM_STYLE_INDICATOR style cannot be added to a container except Frame.");
248 if (((formStyle & FORM_STYLE_TITLE) || (formStyle & FORM_STYLE_TEXT_TAB) || (formStyle & FORM_STYLE_ICON_TAB)) && (formStyle & FORM_STYLE_HEADER))
250 SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid form style. FORM_STYLE_TITLE, FORM_STYLE_TEXT_TAB or FORM_STYLE_ICON_TAB and FORM_STYLE_HEADER can't use each other.");
257 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
263 if (((formStyle & FORM_STYLE_SOFTKEY_0) || (formStyle & FORM_STYLE_SOFTKEY_1) || (formStyle & FORM_STYLE_OPTIONKEY)) && (formStyle & FORM_STYLE_FOOTER))
265 SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid form style. FORM_STYLE_SOFTKEY0, FORM_STYLE_SOFTKEY_1 or FORM_STYLE_OPTIONKEY and FORM_STYLE_FOOTER can't use each other.");
272 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
277 _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
278 SysTryReturnVoidResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
280 GetCore().SetFormStyle(formStyle);
282 Rectangle indicatorBounds(0, 0, 0, 0);
283 FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f);
285 if (FORM_STYLE_INDICATOR & formStyle)
287 GetCore().SetIndicatorShowState(true);
288 indicatorBounds = GetCore().GetIndicatorBounds();
289 indicatorFloatBounds = GetCore().GetIndicatorFloatBounds();
291 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
295 r = GetCore().SetIndicatorShowState(false);
296 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
299 if (formStyle & FORM_STYLE_HEADER)
303 pHeader = CreateHeaderN();
304 SysTryReturnVoidResult(NID_UI_CTRL, pHeader != null, r, "[%s] Propagating.", GetErrorMessage(r));
306 GetCore().SetHeader(&pHeader->GetCore());
307 GetCore().AdjustClientBounds();
309 FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true));
310 GetCore().SetHeaderFloatBounds(bounds);
312 r = GetCore().AttachSystemChild(pHeader->GetCore());
313 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
315 GetCore().SetFormBackEventListener(this);
318 else if (formStyle & FORM_STYLE_TITLE)
322 pHeader = CreateHeaderN();
323 SysTryReturnVoidResult(NID_UI_CTRL, pHeader != null, r, "[%s] Propagating.", GetErrorMessage(r));
325 GetCore().SetHeader(&pHeader->GetCore());
326 GetCore().AdjustClientBounds();
328 FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true));
329 GetCore().SetHeaderFloatBounds(bounds);
331 r = GetCore().AttachSystemChild(pHeader->GetCore());
332 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
342 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
346 if (formStyle & FORM_STYLE_TEXT_TAB)
350 if (formStyle & FORM_STYLE_TITLE)
354 titleHeight = pHeader->GetBounds().height;
360 pTabImpl = CreateTabImplN();
361 SysTryReturnVoidResult(NID_UI_CTRL, pTabImpl != null, r, "[%s] Propagating.", GetErrorMessage(r));
363 int posY = indicatorBounds.height + titleHeight;
365 GetCore().SetTab(&pTabImpl->GetCore());
366 GetCore().AdjustClientBounds();
368 Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight());
369 GetCore().SetTabBounds(bounds);
371 r = GetCore().AttachSystemChild(pTabImpl->GetCore());
372 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
374 GetCore().SetTabStyle(_TAB_STYLE_TEXT);
376 else if (formStyle & FORM_STYLE_ICON_TAB)
380 if (formStyle & FORM_STYLE_TITLE)
384 titleHeight = pHeader->GetBounds().height;
390 pTabImpl = CreateTabImplN();
391 SysTryReturnVoidResult(NID_UI_CTRL, pTabImpl != null, r, "[%s] Propagating.", GetErrorMessage(r));
393 int posY = indicatorBounds.height + titleHeight;
395 GetCore().SetTab(&pTabImpl->GetCore());
396 GetCore().AdjustClientBounds();
398 Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight());
399 GetCore().SetTabBounds(bounds);
401 r = GetCore().AttachSystemChild(pTabImpl->GetCore());
402 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
404 GetCore().SetTabStyle(_TAB_STYLE_ICON);
412 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
416 if (formStyle & FORM_STYLE_FOOTER)
420 pFooter = CreateFooterN();
421 SysTryReturnVoidResult(NID_UI_CTRL, pFooter != null, r, "[%s] Propagating.", GetErrorMessage(r));
423 GetCore().SetFooter(&pFooter->GetCore());
424 GetCore().AdjustClientBounds();
426 Rectangle clientbounds = GetClientBounds();
427 Rectangle bounds(0, clientbounds.y + clientbounds.height, clientbounds.width, GetCore().GetToolbarHeight(false));
429 GetCore().SetFooterBounds(bounds);
431 r = GetCore().AttachSystemChild(pFooter->GetCore());
432 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
434 GetCore().SetFormBackEventListener(this);
437 else if (formStyle & FORM_STYLE_SOFTKEY_0 || formStyle & FORM_STYLE_SOFTKEY_1 || formStyle & FORM_STYLE_OPTIONKEY)
443 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
446 pFooter = GetFooter();
450 pFooter = CreateFooterN();
451 SysTryReturnVoidResult(NID_UI_CTRL, pFooter != null, r, "[%s] Propagating.", GetErrorMessage(r));
453 GetCore().SetFooter(&pFooter->GetCore());
454 GetCore().AdjustClientBounds();
456 Rectangle clientbounds = GetClientBounds();
457 Rectangle bounds(0, clientbounds.y + clientbounds.height - GetCore().GetToolbarHeight(false), clientbounds.width, GetCore().GetToolbarHeight(false));
459 GetCore().SetFooterBounds(bounds);
461 r = GetCore().AttachSystemChild(pFooter->GetCore());
462 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
464 GetCore().CreateSoftkey(formStyle);
466 pFooter->GetCore().AddActionEventListener(*this);
476 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
477 GetCore().AdjustClientBounds();
481 GetCore().AdjustClientBounds();
483 SetLastResult(E_SUCCESS);
489 _FormImpl::GetFooter(void) const
491 _Toolbar* pToolbar = __pForm->GetFooter();
492 if (pToolbar == null)
497 _FooterImpl* pFooterImpl = static_cast<_FooterImpl*>(pToolbar->GetUserData());
503 _FormImpl::GetHeader(void) const
505 _Toolbar* pToolbar = __pForm->GetHeader();
506 if (pToolbar == null)
511 _HeaderImpl* pHeaderImpl = static_cast<_HeaderImpl*>(pToolbar->GetUserData());
518 _FormImpl::GetTabImpl(void) const
520 _Tab* pTab = __pForm->GetTab();
526 _TabImpl* pTabImpl = static_cast<_TabImpl*>(pTab->GetUserData());
532 _FormImpl::GetTitleText(void) const
534 return GetCore().GetTitleText();
538 _FormImpl::GetTitleTextHorizontalAlignment(void) const
540 return GetCore().GetTitleTextHorizontalAlignment();
544 _FormImpl::HasFooter(void) const
546 return GetCore().HasFooter();
550 _FormImpl::HasHeader(void) const
552 return GetCore().HasHeader();
556 _FormImpl::HasTitle(void) const
558 return GetCore().HasTitle();
562 _FormImpl::HasTab(void) const
564 return GetCore().HasTab();
568 _FormImpl::IsIndicatorVisible(void) const
570 return GetCore().IsIndicatorVisible();
574 _FormImpl::IsHeaderVisible(void) const
576 return GetCore().IsHeaderVisible();
580 _FormImpl::IsFooterVisible(void) const
582 return GetCore().IsFooterVisible();
586 _FormImpl::IsIndicatorTranslucent(void) const
588 return GetCore().IsIndicatorTranslucent();
592 _FormImpl::IsHeaderTranslucent(void) const
594 return GetCore().IsHeaderTranslucent();
598 _FormImpl::IsFooterTranslucent(void) const
600 return GetCore().IsFooterTranslucent();
605 _FormImpl::IsTabTranslucent(void) const
607 return GetCore().IsTabTranslucent();
611 _FormImpl::SetActionBarsTranslucent(unsigned long actionBars, bool translucent)
613 return GetCore().SetActionBarsTranslucent(actionBars, translucent);
617 _FormImpl::SetActionBarsVisible(unsigned long actionBars, bool visible)
619 return GetCore().SetActionBarsVisible(actionBars, visible);
623 _FormImpl::SetTitleIcon(const Bitmap* pTitleBitmap)
625 return GetCore().SetTitleIcon(pTitleBitmap);
629 _FormImpl::SetTitleText(const String& title, HorizontalAlignment alignment)
631 return GetCore().SetTitleText(title, alignment);
635 _FormImpl::GetOverlayRegionN(const Rectangle& rect, OverlayRegionType regionType)
637 return GetCore().GetOverlayRegionN(rect, regionType);
641 _FormImpl::OnDraw(void)
643 // [ToDo] Versioning!!!
644 __pOriAgent->FireOrientationEvent();
646 _ContainerImpl::OnDraw();
650 _FormImpl::OnKeyReleased(const _ControlImpl& source, _KeyCode keyCode)
655 if (GetCore().GetFooter() || GetCore().GetHeader())
657 if (__pFormBackEventListener)
659 Form* pForm = dynamic_cast <Form*>(&GetPublic());
662 __pFormBackEventListener->OnFormBackRequested(*pForm);
684 _FormImpl::OnActionPerformed(const _Control& source, int actionId)
686 if (GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetFormStyle() & FORM_STYLE_SOFTKEY_1 || GetFormStyle() & FORM_STYLE_OPTIONKEY)
688 Tizen::Base::Runtime::IEventArg* tempArg = null;
689 tempArg = _PublicActionEvent::CreateActionEventArgN(actionId);
690 SysTryReturnVoidResult(NID_UI_CTRL, tempArg , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create Eventarg.");
693 _PublicActionEvent* pSoftkeyActionEvent = null;
695 if (GetCore().GetFooter()->IsButtonSet(LEFT_BUTTON) && GetSoftkeyActionId(SOFTKEY_0) == actionId)
697 for (int i = 0; i < __leftSoftkeyActionList.GetCount(); i++)
699 pSoftkeyActionEvent = dynamic_cast<_PublicActionEvent*>(__leftSoftkeyActionList.GetAt(i));
701 if (pSoftkeyActionEvent)
703 pSoftkeyActionEvent->Fire(*tempArg);
709 if (GetCore().GetFooter()->IsButtonSet(RIGHT_BUTTON) && GetSoftkeyActionId(SOFTKEY_1) == actionId)
711 for (int i = 0; i < __rightSoftkeyActionList.GetCount(); i++)
713 pSoftkeyActionEvent = dynamic_cast<_PublicActionEvent*>(__rightSoftkeyActionList.GetAt(i));
715 if (pSoftkeyActionEvent)
717 pSoftkeyActionEvent->Fire(*tempArg);
723 if (GetCore().GetFooter()->IsButtonSet(MIDDLE_BUTTON) && GetOptionkeyActionId() == actionId)
725 if (__pOptionMenuActionEvent)
727 __pOptionMenuActionEvent->Fire(*tempArg);
739 _FormImpl::GetClientAreaCanvasN(void) const
741 return GetCore().GetClientAreaCanvasN();
745 _FormImpl::TranslateToClientAreaPosition(const Point& position) const
747 return GetCore().TranslateToClientAreaPosition(position);
751 _FormImpl::TranslateFromClientAreaPosition(const Point& clientPosition) const
753 return GetCore().TranslateFromClientAreaPosition(clientPosition);
757 _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEventListener)
759 SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
760 __pFormBackEventListener = const_cast <IFormBackEventListener*>(pFormBackEventListener);
761 GetCore().SetFormBackEventListener(this);
762 result r = GetLastResult();
763 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
767 _FormImpl::AddOrientationEventListener(IOrientationEventListener& listener)
769 __pOriAgent->AddListener(listener);
773 _FormImpl::AddOptionkeyActionListener(const IActionEventListener& listener)
775 if (HasOptionkey() == false)
780 __pOptionMenuActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
782 SysTryReturnVoidResult(NID_UI_CTRL, __pOptionMenuActionEvent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
784 __pOptionMenuActionEvent->AddListener(listener);
788 _FormImpl::AddSoftkeyActionListener(Softkey softkey, const IActionEventListener& listener)
790 _Softkey _softkey = ConvertSoftkey(softkey);
792 if (GetCore().CheckSoftkey(_softkey) == false)
797 if (softkey == SOFTKEY_0)
799 __pLeftSoftkeyActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
801 SysTryReturnVoidResult(NID_UI_CTRL, __pLeftSoftkeyActionEvent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
803 __pLeftSoftkeyActionEvent->AddListener(listener);
805 __leftSoftkeyActionList.Add(*__pLeftSoftkeyActionEvent);
807 else if (softkey == SOFTKEY_1)
809 __pRightSoftkeyActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
811 SysTryReturnVoidResult(NID_UI_CTRL, __pRightSoftkeyActionEvent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
813 __pRightSoftkeyActionEvent->AddListener(listener);
815 __rightSoftkeyActionList.Add(*__pRightSoftkeyActionEvent);
820 _FormImpl::RemoveOrientationEventListener(IOrientationEventListener& listener)
822 __pOriAgent->RemoveListener(listener);
826 _FormImpl::RemoveOptionkeyActionListener(const IActionEventListener& listener)
828 if (HasOptionkey() == false)
833 if (__pOptionMenuActionEvent)
835 __pOptionMenuActionEvent->RemoveListener(listener);
840 _FormImpl::RemoveSoftkeyActionListener(Softkey softkey, const IActionEventListener& listener)
842 _Softkey _softkey = ConvertSoftkey(softkey);
844 if (GetCore().CheckSoftkey(_softkey) == false)
849 if (softkey == SOFTKEY_0)
851 if (__pLeftSoftkeyActionEvent)
853 __pLeftSoftkeyActionEvent->RemoveListener(listener);
856 else if (softkey == SOFTKEY_1)
858 if (__pRightSoftkeyActionEvent)
860 __pRightSoftkeyActionEvent->RemoveListener(listener);
866 _FormImpl::SetOrientation(Orientation orientation)
868 __pOriAgent->SetMode(orientation);
872 _FormImpl::GetOrientation(void) const
874 return __pOriAgent->GetMode();
878 _FormImpl::GetOrientationStatus(void) const
880 return __pOriAgent->GetStatus();
884 _FormImpl::UpdateOrientationStatus(bool draw)
886 __pOriAgent->Update(draw);
890 _FormImpl::HasOptionkey(void) const
892 return GetCore().HasOptionkey();
896 _FormImpl::HasSoftkey(Softkey softkey) const
898 _Softkey _softkey = ConvertSoftkey(softkey);
900 return GetCore().HasSoftkey(_softkey);
904 _FormImpl::SetSoftkeyEnabled(Softkey softkey, bool enable)
906 _Softkey _softkey = ConvertSoftkey(softkey);
908 result r = GetCore().SetSoftkeyEnabled(_softkey, enable);
909 SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
915 _FormImpl::IsSoftkeyEnabled(Softkey softkey) const
917 _Softkey _softkey = ConvertSoftkey(softkey);
919 return GetCore().IsSoftkeyEnabled(_softkey);
923 _FormImpl::GetSoftkeyActionId(Softkey softkey) const
925 _Softkey _softkey = ConvertSoftkey(softkey);
927 return GetCore().GetSoftkeyActionId(_softkey);
931 _FormImpl::GetOptionkeyActionId(void) const
933 return GetCore().GetOptionkeyActionId();
937 _FormImpl::GetSoftkeyText(Softkey softkey) const
939 _Softkey _softkey = ConvertSoftkey(softkey);
941 return GetCore().GetSoftkeyText(_softkey);
945 _FormImpl::SetOptionkeyActionId(int actionId)
947 result r = GetCore().SetOptionkeyActionId(actionId);
948 SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
954 _FormImpl::SetSoftkeyActionId(Softkey softkey, int actionId)
956 _Softkey _softkey = ConvertSoftkey(softkey);
958 result r = GetCore().SetSoftkeyActionId(_softkey, actionId);
959 SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
965 _FormImpl::SetSoftkeyText(Softkey softkey, const String& text)
967 _Softkey _softkey = ConvertSoftkey(softkey);
969 result r = GetCore().SetSoftkeyText(_softkey, text);
970 SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
976 _FormImpl::SetSoftkeyIcon(Softkey softkey, const Bitmap& pNormalBitmap, const Bitmap* ppPressedBitmap)
978 _Softkey _softkey = ConvertSoftkey(softkey);
980 result r = GetCore().SetSoftkeyIcon(_softkey, pNormalBitmap, ppPressedBitmap);
981 SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
987 _FormImpl::OnChangeLayout(_ControlOrientation orientation)
989 const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize();
990 const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width);
993 _ContainerImpl::OnChangeLayout(orientation);
994 SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
996 if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
998 SetSize(portraitSize);
1002 SetSize(landscapeSize);
1005 int indicatorheight = 0;
1007 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight);
1008 if (GetCore().HasIndicator())
1010 _Indicator* pIndicator = GetCore().GetIndicator();
1012 pIndicator->SetBounds(Rectangle(0, 0, GetClientBounds().width, indicatorheight));
1013 GetCore().AdjustClientBounds();
1019 if (GetCore().HasHeader())
1021 FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f);
1022 if (GetCore().IsIndicatorVisible())
1024 indicatorFloatBounds = GetCore().GetIndicatorFloatBounds();
1027 FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true));
1028 GetCore().SetHeaderFloatBounds(bounds);
1031 if (GetCore().HasTab()) // Ki-Dong,Hong.Temp
1033 int titleHeight = 0;
1035 if (GetCore().GetFormStyle() & FORM_STYLE_TITLE)
1037 if (GetCore().HasHeader())
1039 _HeaderImpl* pHeaderImpl = GetHeader();
1042 titleHeight = pHeaderImpl->GetBounds().height;
1047 Rectangle indicatorBounds(0, 0, 0, 0);
1049 if (GetCore().IsIndicatorVisible())
1051 indicatorBounds = GetCore().GetIndicatorBounds();
1054 int posY = indicatorBounds.height + titleHeight;
1056 Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight());
1057 GetCore().SetTabBounds(bounds);
1060 if (GetCore().HasFooter())
1062 if (GetCore().GetFooter()->GetVisibleState() && !GetCore().IsFooterTranslucent())
1068 adjHeight = GetCore().GetToolbarHeight(false);
1071 if (!(GetCore().GetFormStyle() & FORM_STYLE_FOOTER || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_1
1072 || GetCore().GetFormStyle() & FORM_STYLE_OPTIONKEY))
1074 adjHeight = GetCore().GetToolbarHeight(false);
1077 Rectangle bounds(0, GetClientBounds().y + GetClientBounds().height - adjHeight,
1078 GetClientBounds().width, GetCore().GetToolbarHeight(false));
1079 GetCore().SetFooterBounds(bounds);
1084 _FormImpl::CreateHeaderN(void)
1086 result r = E_SUCCESS;
1088 Header* pHeader = new (std::nothrow) Header;
1089 SysTryReturn(NID_UI_CTRL, pHeader, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
1091 r = pHeader->Construct();
1092 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
1094 _HeaderImpl* pHeaderImpl = _HeaderImpl::GetInstance(*pHeader);
1096 SetLastResult(E_SUCCESS);
1102 _FormImpl::CreateFooterN(void)
1104 result r = E_SUCCESS;
1106 Footer* pFooter = new (std::nothrow) Footer;
1107 SysTryReturn(NID_UI_CTRL, pFooter, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
1109 r = pFooter->Construct();
1110 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
1112 _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*pFooter);
1114 SetLastResult(E_SUCCESS);
1119 // Ki-Dong,Hong.Temp
1121 _FormImpl::CreateTabImplN(void)
1123 //result r = E_SUCCESS;
1125 //Tab* pTab = new (std::nothrow) Tab;
1126 //SysTryReturn(NID_UI_CTRL, pTab, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
1128 //r = pTab->Construct();
1129 //SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] Unable to consturct tab.");
1131 //return pTab->GetTabImpl();
1132 Tab* pTab = _TabImpl::CreateTabN();
1133 SysTryReturn(NID_UI_CTRL, pTab, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1135 _TabImpl* pTabImpl = _TabImpl::GetInstance(*pTab);
1137 SetLastResult(E_SUCCESS);
1143 _FormImpl::DeflateClientRectHeight(int height)
1145 return GetCore().DeflateClientRectHeight(height);
1149 _FormImpl::RemoveHeader(void)
1151 _HeaderImpl* pHeaderImpl = GetHeader();
1155 __pForm->RemoveHeader();
1156 result r = GetLastResult();
1157 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
1158 Header* pHeader = pHeaderImpl->GetHeader();
1169 _FormImpl::RemoveFooter(void)
1171 _FooterImpl* pFooterImpl = GetFooter();
1175 __pForm->RemoveFooter();
1176 result r = GetLastResult();
1177 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
1178 Footer* pFooter = pFooterImpl->GetFooter();
1190 // Ki-Dong,Hong.Temp
1192 _FormImpl::RemoveTabImpl(void)
1194 _TabImpl* pTabImpl = GetTabImpl();
1198 __pForm->RemoveTab();
1199 result r = GetLastResult();
1200 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
1201 Tab* pTab = pTabImpl->GetTab();
1203 pTabImpl->DeleteTab(pTab);
1214 _FormImpl::GetDataBindingContextN(void) const
1216 return _DataBindingContextImpl::GetDataBindingContextN(*this);
1220 _FormImpl::OnAttaching(const _Control* pParent)
1222 result r = E_SUCCESS;
1223 _Frame* pFrame = dynamic_cast<_Frame*>(const_cast<_Control*>((pParent)));
1224 if (FORM_STYLE_INDICATOR & GetCore().GetFormStyle())
1226 SysTryReturnResult(NID_UI_CTRL, pFrame != null, E_INVALID_ARG, "A Form which has FORM_STYLE_INDICATOR style cannot be added to a container except Frame.");
1228 r = _ControlImpl::OnAttaching(pParent);
1233 _FormImpl::OnAttachedToMainTree(void)
1235 result r = E_SUCCESS;
1238 r = GetCore().AttachedToMainTree();
1239 r = _ContainerImpl::OnAttachedToMainTree();
1241 Rectangle indicatorBounds(0, 0, 0, 0);
1242 FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f);
1244 if (FORM_STYLE_INDICATOR & GetCore().GetFormStyle())
1246 indicatorBounds = GetCore().GetIndicatorBounds();
1247 indicatorFloatBounds = GetCore().GetIndicatorFloatBounds();
1248 r = GetLastResult();
1249 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1252 _HeaderImpl* pHeader = GetHeader();
1253 _FooterImpl* pFooter = GetFooter();
1254 _TabImpl* pTabImpl = GetTabImpl();
1258 FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true));
1259 GetCore().SetHeaderFloatBounds(bounds);
1262 int titleHeight = 0;
1266 titleHeight = pHeader->GetBounds().height;
1271 int posY = indicatorBounds.height + titleHeight;
1273 Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight());
1274 GetCore().SetTabBounds(bounds);
1281 if (!(GetCore().GetFooter()->GetVisibleState()) || GetCore().IsFooterTranslucent())
1283 adjHeight = GetCore().GetToolbarHeight(false);
1286 if (!(GetCore().GetFormStyle() & FORM_STYLE_FOOTER || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_1
1287 || GetCore().GetFormStyle() & FORM_STYLE_OPTIONKEY))
1289 adjHeight = GetCore().GetToolbarHeight(false);
1292 Rectangle clientbounds = GetClientBounds();
1293 Rectangle bounds(0, clientbounds.y + clientbounds.height - adjHeight, clientbounds.width, GetCore().GetToolbarHeight(false));
1295 GetCore().SetFooterBounds(bounds);
1298 UpdateOrientationStatus();
1304 _FormImpl::OnDetachingFromMainTree(void)
1306 result r = E_SUCCESS;
1307 r = GetCore().DetachingFromMainTree();
1308 r = _ContainerImpl::OnDetachingFromMainTree();
1314 _FormImpl::OnFormBackRequested(Tizen::Ui::Controls::_Form& source)
1316 if (__pFormBackEventListener)
1318 _FormImpl* pFormImpl = static_cast<_FormImpl*>(source.GetUserData());
1319 Form* pForm = dynamic_cast <Form*>(&pFormImpl->GetPublic());
1322 __pFormBackEventListener->OnFormBackRequested(*pForm);
1332 _FormImpl::IsOpaque(void) const
1338 _FormImpl::ConvertSoftkey(Softkey softkey) const
1342 if (softkey == SOFTKEY_0)
1344 _softkey = _SOFTKEY_0;
1346 else if (softkey == SOFTKEY_1)
1348 _softkey = _SOFTKEY_1;
1352 _softkey = _SOFTKEY_COUNT;
1359 : public _UiBuilderControlMaker
1362 _FormMaker(_UiBuilder* uibuilder)
1363 : _UiBuilderControlMaker(uibuilder){};
1364 virtual ~_FormMaker()
1367 static _UiBuilderControlMaker* GetInstance(_UiBuilder* uibuilder)
1369 _FormMaker* pFormMaker = new (std::nothrow) _FormMaker(uibuilder);
1373 virtual Control* Make(_UiBuilderControl* pControl)
1375 _UiBuilderControlLayout* pControlProperty = null;
1376 result r = E_SUCCESS;
1379 Tizen::Base::String elementString;
1380 bool isTitleAlign = false;
1383 HorizontalAlignment align = ALIGNMENT_CENTER;
1384 Form* pForm = (Form*) GetContainer();
1386 // Get control manager
1387 _ControlManager* pControlManager = _ControlManager::GetInstance();
1388 if (pControlManager == null)
1390 SysLog(NID_UI_CTRL, "Unable to get the control manager.n");
1393 Dimension screenSize = pControlManager->GetScreenSize();
1396 (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->SetRect(0, 0, screenSize.width, screenSize.height);
1397 (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->SetRect(0, 0, screenSize.height, screenSize.width);
1399 // Get device orientation
1400 app_device_orientation_e deviceOrientation = app_get_device_orientation();
1401 bool isHorizontal = (deviceOrientation == APP_DEVICE_ORIENTATION_90) || (deviceOrientation == APP_DEVICE_ORIENTATION_270);
1405 pControlProperty = pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE);
1409 pControlProperty = pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT);
1412 if (pControlProperty == null)
1414 SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Can't read attributes");
1418 pControlProperty = pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT);
1419 Tizen::Base::String styleString;
1420 styleString = pControlProperty->GetStyle();
1422 if (styleString.Contains(L"FORM_STYLE_TITLE"))
1424 style |= FORM_STYLE_TITLE;
1426 if (styleString.Contains(L"FORM_STYLE_SOFTKEY_0"))
1428 style |= FORM_STYLE_SOFTKEY_0;
1430 if (styleString.Contains(L"FORM_STYLE_SOFTKEY_1"))
1432 style |= FORM_STYLE_SOFTKEY_1;
1434 if (styleString.Contains(L"FORM_STYLE_OPTIONKEY"))
1436 style |= FORM_STYLE_OPTIONKEY;
1438 if (styleString.Contains(L"FORM_STYLE_INDICATOR"))
1440 style |= FORM_STYLE_INDICATOR;
1442 if (styleString.Contains(L"FORM_STYLE_TEXT_TAB"))
1444 style |= FORM_STYLE_TEXT_TAB;
1446 if (styleString.Contains(L"FORM_STYLE_ICON_TAB"))
1448 style |= FORM_STYLE_ICON_TAB;
1450 if (styleString.Contains(L"FORM_STYLE_HEADER"))
1452 style |= FORM_STYLE_HEADER;
1454 if (styleString.Contains(L"FORM_STYLE_FOOTER"))
1456 style |= FORM_STYLE_FOOTER;
1459 _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE;
1460 GetLayoutType(pControlProperty, layoutType);
1461 if (layoutType == UIBUILDER_LAYOUT_NONE)
1464 r = pForm->Construct(style);
1468 Layout* pPortraitLayout = null;
1469 Layout* pLandscapeLayout = null;
1470 result tempResult = E_SUCCESS;
1471 tempResult = GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout);
1472 if (E_SUCCESS == tempResult)
1474 r = pForm->Construct(*pPortraitLayout, *pLandscapeLayout, style);
1481 _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE;
1483 if (GetLayoutType(pControlProperty, layoutType) == false)
1488 if ( layoutType == UIBUILDER_LAYOUT_GRID)
1490 for (int i = 0; i < UIBUILDER_ATTRIBUTE_NUM; i++)
1492 GridLayout* pGridLayout = null;
1493 pControlProperty = pControl->GetAttribute(i);
1495 if ( i == UIBUILDER_ATTRIBUTE_PORTRAIT)
1497 pGridLayout = dynamic_cast<GridLayout*>(pPortraitLayout);
1501 pGridLayout = dynamic_cast<GridLayout*>(pLandscapeLayout);
1503 SetGridLayoutContainerProperty(pGridLayout, pControlProperty);
1506 delete pPortraitLayout;
1507 if (pPortraitLayout != pLandscapeLayout)
1509 delete pLandscapeLayout;
1515 SysLog(NID_UI_CTRL, "Failed to create Form.");
1520 if (pControl->GetElement(L"titleAlign", elementString))
1522 if (elementString.Equals(L"ALIGN_CENTER", false))
1524 align = ALIGNMENT_CENTER;
1526 else if (elementString.Equals(L"ALIGN_RIGHT", false))
1528 align = ALIGNMENT_RIGHT;
1532 align = ALIGNMENT_LEFT;
1534 isTitleAlign = true;
1537 if (pControl->GetElement(L"title", elementString))
1541 pForm->SetTitleText(elementString, align);
1545 pForm->SetTitleText(elementString);
1552 pForm->SetTitleText(L"", align);
1556 pForm->SetTitleText(L"");
1560 if (pControl->GetElement(L"titleIcon", elementString))
1562 Bitmap* pBitmap = null;
1563 pBitmap = LoadBitmapN(elementString);
1564 if (pBitmap != null)
1566 r = pForm->SetTitleIcon(pBitmap);
1570 SysLog(NID_UI_CTRL, "Failed to set TitleIcon.");
1575 if (pControl->GetElement(L"softKey0Text", elementString))
1577 pForm->SetSoftkeyText(SOFTKEY_0, elementString);
1579 if (pControl->GetElement(L"softKey1Text", elementString))
1581 pForm->SetSoftkeyText(SOFTKEY_1, elementString);
1583 if (pControl->GetElement(L"backgroundColorOpacity", elementString) || pControl->GetElement(L"BGColorOpacity", elementString))
1585 Base::Integer::Parse(elementString, opacity);
1587 if (pControl->GetElement(L"backgroundColor", elementString) || pControl->GetElement(L"BGColor", elementString))
1589 ConvertStringToColor32(elementString, opacity, color);
1590 pForm->SetBackgroundColor(color);
1595 r = GET_COLOR_CONFIG(FORM::BG_NORMAL,color);
1598 pForm->SetBackgroundColor(color);
1602 pForm->SetBackgroundColor(0xff000000);
1606 if (pControl->GetElement(L"softKey0Icon", elementString) || pControl->GetElement(L"softKey0NormalIcon", elementString))
1608 Bitmap* pNormalBitmap = null;
1609 Bitmap* pPressedBitmap = null;
1610 pNormalBitmap = LoadBitmapN(elementString); //__image->DecodeN(path,BITMAP_PIXEL_FORMAT_RGB565);
1612 if (pNormalBitmap != null)
1614 if (pControl->GetElement(L"softKey0PressedIcon", elementString))
1616 pPressedBitmap = LoadBitmapN(elementString);
1619 if (pPressedBitmap != null)
1621 pForm->SetSoftkeyIcon(SOFTKEY_0, *pNormalBitmap, pPressedBitmap);
1622 delete pNormalBitmap;
1623 delete pPressedBitmap;
1627 pForm->SetSoftkeyIcon(SOFTKEY_0, *pNormalBitmap, null);
1628 delete pNormalBitmap;
1632 if (pControl->GetElement(L"softKey1Icon", elementString) || pControl->GetElement(L"softKey1NormalIcon", elementString))
1634 Bitmap* pNormalBitmap = null;
1635 Bitmap* pPressedBitmap = null;
1636 pNormalBitmap = LoadBitmapN(elementString); //__image->DecodeN(path,BITMAP_PIXEL_FORMAT_RGB565);
1638 if (pNormalBitmap != null)
1640 if (pControl->GetElement(L"softKey1PressedIcon", elementString))
1642 pPressedBitmap = LoadBitmapN(elementString); // __image->DecodeN(path,BITMAP_PIXEL_FORMAT_RGB565);
1645 if (pPressedBitmap != null)
1647 pForm->SetSoftkeyIcon(SOFTKEY_1, *pNormalBitmap, pPressedBitmap);
1648 delete pNormalBitmap;
1649 delete pPressedBitmap;
1653 pForm->SetSoftkeyIcon(SOFTKEY_1, *pNormalBitmap, null);
1654 delete pNormalBitmap;
1659 if (pControl->GetElement(L"Orientation", elementString) || pControl->GetElement(L"orientation", elementString))
1662 //ORIENTATION_PORTRAIT,
1663 //ORIENTATION_LANDSACPE,
1664 //ORIENTATION_PORTRAIT_REVERSE,
1665 //ORIENTATION_LANDSACPE_REVERSE,
1666 //ORIENTATION_AUTO = 6,
1667 //ORIENTATION_AUTO_FOUR_DIRECTION = 8,
1669 if (elementString.Equals(L"Automatic:2Dir", false) || elementString.Equals(L"Automatic", false))
1671 pForm->SetOrientation(ORIENTATION_AUTOMATIC);
1673 else if (elementString.Equals(L"Automatic:4Dir", false))
1675 pForm->SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
1677 else if (elementString.Equals(L"Landscape", false))
1679 pForm->SetOrientation(ORIENTATION_LANDSCAPE);
1680 SetUiBuilderRotateState(UIBUIDER_SCREEN_HORIZONTAL);
1682 else if (elementString.Equals(L"Landscape:Reverse", false))
1684 pForm->SetOrientation(ORIENTATION_LANDSCAPE_REVERSE);
1685 SetUiBuilderRotateState(UIBUIDER_SCREEN_HORIZONTAL);
1687 else if (elementString.Equals(L"Portrait", false))
1689 pForm->SetOrientation(ORIENTATION_PORTRAIT);
1690 SetUiBuilderRotateState(UIBUIDER_SCREEN_VERTICAL);
1692 else if (elementString.Equals(L"Portrait:Reverse", false))
1694 pForm->SetOrientation(ORIENTATION_PORTRAIT_REVERSE);
1695 SetUiBuilderRotateState(UIBUIDER_SCREEN_VERTICAL);
1699 if (style & FORM_STYLE_HEADER)
1701 if (pControl->GetElement(L"translucentHeader", elementString))
1703 if (elementString.Equals(L"true", false))
1705 pForm->SetActionBarsTranslucent(FORM_ACTION_BAR_HEADER, true);
1710 if (style & FORM_STYLE_FOOTER)
1712 if (pControl->GetElement(L"translucentFooter", elementString))
1714 if (elementString.Equals(L"true", false))
1716 pForm->SetActionBarsTranslucent(FORM_ACTION_BAR_FOOTER, true);
1721 if (style & FORM_STYLE_INDICATOR)
1723 if (pControl->GetElement(L"translucentIndicator", elementString))
1725 if (elementString.Equals(L"true", false))
1727 pForm->SetActionBarsTranslucent(FORM_ACTION_BAR_INDICATOR, true);
1737 _FormRegister::_FormRegister()
1739 _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1740 pUiBuilderControlTableManager->RegisterControl(L"Form", _FormMaker::GetInstance);
1742 _FormRegister::~_FormRegister()
1744 _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1745 pUiBuilderControlTableManager->UnregisterControl(L"Form");
1747 static _FormRegister FormRegisterToUiBuilder;
1748 }}} // Tizen::Ui::Controls