Fixed Add AUTO-HIDE style to FormMaker
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_FormImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 #include <app.h>
19 #include <new>
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_LayoutLayoutMaker.h"
32 #include "FUi_EcoreEvasMgr.h"
33 #include "FUi_EcoreEvas.h"
34 #include "FUi_ControlImplManager.h"
35 #include "FUi_OrientationAgent.h"
36 #include "FUi_ImeOrientationAgent.h"
37 #include "FUi_UiBuilder.h"
38 #include "FUi_CoordinateSystemUtils.h"
39 #include "FUi_DataBindingContextImpl.h"
40 #include "FUi_ResourceSizeInfo.h"
41 #include "FUi_ResourceManager.h"
42 #include "FUiAnim_VisualElement.h"
43 #include "FUiCtrl_FormImpl.h"
44 #include "FUiCtrl_HeaderImpl.h"
45 #include "FUiCtrl_FooterImpl.h"
46 #include "FUiCtrl_Form.h"
47 #include "FUiCtrl_Frame.h"
48 #include "FUiCtrl_FrameImpl.h"
49 #include "FUiCtrl_TabImpl.h"
50 #include "FUiCtrl_Indicator.h"
51
52 using namespace Tizen::App;
53 using namespace Tizen::Base;
54 using namespace Tizen::Base::Runtime;
55 using namespace Tizen::Base::Collection;
56 using namespace Tizen::Graphics;
57 using namespace Tizen::Ui;
58 using namespace Tizen::Ui::Animations;
59
60 #define OPTIONKEY       SOFTKEY_COUNT
61
62 namespace Tizen { namespace Ui { namespace Controls
63 {
64
65 const String _REQUEST_ORIENTATION_EVENT = L"RequestOrientationEvent";
66
67 Dimension
68 _FormImpl::FormSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const
69 {
70         result r = E_SUCCESS;
71         Dimension dimension(0, 0);
72         SetLastResult(r);
73
74         return dimension;
75 }
76
77 FloatDimension
78 _FormImpl::FormSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const
79 {
80         result r = E_SUCCESS;
81         FloatDimension dimension(0.0f, 0.0f);
82         SetLastResult(r);
83
84         return dimension;
85 }
86
87 const _FormImpl*
88 _FormImpl::GetInstance(const Form& form)
89 {
90         return static_cast<const _FormImpl*> (form._pControlImpl);
91 }
92
93 _FormImpl*
94 _FormImpl::GetInstance(Form& form)
95 {
96         return static_cast<_FormImpl*> (form._pControlImpl);
97 }
98
99 _FormImpl::_FormImpl(Form* pPublic, _Form* pCore, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout)
100         : _ContainerImpl(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout)
101         , __pForm(null)
102         , __pFormBackEventListener(null)
103         , __pOriAgent(null)
104         , __pImeOriAgent(null)
105         , __pLeftSoftkeyActionEvent(null)
106         , __pRightSoftkeyActionEvent(null)
107         , __pOptionMenuActionEvent(null)
108 {
109         __pForm = pCore;
110
111         int appType = _AppInfo::GetAppType();
112         if (appType == _APP_TYPE_IME_APP)
113         {
114                 __pImeOriAgent = _ImeOrientationAgent::CreateInstanceN(*pPublic);
115                 SysTryReturnVoidResult(NID_UI_CTRL, __pImeOriAgent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
116         }
117         else
118         {
119                 __pOriAgent = _OrientationAgent::CreateInstanceN(*pPublic);
120                 SysTryReturnVoidResult(NID_UI_CTRL, __pOriAgent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
121         }
122 }
123
124 _FormImpl::~_FormImpl(void)
125 {
126         if (__pImeOriAgent)
127         {
128                 delete __pImeOriAgent;
129                 __pImeOriAgent = null;
130         }
131
132         if (__pOriAgent)
133         {
134                 delete __pOriAgent;
135                 __pOriAgent = null;
136         }
137
138         if (__pLeftSoftkeyActionEvent)
139         {
140                 delete __pLeftSoftkeyActionEvent;
141                 __pLeftSoftkeyActionEvent = null;
142         }
143
144         if (__pRightSoftkeyActionEvent)
145         {
146                 delete __pRightSoftkeyActionEvent;
147                 __pRightSoftkeyActionEvent = null;
148         }
149
150         if (__pOptionMenuActionEvent)
151         {
152                 delete __pOptionMenuActionEvent;
153                 __pOptionMenuActionEvent = null;
154         }
155
156         __leftSoftkeyActionList.RemoveAll(false);
157         __rightSoftkeyActionList.RemoveAll(false);
158
159         RemoveHeader();
160         RemoveFooter();
161         RemoveTabImpl();
162
163         __pForm = null;
164
165         ClearLastResult();
166 }
167
168 _FormImpl*
169 _FormImpl::CreateFormImplN(Form* pControl, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout)
170 {
171         result r = E_SUCCESS;
172         _VisualElement* pVisualElement = null;
173
174         _Form* pCore = _Form::CreateFormN();
175         r = GetLastResult();
176         SysTryReturn(NID_UI_CTRL, pCore, null, r, "[%s] Propagating.", GetErrorMessage(r)); // [ToDo] interpret last result.
177
178         _FormImpl* pImpl = new (std::nothrow) _FormImpl(pControl, pCore, pPublicPortraitLayout, pPublicLandscapeLayout);
179
180         r = _ControlImpl::CheckConstruction(pCore, pImpl);
181         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
182
183         const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
184         const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
185
186         _ControlOrientation orientation = pCore->GetOrientation();
187
188         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
189         {
190                 r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Form), portraitSize, orientation);
191         }
192         else
193         {
194                 r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Form), landscapeSize, orientation);
195         }
196         SysAssert(r == E_SUCCESS);
197
198         // Make surface opaque.
199         pVisualElement = pCore->GetVisualElement();
200         SysTryCatch(NID_UI_CTRL, pVisualElement, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
201         r = pVisualElement->SetSurfaceOpaque(true);
202         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); // [ToDo] interpret last result.
203
204         SetLastResult(E_SUCCESS);
205
206         return pImpl;
207
208 CATCH:
209         delete pCore;
210         delete pImpl;
211
212         return null;
213 }
214
215 const char*
216 _FormImpl::GetPublicClassName(void) const
217 {
218         return "Tizen::Ui::Controls::Form";
219 }
220
221 const Form&
222 _FormImpl::GetPublic(void) const
223 {
224         return static_cast<const Form&>(_ControlImpl::GetPublic());
225 }
226
227 Form&
228 _FormImpl::GetPublic(void)
229 {
230         return static_cast<Form&>(_ControlImpl::GetPublic());
231 }
232
233 const _Form&
234 _FormImpl::GetCore(void) const
235 {
236         return static_cast<const _Form&>(_ControlImpl::GetCore());
237 }
238
239 _Form&
240 _FormImpl::GetCore(void)
241 {
242         return static_cast<_Form&>(_ControlImpl::GetCore());
243 }
244
245 _ControlImpl*
246 _FormImpl::GetFocusControl(void)
247 {
248         return null;
249 }
250
251 unsigned long
252 _FormImpl::GetFormStyle(void) const
253 {
254         return GetCore().GetFormStyle();
255 }
256
257 bool
258 _FormImpl::HasIndicator(void) const
259 {
260         return GetCore().HasIndicator();
261 }
262
263 void
264 _FormImpl::SetFormStyle(unsigned long formStyle)
265 {
266         result r = E_SUCCESS;
267
268         _HeaderImpl* pHeader = GetHeader();
269         _FooterImpl* pFooter = GetFooter();
270         _TabImpl* pTabImpl = GetTabImpl();
271
272         if (IsAttachedToMainTree())
273         {
274                 if (FORM_STYLE_INDICATOR & formStyle)
275                 {
276                         _Frame* pFrame = dynamic_cast<_Frame*>(GetCore().GetParent());
277                         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.");
278                 }
279         }
280
281         if ((formStyle & FORM_STYLE_INDICATOR) && (formStyle & FORM_STYLE_INDICATOR_AUTO_HIDE))
282         {
283                 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.");
284                 return;
285         }
286
287         // check formstyle
288         if (((formStyle & FORM_STYLE_TITLE) || (formStyle & FORM_STYLE_TEXT_TAB) || (formStyle & FORM_STYLE_ICON_TAB)) && (formStyle & FORM_STYLE_HEADER))
289         {
290                 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.");
291
292                 // remove Header
293                 if (pHeader)
294                 {
295                         RemoveHeader();
296                         r = GetLastResult();
297                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
298                 }
299
300                 return;
301         }
302
303         if (((formStyle & FORM_STYLE_SOFTKEY_0) || (formStyle & FORM_STYLE_SOFTKEY_1) || (formStyle & FORM_STYLE_OPTIONKEY)) && (formStyle & FORM_STYLE_FOOTER))
304         {
305                 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.");
306
307                 // remove Footer
308                 if (pFooter)
309                 {
310                         RemoveFooter();
311                         r = GetLastResult();
312                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
313                 }
314                 return;
315         }
316
317         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
318         SysTryReturnVoidResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
319
320         GetCore().SetFormStyle(formStyle);
321
322         FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
323
324         if (FORM_STYLE_INDICATOR & formStyle)
325         {
326                 GetCore().SetIndicatorShowState(true);
327                 indicatorBounds = GetCore().GetIndicatorBoundsF();
328                 r = GetLastResult();
329                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
330
331         }
332         else if(FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle)
333         {
334                 r = GetCore().SetIndicatorShowState(false, true);
335                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
336         }
337         else
338         {
339                 r = GetCore().SetIndicatorShowState(false);
340                 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
341         }
342
343         if (formStyle & FORM_STYLE_HEADER)
344         {
345                 if (!pHeader)
346                 {
347                         pHeader = CreateHeaderN();
348                         SysTryReturnVoidResult(NID_UI_CTRL, pHeader != null, r, "[%s] Propagating.", GetErrorMessage(r));
349
350                         GetCore().SetHeader(&pHeader->GetCore());
351                         GetCore().AdjustClientBounds();
352
353                         if (GetCore().IsIndicatorTranslucent())
354                         {
355                                 if (!GetCore().IsHeaderTranslucent())
356                                 {
357                                         indicatorBounds.height = 0.0f;
358                                 }
359                                 else
360                                 {
361                                         if (GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
362                                         {
363                                                 indicatorBounds.height = 0.0f;
364                                         }
365                                 }
366                         }
367
368                         FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
369                         GetCore().SetHeaderBounds(bounds);
370
371                         r = GetCore().AttachSystemChild(pHeader->GetCore());
372                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
373
374                         GetCore().SetFormBackEventListener(this);
375                 }
376         }
377         else if (formStyle & FORM_STYLE_TITLE)
378         {
379                 if (!pHeader)
380                 {
381                         pHeader = CreateHeaderN();
382                         SysTryReturnVoidResult(NID_UI_CTRL, pHeader != null, r, "[%s] Propagating.", GetErrorMessage(r));
383
384                         GetCore().SetHeader(&pHeader->GetCore());
385                         GetCore().AdjustClientBounds();
386
387                         FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
388                         GetCore().SetHeaderBounds(bounds);
389
390                         r = GetCore().AttachSystemChild(pHeader->GetCore());
391                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
392                 }
393         }
394         else
395         {
396                 // remove Header
397                 if (pHeader)
398                 {
399                         RemoveHeader();
400                         r = GetLastResult();
401                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
402                 }
403         }
404
405         if (formStyle & FORM_STYLE_TEXT_TAB)
406         {
407                 float titleHeight = 0.0f;
408
409                 if (formStyle & FORM_STYLE_TITLE)
410                 {
411                         if (pHeader)
412                         {
413                                 titleHeight = pHeader->GetBoundsF().height;
414                         }
415                 }
416
417                 if (!pTabImpl)
418                 {
419                         pTabImpl = CreateTabImplN();
420                         SysTryReturnVoidResult(NID_UI_CTRL, pTabImpl != null, r, "[%s] Propagating.", GetErrorMessage(r));
421
422                         float posY = indicatorBounds.height + titleHeight;
423
424                         GetCore().SetTab(&pTabImpl->GetCore());
425                         GetCore().AdjustClientBounds();
426
427                         FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF());
428                         GetCore().SetTabBounds(bounds);
429
430                         r = GetCore().AttachSystemChild(pTabImpl->GetCore());
431                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
432                 }
433                 GetCore().SetTabStyle(_TAB_STYLE_TEXT);
434         }
435         else if (formStyle & FORM_STYLE_ICON_TAB)
436         {
437                 float titleHeight = 0.0f;
438
439                 if (formStyle & FORM_STYLE_TITLE)
440                 {
441                         if (pHeader)
442                         {
443                                 titleHeight = pHeader->GetBoundsF().height;
444                         }
445                 }
446
447                 if (!pTabImpl)
448                 {
449                         pTabImpl = CreateTabImplN();
450                         SysTryReturnVoidResult(NID_UI_CTRL, pTabImpl != null, r, "[%s] Propagating.", GetErrorMessage(r));
451
452                         float posY = indicatorBounds.height + titleHeight;
453
454                         GetCore().SetTab(&pTabImpl->GetCore());
455                         GetCore().AdjustClientBounds();
456
457                         FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF());
458                         GetCore().SetTabBounds(bounds);
459
460                         r = GetCore().AttachSystemChild(pTabImpl->GetCore());
461                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
462                 }
463                 GetCore().SetTabStyle(_TAB_STYLE_ICON);
464         }
465         else
466         {
467                 if (pTabImpl)
468                 {
469                         RemoveTabImpl();
470                         r = GetLastResult();
471                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
472                 }
473         }
474
475         if (formStyle & FORM_STYLE_FOOTER)
476         {
477                 if (!pFooter)
478                 {
479                         pFooter = CreateFooterN();
480                         SysTryReturnVoidResult(NID_UI_CTRL, pFooter != null, r, "[%s] Propagating.", GetErrorMessage(r));
481
482                         GetCore().SetFooter(&pFooter->GetCore());
483                         GetCore().AdjustClientBounds();
484
485                         FloatRectangle clientbounds = GetClientBoundsF();
486                         FloatRectangle bounds(0.0f, clientbounds.y + clientbounds.height, clientbounds.width, GetCore().GetToolbarHeightF(false));
487
488                         GetCore().SetFooterBounds(bounds);
489
490                         r = GetCore().AttachSystemChild(pFooter->GetCore());
491                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
492                         //[ToDo]
493                         GetCore().SetFormBackEventListener(this);
494                 }
495         }
496         else if (formStyle & FORM_STYLE_SOFTKEY_0 || formStyle & FORM_STYLE_SOFTKEY_1 || formStyle & FORM_STYLE_OPTIONKEY)
497         {
498                 if (pFooter)
499                 {
500                         RemoveFooter();
501                         r = GetLastResult();
502                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
503                 }
504
505                 pFooter = GetFooter();
506
507                 if (!pFooter)
508                 {
509                         pFooter = CreateFooterN();
510                         SysTryReturnVoidResult(NID_UI_CTRL, pFooter != null, r, "[%s] Propagating.", GetErrorMessage(r));
511
512                         GetCore().SetFooter(&pFooter->GetCore());
513                         GetCore().AdjustClientBounds();
514
515                         FloatRectangle clientbounds = GetClientBoundsF();
516                         FloatRectangle bounds(0.0f, clientbounds.y + clientbounds.height - GetCore().GetToolbarHeightF(false), clientbounds.width, GetCore().GetToolbarHeightF(false));
517
518                         GetCore().SetFooterBounds(bounds);
519
520                         r = GetCore().AttachSystemChild(pFooter->GetCore());
521                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
522
523                         GetCore().CreateSoftkey(formStyle);
524
525                         pFooter->GetCore().AddActionEventListener(*this);
526                 }
527         }
528         else
529         {
530                 // remove Footer
531                 if (pFooter)
532                 {
533                         RemoveFooter();
534                         r = GetLastResult();
535                         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
536                         GetCore().AdjustClientBounds();
537                 }
538         }
539
540         GetCore().AdjustClientBounds();
541
542         SetLastResult(E_SUCCESS);
543
544         return;
545 }
546
547 _FooterImpl*
548 _FormImpl::GetFooter(void) const
549 {
550         _Toolbar* pToolbar = __pForm->GetFooter();
551         if (pToolbar == null)
552         {
553                 return null;
554         }
555
556         _FooterImpl* pFooterImpl = static_cast<_FooterImpl*>(pToolbar->GetUserData());
557
558         return pFooterImpl;
559 }
560
561 _HeaderImpl*
562 _FormImpl::GetHeader(void) const
563 {
564         _Toolbar* pToolbar = __pForm->GetHeader();
565         if (pToolbar == null)
566         {
567                 return null;
568         }
569
570         _HeaderImpl* pHeaderImpl = static_cast<_HeaderImpl*>(pToolbar->GetUserData());
571
572         return pHeaderImpl;
573 }
574
575 // Ki-Dong,Hong.Temp
576 _TabImpl*
577 _FormImpl::GetTabImpl(void) const
578 {
579         _Tab* pTab = __pForm->GetTab();
580         if (pTab == null)
581         {
582                 return null;
583         }
584
585         _TabImpl* pTabImpl = static_cast<_TabImpl*>(pTab->GetUserData());
586
587         return pTabImpl;
588 }
589
590 String
591 _FormImpl::GetTitleText(void) const
592 {
593         return GetCore().GetTitleText();
594 }
595
596 HorizontalAlignment
597 _FormImpl::GetTitleTextHorizontalAlignment(void) const
598 {
599         return GetCore().GetTitleTextHorizontalAlignment();
600 }
601
602 bool
603 _FormImpl::HasFooter(void) const
604 {
605         return GetCore().HasFooter();
606 }
607
608 bool
609 _FormImpl::HasHeader(void) const
610 {
611         return GetCore().HasHeader();
612 }
613
614 bool
615 _FormImpl::HasTitle(void) const
616 {
617         return GetCore().HasTitle();
618 }
619
620 bool
621 _FormImpl::HasTab(void) const
622 {
623         return GetCore().HasTab();
624 }
625
626 bool
627 _FormImpl::IsIndicatorVisible(void) const
628 {
629         return GetCore().IsIndicatorVisible();
630 }
631
632 bool
633 _FormImpl::IsHeaderVisible(void) const
634 {
635         return GetCore().IsHeaderVisible();
636 }
637
638 bool
639 _FormImpl::IsFooterVisible(void) const
640 {
641         return GetCore().IsFooterVisible();
642 }
643
644 bool
645 _FormImpl::IsIndicatorTranslucent(void) const
646 {
647         return GetCore().IsIndicatorTranslucent();
648 }
649
650 bool
651 _FormImpl::IsHeaderTranslucent(void) const
652 {
653         return GetCore().IsHeaderTranslucent();
654 }
655
656 bool
657 _FormImpl::IsFooterTranslucent(void) const
658 {
659         return GetCore().IsFooterTranslucent();
660 }
661
662 // Ki-Dong,Hong.Temp
663 bool
664 _FormImpl::IsTabTranslucent(void) const
665 {
666         return GetCore().IsTabTranslucent();
667 }
668
669 result
670 _FormImpl::SetActionBarsTranslucent(unsigned long actionBars, bool translucent)
671 {
672         return GetCore().SetActionBarsTranslucent(actionBars, translucent);
673 }
674
675 result
676 _FormImpl::SetActionBarsVisible(unsigned long actionBars, bool visible)
677 {
678         return GetCore().SetActionBarsVisible(actionBars, visible);
679 }
680
681 result
682 _FormImpl::SetTitleIcon(const Bitmap* pTitleBitmap)
683 {
684         return GetCore().SetTitleIcon(pTitleBitmap);
685 }
686
687 result
688 _FormImpl::SetTitleText(const String& title, HorizontalAlignment alignment)
689 {
690         return GetCore().SetTitleText(title, alignment);
691 }
692
693 OverlayRegion*
694 _FormImpl::GetOverlayRegionN(const Rectangle& rect, OverlayRegionType regionType)
695 {
696         return GetCore().GetOverlayRegionN(rect, regionType);
697 }
698
699 OverlayRegion*
700 _FormImpl::GetOverlayRegionN(const FloatRectangle& rect, OverlayRegionType regionType)
701 {
702         return GetCore().GetOverlayRegionN(rect, regionType);
703 }
704
705 void
706 _FormImpl::OnDraw(void)
707 {
708         if (__pOriAgent)
709         {
710                 __pOriAgent->FireOrientationEvent();
711         }
712
713         _ContainerImpl::OnDraw();
714 }
715
716 bool
717 _FormImpl::OnKeyReleased(const _ControlImpl& source, _KeyCode keyCode)
718 {
719         switch (keyCode)
720         {
721         case _KEY_BACKSPACE:
722                 if (GetCore().GetFooter() || GetCore().GetHeader())
723                 {
724                         if (__pFormBackEventListener)
725                         {
726                                 Form* pForm = dynamic_cast <Form*>(&GetPublic());
727                                 if (pForm)
728                                 {
729                                         __pFormBackEventListener->OnFormBackRequested(*pForm);
730                                 }
731                         }
732                         else
733                         {
734                                 break;
735                         }
736                 }
737                 else
738                 {
739                         break;
740                 }
741                 break;
742
743         default:
744                 return false;
745         }
746
747         return true;
748 }
749
750 void
751 _FormImpl::OnActionPerformed(const _Control& source, int actionId)
752 {
753         if (GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetFormStyle() & FORM_STYLE_SOFTKEY_1 || GetFormStyle() & FORM_STYLE_OPTIONKEY)
754         {
755                 Tizen::Base::Runtime::IEventArg* tempArg = null;
756                 tempArg = _PublicActionEvent::CreateActionEventArgN(actionId);
757                 SysTryReturnVoidResult(NID_UI_CTRL, tempArg , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create Eventarg.");
758                 bool fired = true;
759
760                 _PublicActionEvent* pSoftkeyActionEvent = null;
761
762                 if (GetCore().GetFooter()->IsButtonSet(LEFT_BUTTON) && GetSoftkeyActionId(SOFTKEY_0) == actionId)
763                 {
764                         for (int i = 0; i < __leftSoftkeyActionList.GetCount(); i++)
765                         {
766                                 pSoftkeyActionEvent = dynamic_cast<_PublicActionEvent*>(__leftSoftkeyActionList.GetAt(i));
767
768                                 if (pSoftkeyActionEvent)
769                                 {
770                                         pSoftkeyActionEvent->Fire(*tempArg);
771                                         fired = false;
772                                 }
773                         }
774                 }
775
776                 if (GetCore().GetFooter()->IsButtonSet(RIGHT_BUTTON) && GetSoftkeyActionId(SOFTKEY_1) == actionId)
777                 {
778                         for (int i = 0; i < __rightSoftkeyActionList.GetCount(); i++)
779                         {
780                                 pSoftkeyActionEvent = dynamic_cast<_PublicActionEvent*>(__rightSoftkeyActionList.GetAt(i));
781
782                                 if (pSoftkeyActionEvent)
783                                 {
784                                         pSoftkeyActionEvent->Fire(*tempArg);
785                                         fired = false;
786                                 }
787                         }
788                 }
789
790                 if (GetCore().GetFooter()->IsButtonSet(MIDDLE_BUTTON) && GetOptionkeyActionId() == actionId)
791                 {
792                         if (__pOptionMenuActionEvent)
793                         {
794                                 __pOptionMenuActionEvent->Fire(*tempArg);
795                                 fired = false;
796                         }
797                 }
798                 if (fired)
799                 {
800                         delete tempArg;
801                 }
802         }
803 }
804
805 Canvas*
806 _FormImpl::GetClientAreaCanvasN(void) const
807 {
808         return GetCore().GetClientAreaCanvasN();
809 }
810
811 Point
812 _FormImpl::TranslateToClientAreaPosition(const Point& position) const
813 {
814         return GetCore().TranslateToClientAreaPosition(position);
815 }
816
817 FloatPoint
818 _FormImpl::TranslateToClientAreaPosition(const FloatPoint& position) const
819 {
820         return GetCore().TranslateToClientAreaPosition(position);
821 }
822
823 Point
824 _FormImpl::TranslateFromClientAreaPosition(const Point& clientPosition) const
825 {
826         return GetCore().TranslateFromClientAreaPosition(clientPosition);
827 }
828
829 FloatPoint
830 _FormImpl::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const
831 {
832         return GetCore().TranslateFromClientAreaPosition(clientPosition);
833 }
834
835 void
836 _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEventListener)
837 {
838         SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
839         __pFormBackEventListener = const_cast <IFormBackEventListener*>(pFormBackEventListener);
840         GetCore().SetFormBackEventListener(this);
841         result r = GetLastResult();
842         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
843 }
844
845 void
846 _FormImpl::AddOrientationEventListener(IOrientationEventListener& listener)
847 {
848         if (__pOriAgent)
849         {
850                 __pOriAgent->AddListener(listener);
851         }
852         else if (__pImeOriAgent)
853         {
854                 __pImeOriAgent->AddListener(listener);
855         }
856 }
857
858 void
859 _FormImpl::AddOptionkeyActionListener(const IActionEventListener& listener)
860 {
861         if (HasOptionkey() == false)
862         {
863                 return ;
864         }
865
866         __pOptionMenuActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
867
868         SysTryReturnVoidResult(NID_UI_CTRL, __pOptionMenuActionEvent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
869
870         __pOptionMenuActionEvent->AddListener(listener);
871 }
872
873 void
874 _FormImpl::AddSoftkeyActionListener(Softkey softkey, const IActionEventListener& listener)
875 {
876         _Softkey _softkey = ConvertSoftkey(softkey);
877
878         if (GetCore().CheckSoftkey(_softkey) == false)
879         {
880                 return ;
881         }
882
883         if (softkey == SOFTKEY_0)
884         {
885                 __pLeftSoftkeyActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
886
887                 SysTryReturnVoidResult(NID_UI_CTRL, __pLeftSoftkeyActionEvent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
888
889                 __pLeftSoftkeyActionEvent->AddListener(listener);
890
891                 __leftSoftkeyActionList.Add(*__pLeftSoftkeyActionEvent);
892         }
893         else if (softkey == SOFTKEY_1)
894         {
895                 __pRightSoftkeyActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
896
897                 SysTryReturnVoidResult(NID_UI_CTRL, __pRightSoftkeyActionEvent != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
898
899                 __pRightSoftkeyActionEvent->AddListener(listener);
900
901                 __rightSoftkeyActionList.Add(*__pRightSoftkeyActionEvent);
902         }
903 }
904
905 void
906 _FormImpl::RemoveOrientationEventListener(IOrientationEventListener& listener)
907 {
908         if (__pOriAgent)
909         {
910                 __pOriAgent->RemoveListener(listener);
911         }
912         else if (__pImeOriAgent)
913         {
914                 __pImeOriAgent->RemoveListener(listener);
915         }
916 }
917
918 void
919 _FormImpl::RemoveOptionkeyActionListener(const IActionEventListener& listener)
920 {
921         if (HasOptionkey() == false)
922         {
923                 return ;
924         }
925
926         if (__pOptionMenuActionEvent)
927         {
928                 __pOptionMenuActionEvent->RemoveListener(listener);
929         }
930 }
931
932 void
933 _FormImpl::RemoveSoftkeyActionListener(Softkey softkey, const IActionEventListener& listener)
934 {
935         _Softkey _softkey = ConvertSoftkey(softkey);
936
937         if (GetCore().CheckSoftkey(_softkey) == false)
938         {
939                 return ;
940         }
941
942         if (softkey == SOFTKEY_0)
943         {
944                 if (__pLeftSoftkeyActionEvent)
945                 {
946                         __pLeftSoftkeyActionEvent->RemoveListener(listener);
947                 }
948         }
949         else if (softkey == SOFTKEY_1)
950         {
951                 if (__pRightSoftkeyActionEvent)
952                 {
953                         __pRightSoftkeyActionEvent->RemoveListener(listener);
954                 }
955         }
956 }
957
958 void
959 _FormImpl::SetOrientation(Orientation orientation)
960 {
961         if (__pOriAgent)
962         {
963                 __pOriAgent->SetMode(orientation);
964         }
965 }
966
967 Orientation
968 _FormImpl::GetOrientation(void) const
969 {
970         if (__pOriAgent)
971         {
972                 return __pOriAgent->GetMode();
973         }
974
975         return ORIENTATION_NONE;
976 }
977
978 OrientationStatus
979 _FormImpl::GetOrientationStatus(void) const
980 {
981         if (__pOriAgent)
982         {
983                 return __pOriAgent->GetStatus();
984         }
985
986         return ORIENTATION_STATUS_NONE;
987 }
988
989 void
990 _FormImpl::UpdateOrientationStatus(bool draw)
991 {
992         if (__pOriAgent)
993         {
994                 __pOriAgent->Update(draw);
995         }
996 }
997
998 #if defined(WINDOW_BASE_ROTATE)
999 void
1000 _FormImpl::UpdateOrientation(void)
1001 {
1002         if (__pOriAgent)
1003         {
1004                 __pOriAgent->UpdateOrientation();
1005         }
1006 }
1007 #endif
1008
1009 void
1010 _FormImpl::UpdateOrientation(int angle)
1011 {
1012         SysLog(NID_UI_CTRL, "[Ime Rotation]");
1013
1014         if (__pImeOriAgent)
1015         {
1016                 __pImeOriAgent->UpdateOrientation(angle);
1017         }
1018 }
1019
1020 bool
1021 _FormImpl::HasOptionkey(void) const
1022 {
1023         return GetCore().HasOptionkey();
1024 }
1025
1026 bool
1027 _FormImpl::HasSoftkey(Softkey softkey) const
1028 {
1029         _Softkey _softkey = ConvertSoftkey(softkey);
1030
1031         return GetCore().HasSoftkey(_softkey);
1032 }
1033
1034 result
1035 _FormImpl::SetSoftkeyEnabled(Softkey softkey, bool enable)
1036 {
1037         _Softkey _softkey = ConvertSoftkey(softkey);
1038
1039         result r = GetCore().SetSoftkeyEnabled(_softkey, enable);
1040         SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
1041
1042         return r;
1043 }
1044
1045 bool
1046 _FormImpl::IsSoftkeyEnabled(Softkey softkey) const
1047 {
1048         _Softkey _softkey = ConvertSoftkey(softkey);
1049
1050         return GetCore().IsSoftkeyEnabled(_softkey);
1051 }
1052
1053 int
1054 _FormImpl::GetSoftkeyActionId(Softkey softkey) const
1055 {
1056         _Softkey _softkey = ConvertSoftkey(softkey);
1057
1058         return GetCore().GetSoftkeyActionId(_softkey);
1059 }
1060
1061 int
1062 _FormImpl::GetOptionkeyActionId(void) const
1063 {
1064         return GetCore().GetOptionkeyActionId();
1065 }
1066
1067 String
1068 _FormImpl::GetSoftkeyText(Softkey softkey) const
1069 {
1070         _Softkey _softkey = ConvertSoftkey(softkey);
1071
1072         return GetCore().GetSoftkeyText(_softkey);
1073 }
1074
1075 result
1076 _FormImpl::SetOptionkeyActionId(int actionId)
1077 {
1078         result r = GetCore().SetOptionkeyActionId(actionId);
1079         SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
1080
1081         return r;
1082 }
1083
1084 result
1085 _FormImpl::SetSoftkeyActionId(Softkey softkey, int actionId)
1086 {
1087         _Softkey _softkey = ConvertSoftkey(softkey);
1088
1089         result r = GetCore().SetSoftkeyActionId(_softkey, actionId);
1090         SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
1091
1092         return r;
1093 }
1094
1095 result
1096 _FormImpl::SetSoftkeyText(Softkey softkey, const String& text)
1097 {
1098         _Softkey _softkey = ConvertSoftkey(softkey);
1099
1100         result r = GetCore().SetSoftkeyText(_softkey, text);
1101         SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
1102
1103         return r;
1104 }
1105
1106 result
1107 _FormImpl::SetSoftkeyIcon(Softkey softkey, const Bitmap& pNormalBitmap, const Bitmap* ppPressedBitmap)
1108 {
1109         _Softkey _softkey = ConvertSoftkey(softkey);
1110
1111         result r = GetCore().SetSoftkeyIcon(_softkey, pNormalBitmap, ppPressedBitmap);
1112         SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
1113
1114         return r;
1115 }
1116
1117 void
1118 _FormImpl::OnChangeLayout(_ControlOrientation orientation)
1119 {
1120         const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
1121         const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
1122
1123         // Adjust the position of the partial Frame.
1124         _FrameImpl* pFrameImpl = dynamic_cast<_FrameImpl*>(GetParent());
1125         if (pFrameImpl)
1126         {
1127                 FrameShowMode frameShowMode = pFrameImpl->GetShowMode();
1128
1129                 if ((frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN) || (frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING))
1130                 {
1131                         bool movable = pFrameImpl->GetCore().IsMovable();
1132                         pFrameImpl->GetCore().SetMovable(true);
1133                 
1134                         FloatPoint prevPoint = pFrameImpl->GetPositionF();
1135                         FloatPoint curPoint(0.0f, 0.0f);
1136                 
1137                         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
1138                         {
1139                                 curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x;
1140                                 curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y;
1141                         }
1142                         else
1143                         {
1144                                 curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x;
1145                                 curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y;
1146                         }
1147                 
1148                         pFrameImpl->SetPosition(curPoint);
1149                 
1150                         pFrameImpl->GetCore().SetMovable(movable);
1151                 }
1152         }
1153
1154         // Change layout.
1155         _ContainerImpl::OnChangeLayout(orientation);
1156         SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1157
1158         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
1159         {
1160                 SetSize(portraitSize);
1161         }
1162         else
1163         {
1164                 SetSize(landscapeSize);
1165         }
1166
1167         float indicatorheight = 0.0f;
1168
1169         GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight);
1170         if (GetCore().HasIndicator())
1171         {
1172                 _Indicator* pIndicator = GetCore().GetIndicator();
1173                 if (pIndicator)
1174                 {
1175                         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
1176                         {
1177                                 pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
1178                         }
1179                         else
1180                         {
1181                                 GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight);
1182                                 pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
1183                         }
1184                 }
1185                 GetCore().AdjustClientBounds();
1186         }
1187
1188
1189         float adjHeight = 0.0f;
1190
1191         if (GetCore().HasHeader())
1192         {
1193                 FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
1194                 if (GetCore().IsIndicatorVisible())
1195                 {
1196                         indicatorBounds = GetCore().GetIndicatorBoundsF();
1197                         if (GetCore().IsIndicatorTranslucent())
1198                         {
1199                                 if (!GetCore().IsHeaderTranslucent())
1200                                 {
1201                                         indicatorBounds.height = 0.0f;
1202                                 }
1203                                 else
1204                                 {
1205                                         if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
1206                                         {
1207                                                 indicatorBounds.height = 0.0f;
1208                                         }
1209                                 }
1210                         }
1211                 }
1212
1213                 FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
1214                 GetCore().SetHeaderBounds(bounds);
1215         }
1216
1217         if (GetCore().HasTab())                         // Ki-Dong,Hong.Temp
1218         {
1219                 float titleHeight = 0.0f;
1220
1221                 if (GetCore().GetFormStyle() & FORM_STYLE_TITLE)
1222                 {
1223                         if (GetCore().HasHeader())
1224                         {
1225                                 _HeaderImpl* pHeaderImpl = GetHeader();
1226                                 if (pHeaderImpl)
1227                                 {
1228                                         titleHeight = pHeaderImpl->GetBoundsF().height;
1229                                 }
1230                         }
1231                 }
1232
1233                 FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
1234
1235                 if (GetCore().IsIndicatorVisible())
1236                 {
1237                         indicatorBounds = GetCore().GetIndicatorBoundsF();
1238                 }
1239
1240                 float posY = indicatorBounds.height + titleHeight;
1241
1242                 FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF());
1243                 GetCore().SetTabBounds(bounds);
1244         }
1245
1246         if (GetCore().HasFooter())
1247         {
1248                 if (GetCore().GetFooter()->GetVisibleState() && !GetCore().IsFooterTranslucent())
1249                 {
1250                         adjHeight = 0.0f;
1251                 }
1252                 else
1253                 {
1254                         adjHeight = GetCore().GetToolbarHeightF(false);
1255                 }
1256
1257                 if (!(GetCore().GetFormStyle() & FORM_STYLE_FOOTER || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_1
1258                                 || GetCore().GetFormStyle() & FORM_STYLE_OPTIONKEY))
1259                 {
1260                         adjHeight = GetCore().GetToolbarHeightF(false);
1261                 }
1262
1263                 FloatRectangle bounds(0.0f, GetClientBoundsF().y + GetClientBoundsF().height - adjHeight,
1264                                                                                 GetClientBoundsF().width, GetCore().GetToolbarHeightF(false));
1265                 GetCore().SetFooterBounds(bounds);
1266         }
1267 }
1268
1269 _HeaderImpl*
1270 _FormImpl::CreateHeaderN(void)
1271 {
1272         result r = E_SUCCESS;
1273
1274         Header* pHeader = new (std::nothrow) Header;
1275         SysTryReturn(NID_UI_CTRL, pHeader, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
1276
1277         r = pHeader->Construct();
1278         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
1279
1280         _HeaderImpl* pHeaderImpl = _HeaderImpl::GetInstance(*pHeader);
1281
1282         SetLastResult(E_SUCCESS);
1283
1284         return pHeaderImpl;
1285 }
1286
1287 _FooterImpl*
1288 _FormImpl::CreateFooterN(void)
1289 {
1290         result r = E_SUCCESS;
1291
1292         Footer* pFooter = new (std::nothrow) Footer;
1293         SysTryReturn(NID_UI_CTRL, pFooter, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
1294
1295         r = pFooter->Construct();
1296         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
1297
1298         _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*pFooter);
1299
1300         SetLastResult(E_SUCCESS);
1301
1302         return pFooterImpl;
1303 }
1304
1305 // Ki-Dong,Hong.Temp
1306 _TabImpl*
1307 _FormImpl::CreateTabImplN(void)
1308 {
1309         //result r = E_SUCCESS;
1310
1311         //Tab* pTab = new (std::nothrow) Tab;
1312         //SysTryReturn(NID_UI_CTRL, pTab, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
1313
1314         //r = pTab->Construct();
1315         //SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] Unable to consturct tab.");
1316
1317         //return pTab->GetTabImpl();
1318         Tab* pTab = _TabImpl::CreateTabN();
1319         SysTryReturn(NID_UI_CTRL, pTab, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1320
1321         _TabImpl* pTabImpl = _TabImpl::GetInstance(*pTab);
1322
1323         SetLastResult(E_SUCCESS);
1324
1325         return pTabImpl;
1326 }
1327
1328 bool
1329 _FormImpl::DeflateClientRectHeight(int height)
1330 {
1331         return GetCore().DeflateClientRectHeight(height);
1332 }
1333
1334 bool
1335 _FormImpl::DeflateClientRectHeight(float height)
1336 {
1337         return GetCore().DeflateClientRectHeight(height);
1338 }
1339
1340 bool
1341 _FormImpl::RemoveHeader(void)
1342 {
1343         _HeaderImpl* pHeaderImpl = GetHeader();
1344
1345         if (pHeaderImpl)
1346         {
1347                 __pForm->RemoveHeader();
1348                 result r = GetLastResult();
1349                 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
1350                 Header* pHeader = pHeaderImpl->GetHeader();
1351
1352                 delete pHeader;
1353         }
1354         else
1355                 return false;
1356
1357         return true;
1358 }
1359
1360 bool
1361 _FormImpl::RemoveFooter(void)
1362 {
1363         _FooterImpl* pFooterImpl = GetFooter();
1364
1365         if (pFooterImpl)
1366         {
1367                 __pForm->RemoveFooter();
1368                 result r = GetLastResult();
1369                 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
1370                 Footer* pFooter = pFooterImpl->GetFooter();
1371
1372                 delete pFooter;
1373         }
1374         else
1375         {
1376                 return false;
1377         }
1378
1379         return true;
1380 }
1381
1382 // Ki-Dong,Hong.Temp
1383 bool
1384 _FormImpl::RemoveTabImpl(void)
1385 {
1386         _TabImpl* pTabImpl = GetTabImpl();
1387
1388         if (pTabImpl)
1389         {
1390                 __pForm->RemoveTab();
1391                 result r = GetLastResult();
1392                 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
1393                 Tab* pTab = pTabImpl->GetTab();
1394
1395                 pTabImpl->DeleteTab(pTab);
1396         }
1397         else
1398         {
1399                 return false;
1400         }
1401
1402         return true;
1403 }
1404
1405 DataBindingContext*
1406 _FormImpl::GetDataBindingContextN(void) const
1407 {
1408         return _DataBindingContextImpl::GetDataBindingContextN(*this);
1409 }
1410
1411 result
1412 _FormImpl::OnAttaching(const _Control* pParent)
1413 {
1414         result r = E_SUCCESS;
1415         _Frame* pFrame = dynamic_cast<_Frame*>(const_cast<_Control*>((pParent)));
1416         if (FORM_STYLE_INDICATOR & GetCore().GetFormStyle())
1417         {
1418                 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.");
1419         }
1420         r = _ControlImpl::OnAttaching(pParent);
1421         return r;
1422 }
1423
1424 result
1425 _FormImpl::OnAttachedToMainTree(void)
1426 {
1427         result r = E_SUCCESS;
1428   SetFocused();
1429
1430   r = GetCore().AttachedToMainTree();
1431   r = _ContainerImpl::OnAttachedToMainTree();
1432
1433         FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
1434
1435         if (FORM_STYLE_INDICATOR & GetCore().GetFormStyle())
1436         {
1437                 indicatorBounds = GetCore().GetIndicatorBoundsF();
1438                 r = GetLastResult();
1439                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1440         }
1441
1442         _HeaderImpl* pHeader = GetHeader();
1443         _FooterImpl* pFooter = GetFooter();
1444         _TabImpl* pTabImpl = GetTabImpl();
1445
1446         if (pHeader)
1447         {
1448                 if (GetCore().IsIndicatorTranslucent())
1449                 {
1450                         if (!GetCore().IsHeaderTranslucent())
1451                         {
1452                                 indicatorBounds.height = 0.0f;
1453                         }
1454                         else
1455                         {
1456                                 if (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
1457                                 {
1458                                         indicatorBounds.height = 0.0f;
1459                                 }
1460                         }
1461                 }
1462                 FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true));
1463                 GetCore().SetHeaderBounds(bounds);
1464         }
1465
1466         float titleHeight = 0.0f;
1467
1468         if (pHeader)
1469         {
1470                 titleHeight = pHeader->GetBoundsF().height;
1471         }
1472
1473         if (pTabImpl)
1474         {
1475                 float posY = indicatorBounds.height + titleHeight;
1476
1477                         FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF());
1478                         GetCore().SetTabBounds(bounds);
1479         }
1480
1481         if (pFooter)
1482         {
1483                 float adjHeight = 0.0f;
1484
1485                 if (!(GetCore().GetFooter()->GetVisibleState()) || GetCore().IsFooterTranslucent())
1486                 {
1487                         adjHeight = GetCore().GetToolbarHeightF(false);
1488                 }
1489
1490                 if (!(GetCore().GetFormStyle() & FORM_STYLE_FOOTER || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_1
1491                                 || GetCore().GetFormStyle() & FORM_STYLE_OPTIONKEY))
1492                 {
1493                         adjHeight = GetCore().GetToolbarHeightF(false);
1494                 }
1495
1496                 FloatRectangle clientbounds = GetClientBoundsF();
1497                 FloatRectangle bounds(0.0f, clientbounds.y + clientbounds.height - adjHeight, clientbounds.width, GetCore().GetToolbarHeightF(false));
1498
1499                 GetCore().SetFooterBounds(bounds);
1500         }
1501
1502         UpdateOrientationStatus();
1503
1504         if (__pOriAgent)
1505         {
1506                 __pOriAgent->RequestOrientationEvent();
1507         }
1508
1509         return r;
1510 }
1511
1512 result
1513 _FormImpl::OnDetachingFromMainTree(void)
1514 {
1515         result r = E_SUCCESS;
1516         r = GetCore().DetachingFromMainTree();
1517         r = _ContainerImpl::OnDetachingFromMainTree();
1518
1519         return r;
1520 }
1521
1522 bool
1523 _FormImpl::OnNotifiedN(const _ControlImpl& source, IList* pArgs)
1524 {
1525         String* pString = dynamic_cast <Tizen::Base::String*>(pArgs->GetAt(0));
1526         if (pString)
1527         {
1528                 if (*pString == _REQUEST_ORIENTATION_EVENT)
1529                 {
1530                         if (__pOriAgent)
1531                         {
1532                                 __pOriAgent->FireOrientationEvent();
1533                         }
1534
1535                         pArgs->RemoveAll(true);
1536                         delete pArgs;
1537
1538                         return true;
1539                 }
1540         }
1541
1542         return false;
1543 }
1544
1545 void
1546 _FormImpl::OnFormBackRequested(Tizen::Ui::Controls::_Form& source)
1547 {
1548         if (__pFormBackEventListener)
1549         {
1550                 _FormImpl* pFormImpl = static_cast<_FormImpl*>(source.GetUserData());
1551                 Form* pForm = dynamic_cast <Form*>(&pFormImpl->GetPublic());
1552                 if (pForm)
1553                 {
1554                         __pFormBackEventListener->OnFormBackRequested(*pForm);
1555                 }
1556                 else
1557                 {
1558                         return;
1559                 }
1560         }
1561 }
1562
1563 bool
1564 _FormImpl::IsOpaque(void) const
1565 {
1566         //return true;
1567         return false;
1568 }
1569
1570 _Softkey
1571 _FormImpl::ConvertSoftkey(Softkey softkey) const
1572 {
1573         _Softkey _softkey;
1574
1575         if (softkey == SOFTKEY_0)
1576         {
1577                 _softkey = _SOFTKEY_0;
1578         }
1579         else if (softkey == SOFTKEY_1)
1580         {
1581                 _softkey = _SOFTKEY_1;
1582         }
1583         else
1584         {
1585                 _softkey = _SOFTKEY_COUNT;
1586         }
1587
1588         return _softkey;
1589 }
1590
1591 result
1592 _FormImpl::SetNotificationTrayOpenEnabled(bool enable)
1593 {
1594         return GetCore().SetNotificationTrayOpenEnabled(enable);
1595 }
1596
1597 bool
1598 _FormImpl::IsNotificationTrayOpenEnabled(void) const
1599 {
1600         return GetCore().IsNotificationTrayOpenEnabled();
1601 }
1602
1603 class _FormMaker
1604         : public _UiBuilderControlMaker
1605 {
1606 public:
1607         _FormMaker(_UiBuilder* uibuilder)
1608                 : _UiBuilderControlMaker(uibuilder){};
1609         virtual ~_FormMaker()
1610         {
1611         };
1612         static _UiBuilderControlMaker* GetInstance(_UiBuilder* uibuilder)
1613         {
1614                 _FormMaker* pFormMaker = new (std::nothrow) _FormMaker(uibuilder);
1615                 return pFormMaker;
1616         };
1617 protected:
1618         virtual Control* Make(_UiBuilderControl* pControl)
1619         {
1620                 _UiBuilderControlLayout* pControlProperty = null;
1621                 result r = E_SUCCESS;
1622                 int style = 0;
1623                 int opacity = 0;
1624                 Tizen::Base::String elementString;
1625                 bool isTitleAlign = false;
1626                 Color color;
1627
1628                 HorizontalAlignment align = ALIGNMENT_CENTER;
1629                 Form* pForm = (Form*) GetContainer();
1630
1631                 // Get control manager
1632                 _ControlManager* pControlManager = _ControlManager::GetInstance();
1633                 if (pControlManager == null)
1634                 {
1635                         SysLog(NID_UI_CTRL, "Unable to get the control manager.n");
1636                         return null;
1637                 }
1638                 FloatDimension screenSize = pControlManager->GetScreenSizeF();
1639
1640                 //Set rect
1641                 (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->SetRect(0.0f, 0.0f, screenSize.width, screenSize.height);
1642                 (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->SetRect(0.0f, 0.0f, screenSize.height, screenSize.width);
1643
1644                 // Get device orientation
1645                 app_device_orientation_e deviceOrientation = app_get_device_orientation();
1646                 bool isHorizontal = (deviceOrientation == APP_DEVICE_ORIENTATION_90) || (deviceOrientation == APP_DEVICE_ORIENTATION_270);
1647
1648                 if (isHorizontal)
1649                 {
1650                         pControlProperty = pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE);
1651                 }
1652                 else
1653                 {
1654                         pControlProperty = pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT);
1655                 }
1656
1657                 if (pControlProperty == null)
1658                 {
1659                         SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Can't read attributes");
1660                         return null;
1661                 }
1662
1663                 pControlProperty = pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT);
1664                 Tizen::Base::String styleString;
1665                 styleString = pControlProperty->GetStyle();
1666
1667                 if (styleString.Contains(L"FORM_STYLE_TITLE"))
1668                 {
1669                         style |= FORM_STYLE_TITLE;
1670                 }
1671                 if (styleString.Contains(L"FORM_STYLE_SOFTKEY_0"))
1672                 {
1673                         style |= FORM_STYLE_SOFTKEY_0;
1674                 }
1675                 if (styleString.Contains(L"FORM_STYLE_SOFTKEY_1"))
1676                 {
1677                         style |= FORM_STYLE_SOFTKEY_1;
1678                 }
1679                 if (styleString.Contains(L"FORM_STYLE_OPTIONKEY"))
1680                 {
1681                         style |= FORM_STYLE_OPTIONKEY;
1682                 }
1683                 if (styleString.Contains(L"FORM_STYLE_INDICATOR"))
1684                 {
1685                         style |= FORM_STYLE_INDICATOR;
1686                 }
1687                 if (styleString.Contains(L"FORM_STYLE_TEXT_TAB"))
1688                 {
1689                         style |= FORM_STYLE_TEXT_TAB;
1690                 }
1691                 if (styleString.Contains(L"FORM_STYLE_ICON_TAB"))
1692                 {
1693                         style |= FORM_STYLE_ICON_TAB;
1694                 }
1695                 if (styleString.Contains(L"FORM_STYLE_HEADER"))
1696                 {
1697                         style |= FORM_STYLE_HEADER;
1698                 }
1699                 if (styleString.Contains(L"FORM_STYLE_FOOTER"))
1700                 {
1701                         style |= FORM_STYLE_FOOTER;
1702                 }
1703                 if (styleString.Contains(L"FORM_STYLE_INDICATOR_AUTO_HIDE"))
1704                 {
1705                         style |= FORM_STYLE_INDICATOR_AUTO_HIDE;
1706                 }
1707
1708                 _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE;
1709                 __pLayoutMaker->GetLayoutType(pControlProperty, layoutType);
1710                 if (layoutType == UIBUILDER_LAYOUT_NONE)
1711                 {
1712                         // Construct
1713                         r = pForm->Construct(style);
1714                 }
1715                 else
1716                 {
1717                         Layout* pPortraitLayout = null;
1718                         Layout* pLandscapeLayout = null;
1719                         result tempResult = E_SUCCESS;
1720                         tempResult = __pLayoutMaker->GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout);
1721                         if (E_SUCCESS == tempResult)
1722                         {
1723                                 r = pForm->Construct(*pPortraitLayout, *pLandscapeLayout, style);
1724                         }
1725                         else
1726                         {
1727                                 r = tempResult;
1728                         }
1729
1730                         _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE;
1731
1732                         if (__pLayoutMaker->GetLayoutType(pControlProperty, layoutType) == false)
1733                         {
1734                                 return null;
1735                         }
1736
1737                         if ( layoutType == UIBUILDER_LAYOUT_GRID)
1738                         {
1739                                 for (int i = 0; i < UIBUILDER_ATTRIBUTE_NUM; i++)
1740                                 {
1741                                         GridLayout* pGridLayout = null;
1742                                         pControlProperty = pControl->GetAttribute(i);
1743
1744                                         if ( i == UIBUILDER_ATTRIBUTE_PORTRAIT)
1745                                         {
1746                                                 pGridLayout = dynamic_cast<GridLayout*>(pPortraitLayout);
1747                                         }
1748                                         else
1749                                         {
1750                                                 pGridLayout = dynamic_cast<GridLayout*>(pLandscapeLayout);
1751                                         }
1752                                         __pLayoutMaker->SetGridLayoutContainerProperty(pGridLayout, pControlProperty);
1753                                 }
1754                         }
1755                         delete pPortraitLayout;
1756                         if (pPortraitLayout != pLandscapeLayout)
1757                         {
1758                                 delete pLandscapeLayout;
1759                         }
1760                 }
1761
1762                 if (r != E_SUCCESS)
1763                 {
1764                         SysLog(NID_UI_CTRL, "Failed to create Form.");
1765                         return null;
1766                 }
1767
1768                 // Set Property
1769                 if (pControl->GetElement(L"titleAlign", elementString))
1770                 {
1771                         if (elementString.Equals(L"ALIGN_CENTER", false))
1772                         {
1773                                 align = ALIGNMENT_CENTER;
1774                         }
1775                         else if (elementString.Equals(L"ALIGN_RIGHT", false))
1776                         {
1777                                 align = ALIGNMENT_RIGHT;
1778                         }
1779                         else
1780                         {
1781                                 align = ALIGNMENT_LEFT;
1782                         }
1783                         isTitleAlign = true;
1784                 }
1785
1786                 if (style & FORM_STYLE_TITLE)
1787                 {
1788                         if (pControl->GetElement(L"title", elementString))
1789                         {
1790                                 if (isTitleAlign)
1791                                 {
1792                                         pForm->SetTitleText(elementString, align);
1793                                 }
1794                                 else
1795                                 {
1796                                         pForm->SetTitleText(elementString);
1797                                 }
1798                         }
1799                         else
1800                         {
1801                                 if (isTitleAlign)
1802                                 {
1803                                         pForm->SetTitleText(L"", align);
1804                                 }
1805                                 else
1806                                 {
1807                                         pForm->SetTitleText(L"");
1808                                 }
1809                         }
1810                 }
1811
1812                 if (pControl->GetElement(L"titleIcon", elementString))
1813                 {
1814                         Bitmap* pBitmap = null;
1815                         pBitmap = LoadBitmapN(elementString);
1816                         if (pBitmap != null)
1817                         {
1818                                 r = pForm->SetTitleIcon(pBitmap);
1819                                 delete pBitmap;
1820                                 if (IsFailed(r))
1821                                 {
1822                                         SysLog(NID_UI_CTRL, "Failed to set TitleIcon.");
1823                                 }
1824                         }
1825                 }
1826
1827                 if (pControl->GetElement(L"softKey0Text", elementString))
1828                 {
1829                         pForm->SetSoftkeyText(SOFTKEY_0, elementString);
1830                 }
1831                 if (pControl->GetElement(L"softKey1Text", elementString))
1832                 {
1833                         pForm->SetSoftkeyText(SOFTKEY_1, elementString);
1834                 }
1835                 if (pControl->GetElement(L"backgroundColorOpacity", elementString) || pControl->GetElement(L"BGColorOpacity", elementString))
1836                 {
1837                         Base::Integer::Parse(elementString, opacity);
1838                 }
1839                 if (pControl->GetElement(L"backgroundColor", elementString) || pControl->GetElement(L"BGColor", elementString))
1840                 {
1841                         ConvertStringToColor32(elementString, opacity, color);
1842                         pForm->SetBackgroundColor(color);
1843                 }
1844                 else
1845                 {
1846                         Color color;
1847                         r = GET_COLOR_CONFIG(FORM::BG_NORMAL,color);
1848                         if (r == E_SUCCESS)
1849                         {
1850                                 pForm->SetBackgroundColor(color);
1851                         }
1852                         else
1853                         {
1854                                 pForm->SetBackgroundColor(0xff000000);
1855                         }
1856                 }
1857
1858                 if (pControl->GetElement(L"softKey0Icon", elementString) || pControl->GetElement(L"softKey0NormalIcon", elementString))
1859                 {
1860                         Bitmap* pNormalBitmap = null;
1861                         Bitmap* pPressedBitmap = null;
1862                         pNormalBitmap = LoadBitmapN(elementString); //__image->DecodeN(path,BITMAP_PIXEL_FORMAT_RGB565);
1863
1864                         if (pNormalBitmap != null)
1865                         {
1866                                 if (pControl->GetElement(L"softKey0PressedIcon", elementString))
1867                                 {
1868                                         pPressedBitmap = LoadBitmapN(elementString);
1869                                 }
1870
1871                                 if (pPressedBitmap != null)
1872                                 {
1873                                         pForm->SetSoftkeyIcon(SOFTKEY_0, *pNormalBitmap, pPressedBitmap);
1874                                         delete pNormalBitmap;
1875                                         delete pPressedBitmap;
1876                                 }
1877                                 else
1878                                 {
1879                                         pForm->SetSoftkeyIcon(SOFTKEY_0, *pNormalBitmap, null);
1880                                         delete pNormalBitmap;
1881                                 }
1882                         }
1883                 }
1884                 if (pControl->GetElement(L"softKey1Icon", elementString) || pControl->GetElement(L"softKey1NormalIcon", elementString))
1885                 {
1886                         Bitmap* pNormalBitmap = null;
1887                         Bitmap* pPressedBitmap = null;
1888                         pNormalBitmap = LoadBitmapN(elementString); //__image->DecodeN(path,BITMAP_PIXEL_FORMAT_RGB565);
1889
1890                         if (pNormalBitmap != null)
1891                         {
1892                                 if (pControl->GetElement(L"softKey1PressedIcon", elementString))
1893                                 {
1894                                         pPressedBitmap = LoadBitmapN(elementString); // __image->DecodeN(path,BITMAP_PIXEL_FORMAT_RGB565);
1895                                 }
1896
1897                                 if (pPressedBitmap != null)
1898                                 {
1899                                         pForm->SetSoftkeyIcon(SOFTKEY_1, *pNormalBitmap, pPressedBitmap);
1900                                         delete pNormalBitmap;
1901                                         delete pPressedBitmap;
1902                                 }
1903                                 else
1904                                 {
1905                                         pForm->SetSoftkeyIcon(SOFTKEY_1, *pNormalBitmap, null);
1906                                         delete pNormalBitmap;
1907                                 }
1908                         }
1909                 }
1910
1911                 if (pControl->GetElement(L"Orientation", elementString) || pControl->GetElement(L"orientation", elementString))
1912                 {
1913                         //ORIENTATION_NONE,
1914                         //ORIENTATION_PORTRAIT,
1915                         //ORIENTATION_LANDSACPE,
1916                         //ORIENTATION_PORTRAIT_REVERSE,
1917                         //ORIENTATION_LANDSACPE_REVERSE,
1918                         //ORIENTATION_AUTO = 6,
1919                         //ORIENTATION_AUTO_FOUR_DIRECTION = 8,
1920
1921                         if (elementString.Equals(L"Automatic:2Dir", false) || elementString.Equals(L"Automatic", false))
1922                         {
1923                                 pForm->SetOrientation(ORIENTATION_AUTOMATIC);
1924                         }
1925                         else if (elementString.Equals(L"Automatic:4Dir", false))
1926                         {
1927                                 pForm->SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
1928                         }
1929                         else if (elementString.Equals(L"Landscape", false))
1930                         {
1931                                 pForm->SetOrientation(ORIENTATION_LANDSCAPE);
1932                                 SetUiBuilderRotateState(UIBUIDER_SCREEN_HORIZONTAL);
1933                         }
1934                         else if (elementString.Equals(L"Landscape:Reverse", false))
1935                         {
1936                                 pForm->SetOrientation(ORIENTATION_LANDSCAPE_REVERSE);
1937                                 SetUiBuilderRotateState(UIBUIDER_SCREEN_HORIZONTAL);
1938                         }
1939                         else if (elementString.Equals(L"Portrait", false))
1940                         {
1941                                 pForm->SetOrientation(ORIENTATION_PORTRAIT);
1942                                 SetUiBuilderRotateState(UIBUIDER_SCREEN_VERTICAL);
1943                         }
1944                         else if (elementString.Equals(L"Portrait:Reverse", false))
1945                         {
1946                                 pForm->SetOrientation(ORIENTATION_PORTRAIT_REVERSE);
1947                                 SetUiBuilderRotateState(UIBUIDER_SCREEN_VERTICAL);
1948                         }
1949                 }
1950
1951                 if (style & FORM_STYLE_HEADER)
1952                 {
1953                         if (pControl->GetElement(L"translucentHeader", elementString))
1954                         {
1955                                 if (elementString.Equals(L"true", false))
1956                                 {
1957                                         pForm->SetActionBarsTranslucent(FORM_ACTION_BAR_HEADER, true);
1958                                 }
1959                         }
1960                 }
1961
1962                 if (style & FORM_STYLE_FOOTER)
1963                 {
1964                         if (pControl->GetElement(L"translucentFooter", elementString))
1965                         {
1966                                 if (elementString.Equals(L"true", false))
1967                                 {
1968                                         pForm->SetActionBarsTranslucent(FORM_ACTION_BAR_FOOTER, true);
1969                                 }
1970                         }
1971                 }
1972
1973                 if (style & FORM_STYLE_INDICATOR)
1974                 {
1975                         if (pControl->GetElement(L"translucentIndicator", elementString))
1976                         {
1977                                 if (elementString.Equals(L"true", false))
1978                                 {
1979                                         pForm->SetActionBarsTranslucent(FORM_ACTION_BAR_INDICATOR, true);
1980                                 }
1981                         }
1982                 }
1983
1984                 return pForm;
1985         }
1986
1987 };
1988
1989 _FormRegister::_FormRegister()
1990 {
1991         _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1992         pUiBuilderControlTableManager->RegisterControl(L"Form", _FormMaker::GetInstance);
1993 }
1994 _FormRegister::~_FormRegister()
1995 {
1996         _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1997         pUiBuilderControlTableManager->UnregisterControl(L"Form");
1998 }
1999 static _FormRegister FormRegisterToUiBuilder;
2000 }}} // Tizen::Ui::Controls