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.
18 * @file FUiCtrl_Form.cpp
19 * @brief This is the implementation file for the _Form class.
23 #include <unique_ptr.h>
24 #include <FBaseErrorDefine.h>
25 #include <FBaseInteger.h>
26 #include <FBaseSysLog.h>
27 #include <FBaseColArrayListT.h>
28 #include <FGrpFloatRectangle.h>
29 #include <FBase_Log.h>
30 #include <FGrp_BitmapImpl.h>
31 #include "FUi_ResourceManager.h"
32 #include "FUi_EcoreEvasMgr.h"
33 #include "FUi_EcoreEvas.h"
34 #include "FUi_CoordinateSystemUtils.h"
35 #include "FUi_DataBindingContext.h"
36 #include "FUi_AccessibilityContainer.h"
37 #include "FUi_AccessibilityManager.h"
38 #include "FUiCtrl_Form.h"
39 #include "FUiCtrl_Frame.h"
40 #include "FUiCtrl_FormPresenter.h"
41 #include "FUiCtrl_Toolbar.h"
42 #include "FUiCtrl_Tab.h"
43 #include "FUiCtrl_ActionEvent.h"
44 #include "FUiCtrl_OverlayRegionImpl.h"
45 #include "FUiCtrl_OverlayPanelImpl.h"
46 #include "FUiCtrl_IFormBackEventListener.h"
47 #include "FUiCtrl_Indicator.h"
48 #include "FUi_SystemUtilImpl.h"
51 using namespace Tizen::Ui::Animations;
52 using namespace Tizen::Ui;
53 using namespace Tizen::Base; // Rotation
54 using namespace Tizen::Base::Runtime;
55 using namespace Tizen::Base::Collection;
56 using namespace Tizen::Graphics;
58 namespace Tizen { namespace Ui { namespace Controls
62 : __pFormPresenter(null)
63 , __pFormBackEventListener(null)
65 , __pActionEvent(null)
70 , __transparentIndicator(false)
71 , __transparentHeader(false)
72 , __transparentFooter(false)
73 , __transparentTab(false)
74 , __indicatorShowState(false)
76 , __deflatedHeight(0.0f)
77 , __overlayRegionCount(0)
78 , __ppOverlayerRegionImplArray(null)
79 , __softkeyCount(SOFTKEY_COUNT + 1)
80 , __updatedSoftkeyCount(0)
81 , __keypadShowstate(false)
84 result r = GET_COLOR_CONFIG(FORM::BG_NORMAL,color);
87 SetBackgroundColor(color);
91 SetBackgroundColor(0xff000000);
94 _FormPresenter* pPresenter = new (std::nothrow) _FormPresenter(*this);
95 SysTryReturnVoidResult(NID_UI_CTRL, pPresenter, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
97 SetPresenter(*pPresenter);
99 for (int i = 0; i < __softkeyCount; i++)
101 __actionId[_SOFTKEY_0 + i] = 0;
102 __softkeyText[_SOFTKEY_0 + i] = String();
103 __showSoftkey[_SOFTKEY_0 + i] = false;
104 __enableSoftkey[_SOFTKEY_0 + i] = false;
107 for (int i = 0; i < SOFTKEY_COUNT + 1; i++)
109 __pSoftkeyNormalBitmap[_SOFTKEY_0 + i] = null;
110 __pSoftkeyPressedBitmap[_SOFTKEY_0 + i] = null;
111 __pSoftkeyNormalEffectBitmap[_SOFTKEY_0 + i] = null;
112 __pSoftkeyPressedEffectBitmap[_SOFTKEY_0 + i] = null;
114 __pTextSoftkeyNormalBitmap[_SOFTKEY_0 + i] = null;
115 __pTextSoftkeyPressedBitmap[_SOFTKEY_0 + i] = null;
116 __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0 + i] = null;
117 __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0 + i] = null;
119 __pSoftkeyNormalIcon[_SOFTKEY_0 + i] = null;
120 __pSoftkeyPressedIcon[_SOFTKEY_0 + i] = null;
123 //create data binding context
124 _DataBindingContext* pContext = new (std::nothrow) _DataBindingContext(*this);
126 SysTryCatch(NID_UI_CTRL, pContext && GetLastResult() == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
127 SetDataBindingContext(pContext);
130 GetAccessibilityContainer()->Activate(true);
139 delete __pFormPresenter;
140 __pFormPresenter = null;
144 delete __pActionEvent;
145 __pActionEvent = null;
148 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
150 if (__pSoftkeyNormalBitmap[i])
152 delete __pSoftkeyNormalBitmap[i];
153 __pSoftkeyNormalBitmap[i] = null;
157 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
159 if (__pSoftkeyPressedBitmap[i])
161 delete __pSoftkeyPressedBitmap[i];
162 __pSoftkeyPressedBitmap[i] = null;
166 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
168 if (__pSoftkeyNormalEffectBitmap[i])
170 delete __pSoftkeyNormalEffectBitmap[i];
171 __pSoftkeyNormalEffectBitmap[i] = null;
175 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
177 if (__pSoftkeyPressedEffectBitmap[i])
179 delete __pSoftkeyPressedEffectBitmap[i];
180 __pSoftkeyPressedEffectBitmap[i] = null;
184 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
186 if (__pTextSoftkeyNormalBitmap[i])
188 delete __pTextSoftkeyNormalBitmap[i];
189 __pTextSoftkeyNormalBitmap[i] = null;
193 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
195 if (__pTextSoftkeyPressedBitmap[i])
197 delete __pTextSoftkeyPressedBitmap[i];
198 __pTextSoftkeyPressedBitmap[i] = null;
202 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
204 if (__pTextSoftkeyNormalEffectBitmap[i])
206 delete __pTextSoftkeyNormalEffectBitmap[i];
207 __pTextSoftkeyNormalEffectBitmap[i] = null;
211 for (int i = 0; i < SOFTKEY_COUNT+1 ; i++)
213 if (__pTextSoftkeyPressedEffectBitmap[i])
215 delete __pTextSoftkeyPressedEffectBitmap[i];
216 __pTextSoftkeyPressedEffectBitmap[i] = null;
220 for (int i = 0; i < SOFTKEY_COUNT+1; i++)
222 if (__pSoftkeyNormalIcon[i])
224 delete __pSoftkeyNormalIcon[i];
225 __pSoftkeyNormalIcon[i] = null;
228 if (__pSoftkeyPressedIcon[i])
230 delete __pSoftkeyPressedIcon[i];
231 __pSoftkeyPressedIcon[i] = null;
235 if (__ppOverlayerRegionImplArray != null)
237 int maxCount = OverlayRegion::GetMaxCount();
239 for (int i = 0; i < maxCount; i++)
241 if (__ppOverlayerRegionImplArray[i])
243 OverlayRegion* _pOverlayRegion = __ppOverlayerRegionImplArray[i]->GetOverlayRegion();
244 delete _pOverlayRegion;
248 delete[] __ppOverlayerRegionImplArray;
261 _Form::CreateFormN(void)
265 pForm = new (std::nothrow) _Form;
266 SysTryReturn(NID_UI_CTRL, pForm, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
267 SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
269 pForm->AcquireHandle();
271 SetLastResult(E_SUCCESS);
282 _Form::SetPresenter(const _FormPresenter& formPresenter)
284 __pFormPresenter = const_cast <_FormPresenter*>(&formPresenter);
292 if (__pFormPresenter)
294 __pFormPresenter->Draw();
297 if (__formStyle & FORM_STYLE_SOFTKEY_0 || __formStyle & FORM_STYLE_SOFTKEY_1 || __formStyle & FORM_STYLE_OPTIONKEY)
301 UpdateSoftkey(__formStyle);
304 if(unlikely((_AccessibilityManager::IsActivated())))
306 _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM);
312 _Form::SetFormBackEventListener(_IFormBackEventListener* pFormBackEventListener)
314 SysTryReturnVoidResult(NID_UI_CTRL, __pFooter || __pHeader, E_INVALID_STATE, "[E_INVALID_STATE] Footer and Header aren't constructed.");
315 __pFormBackEventListener = pFormBackEventListener;
318 __pFooter->SetBackEventListener(*this, ID_BACK_BUTTON);
322 __pHeader->SetBackEventListener(*this, ID_BACK_BUTTON);
325 SetLastResult(E_SUCCESS);
329 _Form::GetFormStyle(void) const
335 _Form::GetFooter(void) const
341 _Form::GetHeader(void) const
347 _Form::GetTab(void) const
353 _Form::GetIndicator(void) const
359 _Form::GetTitleText(void) const
361 if (__pHeader && (__formStyle & FORM_STYLE_TITLE))
363 return __pHeader->GetTitleText();
372 _Form::GetTitleTextHorizontalAlignment(void) const
374 if (__pHeader && (__formStyle & FORM_STYLE_TITLE))
376 return __pHeader->GetTitleTextHorizontalAlignment();
380 SysLog(NID_UI_CTRL, "[E_SYSTEM] The title is not valid.");
381 return ALIGNMENT_LEFT;
386 _Form::GetOverlayRegionN(const Rectangle& rect, OverlayRegionType regionType)
388 _OverlayRegionImpl* pOverlayRegionImpl = null;
389 OverlayRegion* pOverlayRegion = null;
390 Color bgColor(0, 0, 0, 0);
393 _OverlayPanel* pOverlayPanel = null;
395 bool modified = false;
399 maxCount = OverlayRegion::GetMaxCount();
400 SysTryReturn(NID_UI_CTRL, maxCount > 0, null, E_SYSTEM, "[E_SYSTEM] maxCount [%d] is invalid", maxCount);
402 if (__ppOverlayerRegionImplArray == null)
404 __ppOverlayerRegionImplArray = new (std::nothrow) _OverlayRegionImpl*[maxCount];
405 SysTryReturn(NID_UI_CTRL, __ppOverlayerRegionImplArray != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Can not allocate memory for the OverlayRegionList.");
407 for (int i = 0; i < maxCount; i++)
409 __ppOverlayerRegionImplArray[i] = null;
411 __overlayRegionCount = 0;
414 Rectangle clientRect(GetClientBounds());
415 Point overlayPosition(clientRect.x + rect.x, clientRect.y + rect.y);
416 Rectangle overlayRect(overlayPosition.x, overlayPosition.y, rect.width, rect.height);
418 Rectangle userPhyRect = _CoordinateSystemUtils::Transform(rect);
419 Rectangle devBounds = _CoordinateSystemUtils::Transform(overlayRect);
421 SysLog(NID_UI_CTRL, "rect [%d, %d, %d, %d] ", rect.x, rect.y, rect.width, rect.height);
422 SysLog(NID_UI_CTRL, "userPhyRect [%d, %d, %d, %d] ", userPhyRect.x, userPhyRect.y, userPhyRect.width, userPhyRect.height);
423 SysLog(NID_UI_CTRL, "overlayRect [%d, %d, %d, %d]", overlayPosition.x, overlayPosition.y, rect.width, rect.height);
424 SysLog(NID_UI_CTRL, "devBounds [%d, %d, %d, %d]", devBounds.x, devBounds.y, devBounds.width, devBounds.height);
426 // 1. width , height unit check
427 if (_OverlayRegionImpl::IsValidOverlayRect(overlayRect, devBounds, _CoordinateSystemUtils::Transform(clientRect), modified) != E_SUCCESS)
429 SysTryReturn(NID_UI_CTRL, 0, null, E_INVALID_ARG, "[E_INVALID_ARG] IsValidOverlayRect is failed!");
434 SysLog(NID_UI_CTRL, "devBounds modified [%d, %d, %d, %d]", devBounds.x, devBounds.y, devBounds.width, devBounds.height);
437 // 2. check for using OverlayPanel simutaneously
438 for (idx = 0 ; idx < GetChildCount() ; idx++)
440 pOverlayPanel = dynamic_cast <_OverlayPanel*>(GetChild(idx));
441 SysTryReturn(NID_UI_CTRL, pOverlayPanel == null, null, E_SYSTEM, "[E_SYSTEM] Using OverlayRegion mixed with OverlayPanel is not supported!");
444 // 3. find the empty slot idx
445 for (idx = 0; idx < maxCount; idx++)
447 if (__ppOverlayerRegionImplArray[idx] == null)
453 SysTryReturn(NID_UI_CTRL, idx < maxCount, null, E_SYSTEM, "[E_SYSTEM] already used permitted maximum number of OverlayRegion!");
455 // 4. make OverlayRegion object
456 pOverlayRegionImpl = new (std::nothrow) _OverlayRegionImpl();
457 SysTryReturn(NID_UI_CTRL, pOverlayRegionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to make the OverlayRegionImpl instance!");
459 FloatRectangle overlayRectF = _CoordinateSystemUtils::InverseTransform(_CoordinateSystemUtils::ConvertToFloat(devBounds));
460 r = pOverlayRegionImpl->Construct(this, regionType, _CoordinateSystemUtils::ConvertToFloat(rect), overlayRectF, devBounds);
463 delete pOverlayRegionImpl;
464 SysTryReturn(NID_UI_CTRL, 0, null, r, "[%s] Propagating.", GetErrorMessage(r));
467 pOverlayRegion = pOverlayRegionImpl->CreateOverlayRegionN();
468 if (pOverlayRegion == null)
470 delete pOverlayRegionImpl;
471 SysTryReturn(NID_UI_CTRL, 0, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
474 __ppOverlayerRegionImplArray[idx] = pOverlayRegionImpl;
475 pOverlayRegionImpl->SetFormArrayIndex(idx);
477 __overlayRegionCount++;
479 SetLastResult(E_SUCCESS);
481 return pOverlayRegion;
485 _Form::GetOverlayRegionN(const FloatRectangle& rect, OverlayRegionType regionType)
487 _OverlayRegionImpl* pOverlayRegionImpl = null;
488 OverlayRegion* pOverlayRegion = null;
489 Color bgColor(0, 0, 0, 0);
492 _OverlayPanel* pOverlayPanel = null;
494 bool modified = false;
498 maxCount = OverlayRegion::GetMaxCount();
499 SysTryReturn(NID_UI_CTRL, maxCount > 0, null, E_SYSTEM, "[E_SYSTEM] maxCount [%d] is invalid", maxCount);
501 if (__ppOverlayerRegionImplArray == null)
503 __ppOverlayerRegionImplArray = new (std::nothrow) _OverlayRegionImpl*[maxCount];
504 SysTryReturn(NID_UI_CTRL, __ppOverlayerRegionImplArray != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Can not allocate memory for the OverlayRegionList.");
506 for (int i = 0; i < maxCount; i++)
508 __ppOverlayerRegionImplArray[i] = null;
510 __overlayRegionCount = 0;
513 FloatRectangle clientRectF(GetClientBoundsF());
514 FloatPoint overlayPositionF(clientRectF.x + rect.x, clientRectF.y + rect.y);
515 FloatRectangle overlayRectF(overlayPositionF.x, overlayPositionF.y, rect.width, rect.height);
517 FloatRectangle devPhyBoundsF = _CoordinateSystemUtils::Transform(overlayRectF);
518 Rectangle devPhyBounds = _CoordinateSystemUtils::ConvertToInteger(devPhyBoundsF);
521 SysLog(NID_UI_CTRL, "user rect [%.3f, %.3f, %.3f, %.3f] ", rect.x, rect.y, rect.width, rect.height);
522 //adjustedlogical user float
523 SysLog(NID_UI_CTRL, "overlayRectF [%.3f, %.3f, %.3f, %.3f]", overlayRectF.x, overlayRectF.y, overlayRectF.width, overlayRectF.height);
524 //adjusted logical -> adjusted physical float
525 SysLog(NID_UI_CTRL, "devPhyBoundsF [%.3f, %.3f, %.3f, %.3f]", devPhyBoundsF.x, devPhyBoundsF.y, devPhyBoundsF.width, devPhyBoundsF.height);
526 //adjusted physical float -> physical integer
527 SysLog(NID_UI_CTRL, "devPhyBounds [%d, %.3d, %.3d, %.3d]", devPhyBounds.x, devPhyBounds.y, devPhyBounds.width, devPhyBounds.height);
529 Rectangle overlayLgcRect = _CoordinateSystemUtils::ConvertToInteger(overlayRectF);
530 Rectangle basePhyBounds = _CoordinateSystemUtils::ConvertToInteger(_CoordinateSystemUtils::Transform(clientRectF));
532 // 1. width , height unit check
533 if (_OverlayRegionImpl::IsValidOverlayRect(overlayLgcRect, devPhyBounds, basePhyBounds, modified) != E_SUCCESS)
535 SysTryReturn(NID_UI_CTRL, 0, null, E_INVALID_ARG, "[E_INVALID_ARG] IsValidOverlayRect is failed!");
540 SysLog(NID_UI_CTRL, "devBounds modified [%d, %d, %d, %d]", devPhyBounds.x, devPhyBounds.y, devPhyBounds.width, devPhyBounds.height);
543 // 2. check for using OverlayPanel simutaneously
544 for (idx = 0 ; idx < GetChildCount() ; idx++)
546 pOverlayPanel = dynamic_cast <_OverlayPanel*>(GetChild(idx));
547 SysTryReturn(NID_UI_CTRL, pOverlayPanel == null, null, E_SYSTEM, "[E_SYSTEM] Using OverlayRegion mixed with OverlayPanel is not supported!");
550 // 3. find the empty slot idx
551 for (idx = 0; idx < maxCount; idx++)
553 if (__ppOverlayerRegionImplArray[idx] == null)
559 SysTryReturn(NID_UI_CTRL, idx < maxCount, null, E_SYSTEM, "[E_SYSTEM] already used permitted maximum number of OverlayRegion!");
561 // 4. make OverlayRegion object
562 pOverlayRegionImpl = new (std::nothrow) _OverlayRegionImpl();
563 SysTryReturn(NID_UI_CTRL, pOverlayRegionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to make the OverlayRegionImpl instance!");
565 overlayRectF = _CoordinateSystemUtils::InverseTransform(_CoordinateSystemUtils::ConvertToFloat(devPhyBounds));
566 r = pOverlayRegionImpl->Construct(this, regionType, rect, overlayRectF, devPhyBounds);
569 delete pOverlayRegionImpl;
570 SysTryReturn(NID_UI_CTRL, 0, null, r, "[%s] Propagating.", GetErrorMessage(r));
573 pOverlayRegion = pOverlayRegionImpl->CreateOverlayRegionN();
574 if (pOverlayRegion == null)
576 delete pOverlayRegionImpl;
577 SysTryReturn(NID_UI_CTRL, 0, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
580 __ppOverlayerRegionImplArray[idx] = pOverlayRegionImpl;
581 pOverlayRegionImpl->SetFormArrayIndex(idx);
583 __overlayRegionCount++;
585 SetLastResult(E_SUCCESS);
587 return pOverlayRegion;
591 _Form::GetOverlayRegionCount(void) const
593 return __overlayRegionCount;
597 _Form::MoveOverlayRegion(bool top)
599 if (__ppOverlayerRegionImplArray == null)
603 for (int i = 0; i < OverlayRegion::GetMaxCount(); i++)
605 if (__ppOverlayerRegionImplArray[i] != null)
609 __ppOverlayerRegionImplArray[i]->GoForeground();
613 __ppOverlayerRegionImplArray[i]->GoBackground();
620 _Form::CreateSoftkey(unsigned long formStyle)
622 Bitmap* pTempBitmap = null;
623 FloatDimension softkeyDimension(0.0f, 0.0f);
624 FloatDimension softkeyDisplayDimension(0.0f, 0.0f);
625 FloatDimension optionkeyDimension(0.0f, 0.0f);
626 float fontSize = 0.0f;
627 float multilineFontSize = 0.0f;
628 float leftSoftkeyLeftMargin = 0.0f;
629 float rightSoftkeyLeftMargin = 0.0f;
630 float softkeyTopMargin = 0.0f;
631 Color softkeyNormalBackgroundColor;
632 Color softkeyPressedBackgroundColor;
633 Color softkeyNormalTextColor;
634 Color softkeyPressedTextColor;
635 Color softkeyNormalIconColor;
636 Color softkeyPressedIconColor;
638 GET_DIMENSION_CONFIG(FOOTER::SOFTKEY_RECT, GetOrientation(), softkeyDimension);
639 GET_DIMENSION_CONFIG(FOOTER::SOFTKEY_DISPLAY_RECT_WITH_TEXT, GetOrientation(), softkeyDisplayDimension);
640 GET_DIMENSION_CONFIG(FOOTER::OPTIONKEY_RECT, GetOrientation(), optionkeyDimension);
641 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_TEXT_SIZE, GetOrientation(), fontSize);
642 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_MULTILINE_TEXT_SIZE, GetOrientation(), multilineFontSize);
643 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_0_LEFT_MARGIN, GetOrientation(), leftSoftkeyLeftMargin);
644 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_1_LEFT_MARGIN, GetOrientation(), rightSoftkeyLeftMargin);
645 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_TOP_MARGIN, GetOrientation(), softkeyTopMargin);
646 GET_COLOR_CONFIG(FOOTER::SOFTKEY_BG_NORMAL, softkeyNormalBackgroundColor);
647 GET_COLOR_CONFIG(FOOTER::SOFTKEY_BG_PRESSED, softkeyPressedBackgroundColor);
648 GET_COLOR_CONFIG(FOOTER::SOFTKEY_TEXT_NORMAL, softkeyNormalTextColor);
649 GET_COLOR_CONFIG(FOOTER::SOFTKEY_TEXT_PRESSED, softkeyPressedTextColor);
650 GET_COLOR_CONFIG(FOOTER::SOFTKEY_ICON_NORMAL, softkeyNormalIconColor);
651 GET_COLOR_CONFIG(FOOTER::SOFTKEY_ICON_PRESSED, softkeyPressedIconColor);
653 result r = E_SUCCESS;
655 if (__pFooter != null)
657 __pFooter->SetStyle(TOOLBAR_SOFTKEY);
660 if (formStyle & FORM_STYLE_SOFTKEY_0)
662 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
663 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
664 if (__pSoftkeyNormalBitmap[_SOFTKEY_0])
666 delete __pSoftkeyNormalBitmap[_SOFTKEY_0];
667 __pSoftkeyNormalBitmap[_SOFTKEY_0] = null;
669 __pSoftkeyNormalBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
672 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_TEXT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
673 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
674 if (__pTextSoftkeyNormalBitmap[_SOFTKEY_0])
676 delete __pTextSoftkeyNormalBitmap[_SOFTKEY_0];
677 __pTextSoftkeyNormalBitmap[_SOFTKEY_0] = null;
679 __pTextSoftkeyNormalBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
682 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
683 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
684 if (__pSoftkeyPressedBitmap[_SOFTKEY_0])
686 delete __pSoftkeyPressedBitmap[_SOFTKEY_0];
687 __pSoftkeyPressedBitmap[_SOFTKEY_0] = null;
689 __pSoftkeyPressedBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
692 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_TEXT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
693 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
694 if (__pTextSoftkeyPressedBitmap[_SOFTKEY_0])
696 delete __pTextSoftkeyPressedBitmap[_SOFTKEY_0];
697 __pTextSoftkeyPressedBitmap[_SOFTKEY_0] = null;
699 __pTextSoftkeyPressedBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
702 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
703 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
704 if (__pSoftkeyNormalEffectBitmap[_SOFTKEY_0])
706 delete __pSoftkeyNormalEffectBitmap[_SOFTKEY_0];
707 __pSoftkeyNormalEffectBitmap[_SOFTKEY_0] = null;
709 __pSoftkeyNormalEffectBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
712 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_TEXT_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
713 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
714 if (__pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0])
716 delete __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0];
717 __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0] = null;
719 __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
722 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
723 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
724 if (__pSoftkeyPressedEffectBitmap[_SOFTKEY_0])
726 delete __pSoftkeyPressedEffectBitmap[_SOFTKEY_0];
727 __pSoftkeyPressedEffectBitmap[_SOFTKEY_0] = null;
729 __pSoftkeyPressedEffectBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
732 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_LEFT_TEXT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
733 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
734 if (__pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0])
736 delete __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0];
737 __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0] = null;
739 __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
742 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_ICON_ADD_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
743 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
745 if (__pSoftkeyNormalIcon[_SOFTKEY_0])
747 delete __pSoftkeyNormalIcon[_SOFTKEY_0];
748 __pSoftkeyNormalIcon[_SOFTKEY_0] = null;
750 __pSoftkeyNormalIcon[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalIconColor);
752 if (__pSoftkeyPressedIcon[_SOFTKEY_0])
754 delete __pSoftkeyPressedIcon[_SOFTKEY_0];
755 __pSoftkeyPressedIcon[_SOFTKEY_0] = null;
757 __pSoftkeyPressedIcon[_SOFTKEY_0] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedIconColor);
761 _Button* pButton = _Button::CreateButtonN();
765 pButton->SetSize(softkeyDimension);
766 pButton->SetTextSize(fontSize);
767 pButton->SetMultilineTextSize(multilineFontSize);
768 pButton->SetUserDefinedTextArea(FloatRectangle(leftSoftkeyLeftMargin, softkeyTopMargin, softkeyDisplayDimension.width, softkeyDisplayDimension.height));
769 pButton->SetTextColor(_BUTTON_STATUS_NORMAL, softkeyNormalTextColor);
770 pButton->SetTextColor(_BUTTON_STATUS_PRESSED, softkeyPressedTextColor);
771 __pFooter->SetButton(LEFT_BUTTON, pButton);
775 if (formStyle & FORM_STYLE_SOFTKEY_1)
777 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
778 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
779 if (__pSoftkeyNormalBitmap[_SOFTKEY_1])
781 delete __pSoftkeyNormalBitmap[_SOFTKEY_1];
782 __pSoftkeyNormalBitmap[_SOFTKEY_1] = null;
784 __pSoftkeyNormalBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
787 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_TEXT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
788 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
789 if (__pTextSoftkeyNormalBitmap[_SOFTKEY_1])
791 delete __pTextSoftkeyNormalBitmap[_SOFTKEY_1];
792 __pTextSoftkeyNormalBitmap[_SOFTKEY_1] = null;
794 __pTextSoftkeyNormalBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
797 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
798 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
799 if (__pSoftkeyPressedBitmap[_SOFTKEY_1])
801 delete __pSoftkeyPressedBitmap[_SOFTKEY_1];
802 __pSoftkeyPressedBitmap[_SOFTKEY_1] = null;
804 __pSoftkeyPressedBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
807 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_TEXT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
808 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
809 if (__pTextSoftkeyPressedBitmap[_SOFTKEY_1])
811 delete __pTextSoftkeyPressedBitmap[_SOFTKEY_1];
812 __pTextSoftkeyPressedBitmap[_SOFTKEY_1] = null;
814 __pTextSoftkeyPressedBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
817 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
818 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
819 if (__pSoftkeyNormalEffectBitmap[_SOFTKEY_1])
821 delete __pSoftkeyNormalEffectBitmap[_SOFTKEY_1];
822 __pSoftkeyNormalEffectBitmap[_SOFTKEY_1] = null;
824 __pSoftkeyNormalEffectBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
827 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_TEXT_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
828 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
829 if (__pTextSoftkeyNormalEffectBitmap[_SOFTKEY_1])
831 delete __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_1];
832 __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_1] = null;
834 __pTextSoftkeyNormalEffectBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
837 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
838 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
839 if (__pSoftkeyPressedEffectBitmap[_SOFTKEY_1])
841 delete __pSoftkeyPressedEffectBitmap[_SOFTKEY_1];
842 __pSoftkeyPressedEffectBitmap[_SOFTKEY_1] = null;
844 __pSoftkeyPressedEffectBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
847 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_RIGHT_TEXT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
848 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
849 if (__pTextSoftkeyPressedEffectBitmap[_SOFTKEY_1])
851 delete __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_1];
852 __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_1] = null;
854 __pTextSoftkeyPressedEffectBitmap[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
857 r = GET_BITMAP_CONFIG_N(FOOTER::SOFTKEY_ICON_ZOOM_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
858 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
860 if (__pSoftkeyNormalIcon[_SOFTKEY_1])
862 delete __pSoftkeyNormalIcon[_SOFTKEY_1];
863 __pSoftkeyNormalIcon[_SOFTKEY_1] = null;
865 __pSoftkeyNormalIcon[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalIconColor);
867 if (__pSoftkeyPressedIcon[_SOFTKEY_1])
869 delete __pSoftkeyPressedIcon[_SOFTKEY_1];
870 __pSoftkeyPressedIcon[_SOFTKEY_1] = null;
872 __pSoftkeyPressedIcon[_SOFTKEY_1] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedIconColor);
876 _Button* pButton = _Button::CreateButtonN();
879 pButton->SetSize(softkeyDimension);
880 pButton->SetTextSize(fontSize);
881 pButton->SetMultilineTextSize(multilineFontSize);
882 pButton->SetUserDefinedTextArea(FloatRectangle(rightSoftkeyLeftMargin, softkeyTopMargin, softkeyDisplayDimension.width, softkeyDisplayDimension.height));
883 pButton->SetTextColor(_BUTTON_STATUS_NORMAL, softkeyNormalTextColor);
884 pButton->SetTextColor(_BUTTON_STATUS_PRESSED, softkeyPressedTextColor);
885 __pFooter->SetButton(RIGHT_BUTTON, pButton);
889 if (formStyle & FORM_STYLE_OPTIONKEY)
891 r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
892 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
893 if (__pSoftkeyNormalBitmap[SOFTKEY_COUNT])
895 delete __pSoftkeyNormalBitmap[SOFTKEY_COUNT];
896 __pSoftkeyNormalBitmap[SOFTKEY_COUNT] = null;
898 __pSoftkeyNormalBitmap[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
901 r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
902 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
903 if (__pSoftkeyPressedBitmap[SOFTKEY_COUNT])
905 delete __pSoftkeyPressedBitmap[SOFTKEY_COUNT];
906 __pSoftkeyPressedBitmap[SOFTKEY_COUNT] = null;
908 __pSoftkeyPressedBitmap[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
911 r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
912 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
913 if (__pSoftkeyNormalEffectBitmap[SOFTKEY_COUNT])
915 delete __pSoftkeyNormalEffectBitmap[SOFTKEY_COUNT];
916 __pSoftkeyNormalEffectBitmap[SOFTKEY_COUNT] = null;
918 __pSoftkeyNormalEffectBitmap[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalBackgroundColor);
921 r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
922 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
923 if (__pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT])
925 delete __pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT];
926 __pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT] = null;
928 __pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor);
931 r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_HANDLE_MORE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
932 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
934 if (__pSoftkeyNormalIcon[SOFTKEY_COUNT])
936 delete __pSoftkeyNormalIcon[SOFTKEY_COUNT];
937 __pSoftkeyNormalIcon[SOFTKEY_COUNT] = null;
939 __pSoftkeyNormalIcon[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalIconColor);
942 r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_HANDLE_MORE_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
943 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
945 if (__pSoftkeyPressedIcon[SOFTKEY_COUNT])
947 delete __pSoftkeyPressedIcon[SOFTKEY_COUNT];
948 __pSoftkeyPressedIcon[SOFTKEY_COUNT] = null;
950 __pSoftkeyPressedIcon[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedIconColor);
953 _Button* pButton = _Button::CreateButtonN();
956 pButton->SetSize(optionkeyDimension);
957 pButton->SetTextColor(_BUTTON_STATUS_NORMAL, softkeyNormalTextColor);
958 pButton->SetTextColor(_BUTTON_STATUS_PRESSED, softkeyPressedTextColor);
959 __pFooter->SetButton(MIDDLE_BUTTON, pButton);
965 _Form::UpdateSoftkey(unsigned long formStyle)
967 float softkeyIconGap = 3.0f;
969 if (__formStyle & FORM_STYLE_SOFTKEY_0)// && __updatedSoftkeyCount % 2 == 0)
971 if (__pFooter->GetButton(LEFT_BUTTON))
973 __pFooter->GetButton(LEFT_BUTTON)->SetActionId(__actionId[_SOFTKEY_0]);
975 if (__softkeyText[_SOFTKEY_0] != String())
977 if (__pTextSoftkeyNormalBitmap[_SOFTKEY_0])
979 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *__pTextSoftkeyNormalBitmap[_SOFTKEY_0]);
982 if (__pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0])
984 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *__pTextSoftkeyNormalEffectBitmap[_SOFTKEY_0]);
987 if (__pTextSoftkeyPressedBitmap[_SOFTKEY_0])
989 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *__pTextSoftkeyPressedBitmap[_SOFTKEY_0]);
992 if (__pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0])
994 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *__pTextSoftkeyPressedEffectBitmap[_SOFTKEY_0]);
997 __pFooter->GetButton(LEFT_BUTTON)->SetText(__softkeyText[_SOFTKEY_0]);
999 __pFooter->RearrangeItems();
1003 if (__pSoftkeyNormalBitmap[_SOFTKEY_0])
1005 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *__pSoftkeyNormalBitmap[_SOFTKEY_0]);
1008 if (__pSoftkeyNormalEffectBitmap[_SOFTKEY_0])
1010 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *__pSoftkeyNormalEffectBitmap[_SOFTKEY_0]);
1013 if (__pSoftkeyPressedBitmap[_SOFTKEY_0])
1015 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedBitmap[_SOFTKEY_0]);
1018 if (__pSoftkeyPressedEffectBitmap[_SOFTKEY_0])
1020 __pFooter->GetButton(LEFT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedEffectBitmap[_SOFTKEY_0]);
1023 if (__pSoftkeyNormalIcon[_SOFTKEY_0])
1025 __pFooter->GetButton(LEFT_BUTTON)->SetBitmap(_BUTTON_STATUS_NORMAL,
1026 FloatPoint((__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().width - __pSoftkeyNormalIcon[_SOFTKEY_0]->GetWidthF()) / 2,
1027 (__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().height - __pSoftkeyNormalIcon[_SOFTKEY_0]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyNormalIcon[_SOFTKEY_0]);
1030 if (__pSoftkeyPressedIcon[_SOFTKEY_0])
1032 __pFooter->GetButton(LEFT_BUTTON)->SetBitmap(_BUTTON_STATUS_PRESSED,
1033 FloatPoint((__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().width - __pSoftkeyPressedIcon[_SOFTKEY_0]->GetWidthF()) / 2,
1034 (__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().height - __pSoftkeyPressedIcon[_SOFTKEY_0]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyPressedIcon[_SOFTKEY_0]);
1040 if (__formStyle & FORM_STYLE_SOFTKEY_1)// && __updatedSoftkeyCount % 2 == 0)
1042 if (__pFooter->GetButton(RIGHT_BUTTON))
1044 __pFooter->GetButton(RIGHT_BUTTON)->SetActionId(__actionId[_SOFTKEY_1]);
1046 if (__softkeyText[_SOFTKEY_1] != String())
1048 if (__pTextSoftkeyNormalBitmap[_SOFTKEY_1])
1050 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *__pTextSoftkeyNormalBitmap[_SOFTKEY_1]);
1053 if (__pTextSoftkeyNormalEffectBitmap[_SOFTKEY_1])
1055 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *__pTextSoftkeyNormalEffectBitmap[_SOFTKEY_1]);
1058 if (__pTextSoftkeyPressedBitmap[_SOFTKEY_1])
1060 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *__pTextSoftkeyPressedBitmap[_SOFTKEY_1]);
1063 if (__pTextSoftkeyPressedEffectBitmap[_SOFTKEY_1])
1065 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *__pTextSoftkeyPressedEffectBitmap[_SOFTKEY_1]);
1068 __pFooter->GetButton(RIGHT_BUTTON)->SetText(__softkeyText[_SOFTKEY_1]);
1070 __pFooter->RearrangeItems();
1074 if (__pSoftkeyNormalBitmap[_SOFTKEY_1])
1076 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *__pSoftkeyNormalBitmap[_SOFTKEY_1]);
1079 if (__pSoftkeyNormalEffectBitmap[_SOFTKEY_1])
1081 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *__pSoftkeyNormalEffectBitmap[_SOFTKEY_1]);
1084 if (__pSoftkeyPressedBitmap[_SOFTKEY_1])
1086 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedBitmap[_SOFTKEY_1]);
1089 if (__pSoftkeyPressedEffectBitmap[_SOFTKEY_1])
1091 __pFooter->GetButton(RIGHT_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedEffectBitmap[_SOFTKEY_1]);
1094 if (__pSoftkeyNormalIcon[_SOFTKEY_1])
1096 __pFooter->GetButton(RIGHT_BUTTON)->SetBitmap(_BUTTON_STATUS_NORMAL,
1097 FloatPoint((__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().width - __pSoftkeyNormalIcon[_SOFTKEY_1]->GetWidthF()) / 2,
1098 (__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().height - __pSoftkeyNormalIcon[_SOFTKEY_1]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyNormalIcon[_SOFTKEY_1]);
1101 if (__pSoftkeyPressedIcon[_SOFTKEY_1])
1103 __pFooter->GetButton(RIGHT_BUTTON)->SetBitmap(_BUTTON_STATUS_PRESSED,
1104 FloatPoint((__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().width - __pSoftkeyPressedIcon[_SOFTKEY_1]->GetWidthF()) / 2,
1105 (__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().height - __pSoftkeyPressedIcon[_SOFTKEY_1]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyPressedIcon[_SOFTKEY_1]);
1111 if (__formStyle & FORM_STYLE_OPTIONKEY)// && __updatedSoftkeyCount % 2 == 0)
1113 if (__pFooter->GetButton(MIDDLE_BUTTON))
1115 __pFooter->GetButton(MIDDLE_BUTTON)->SetActionId(__actionId[SOFTKEY_COUNT]);
1117 if (__pSoftkeyNormalBitmap[SOFTKEY_COUNT])
1119 __pFooter->GetButton(MIDDLE_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *__pSoftkeyNormalBitmap[SOFTKEY_COUNT]);
1122 if (__pSoftkeyPressedBitmap[SOFTKEY_COUNT])
1124 __pFooter->GetButton(MIDDLE_BUTTON)->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedBitmap[SOFTKEY_COUNT]);
1127 if (__pSoftkeyNormalEffectBitmap[SOFTKEY_COUNT])
1129 __pFooter->GetButton(MIDDLE_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *__pSoftkeyNormalEffectBitmap[SOFTKEY_COUNT]);
1132 if (__pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT])
1134 __pFooter->GetButton(MIDDLE_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT]);
1137 if (__pSoftkeyNormalIcon[SOFTKEY_COUNT])
1139 __pFooter->GetButton(MIDDLE_BUTTON)->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *__pSoftkeyNormalIcon[SOFTKEY_COUNT]);
1142 if (__pSoftkeyPressedIcon[SOFTKEY_COUNT])
1144 __pFooter->GetButton(MIDDLE_BUTTON)->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *__pSoftkeyPressedIcon[SOFTKEY_COUNT]);
1149 //__updatedSoftkeyCount++;
1153 _Form::GetDescription(void) const
1155 String description = _Control::GetDescription();
1157 String descriptionTemp(L"");
1159 descriptionTemp.Format(LOG_LEN_MAX, L"_Form: style(%d) transparent(%d %d %d %d) deflated(%d) deflatedHeight(%d) overlayRegionCount(%d) softkeyCount(%d) updatedSoftkeyCount(%d)",
1160 __formStyle, __transparentIndicator, __transparentHeader, __transparentFooter, __transparentTab, __deflated, __deflatedHeight,
1161 __overlayRegionCount, __softkeyCount, __updatedSoftkeyCount);
1163 description.Append(descriptionTemp);
1169 _Form::GetClientAreaCanvasN(void) const
1171 Canvas* pCanvas = GetCanvasN(GetClientBounds());
1172 if ((pCanvas == null) || (GetLastResult() != E_SUCCESS))
1174 SysLog(NID_UI_CTRL, "[%s] Propagated.", GetErrorMessage(GetLastResult()));
1183 _Form::GetSoftkeyActionId(_Softkey softkey) const
1185 if (CheckSoftkey(softkey) == false)
1190 return __actionId[softkey];
1194 _Form::GetOptionkeyActionId(void) const
1196 if (HasOptionkey() == false)
1201 return __actionId[SOFTKEY_COUNT];
1205 _Form::GetSoftkeyText(_Softkey softkey) const
1207 if (CheckSoftkey(softkey) == false)
1212 return __softkeyText[softkey];
1216 _Form::SetFormStyle(unsigned long formStyle)
1218 result r = E_SUCCESS;
1220 __formStyle = formStyle;
1224 __pIndicator = CreateIndicatorN();
1225 SysTryReturnVoidResult(NID_UI_CTRL, __pIndicator != null, r, "[%s] Propagating.", GetErrorMessage(r));
1227 float indicatorwidth = GetClientBoundsF().width;
1228 float indicatorheight = 0.0f;
1230 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
1232 __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, indicatorwidth, indicatorheight));
1234 r = GetLastResult();
1235 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1240 _Form::SetActionBarsTranslucent(unsigned long actionBars, bool translucent)
1244 ((actionBars & FORM_ACTION_BAR_INDICATOR) || (actionBars & FORM_ACTION_BAR_HEADER) ||
1245 (actionBars & FORM_ACTION_BAR_FOOTER) || (actionBars & FORM_ACTION_BAR_TAB)),
1246 E_INVALID_OPERATION, E_INVALID_OPERATION,
1247 ("[E_INVALID_OPERATION] The current state of the instance prohibits the execution of the specified operation."));
1249 if ((!(__formStyle & FORM_STYLE_INDICATOR) && (actionBars & FORM_ACTION_BAR_INDICATOR))
1250 || (!(__formStyle & FORM_STYLE_HEADER) && (actionBars & FORM_ACTION_BAR_HEADER))
1251 || (!(__formStyle & FORM_STYLE_FOOTER) && (actionBars & FORM_ACTION_BAR_FOOTER))
1252 || (!(__formStyle & FORM_STYLE_TEXT_TAB) && (actionBars & FORM_ACTION_BAR_TAB)))
1255 "[E_INVALID_OPERATION] The current state of the instance prohibits the execution of the specified operation.");
1256 return E_INVALID_OPERATION;
1259 result r = E_SUCCESS;
1261 Color bgColor(0, 0, 0, 0);
1262 if (actionBars & FORM_ACTION_BAR_INDICATOR)
1266 r = SetIndicatorOpacity(_INDICATOR_OPACITY_TRANSLUCENT);
1270 r = SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
1272 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1275 if (actionBars & FORM_ACTION_BAR_HEADER)
1277 if (IsHeaderTranslucent() != translucent)
1281 __pHeader->SetTransparent(translucent);
1282 __transparentHeader = translucent;
1287 if (IsHeaderVisible())
1289 if (IsIndicatorTranslucent() != IsHeaderTranslucent())
1291 if (IsIndicatorTranslucent())
1293 FloatRectangle bounds(0.0f, 0.0f, GetClientBoundsF().width, __pHeader->GetBoundsF().height);
1294 SetHeaderBounds(bounds);
1298 FloatRectangle bounds(0.0f, GetIndicatorBoundsF().height, GetClientBoundsF().width, __pHeader->GetBoundsF().height);
1299 SetHeaderBounds(bounds);
1302 else if (!IsIndicatorTranslucent() && !IsHeaderTranslucent())
1304 FloatRectangle bounds(0.0f, GetIndicatorBoundsF().height, GetClientBoundsF().width, __pHeader->GetBoundsF().height);
1305 SetHeaderBounds(bounds);
1309 if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
1311 FloatRectangle bounds(0.0f, GetIndicatorBoundsF().height, GetClientBoundsF().width, __pHeader->GetBoundsF().height);
1312 SetHeaderBounds(bounds);
1316 FloatRectangle bounds(0.0f, 0.0f, GetClientBoundsF().width, __pHeader->GetBoundsF().height);
1317 SetHeaderBounds(bounds);
1322 if (actionBars & FORM_ACTION_BAR_FOOTER)
1324 if (IsFooterTranslucent() != translucent)
1328 __pFooter->SetTransparent(translucent);
1329 __transparentFooter = translucent;
1334 AdjustClientBounds();
1340 _Form::SetActionBarsVisible(unsigned long actionBars, bool visible)
1344 ((actionBars & FORM_ACTION_BAR_INDICATOR) || (actionBars & FORM_ACTION_BAR_HEADER) ||
1345 (actionBars & FORM_ACTION_BAR_FOOTER)),
1346 E_INVALID_OPERATION,
1347 E_INVALID_OPERATION,
1348 ("[E_INVALID_OPERATION] The current state of the instance prohibits the execution of the specified operation. "));
1350 if ((!(__formStyle & FORM_STYLE_INDICATOR) && (actionBars & FORM_ACTION_BAR_INDICATOR))
1351 || (!(__formStyle & FORM_STYLE_HEADER) && (actionBars & FORM_ACTION_BAR_HEADER))
1352 || (!(__formStyle & FORM_STYLE_FOOTER) && (actionBars & FORM_ACTION_BAR_FOOTER)))
1354 SysLog(NID_UI_CTRL, "[E_INVALID_OPERATION] The current state of the instance prohibits the execution of the specified operation.");
1355 return E_INVALID_OPERATION;
1358 FloatRectangle bounds = GetBoundsF();
1361 if (actionBars & FORM_ACTION_BAR_INDICATOR)
1363 SetIndicatorShowState(visible);
1366 if (actionBars & FORM_ACTION_BAR_HEADER)
1368 if (IsHeaderVisible() != visible)
1372 if (visible == true)
1374 float adjHeight = 0.0f;
1375 if (IsIndicatorVisible())
1377 FloatRectangle indicatorBounds = GetIndicatorBoundsF();
1378 adjHeight = indicatorBounds.height;
1380 if (IsIndicatorTranslucent())
1382 if (!IsHeaderTranslucent())
1388 if (GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
1395 FloatRectangle bounds = __pHeader->GetBoundsF();
1396 bounds.y = adjHeight;
1398 SetHeaderBounds(bounds);
1400 __pHeader->SetVisibleState(visible);
1405 if (actionBars & FORM_ACTION_BAR_FOOTER)
1409 __pFooter->SetVisibleState(visible);
1413 AdjustClientBounds();
1419 _Form::SetTitleIcon(const Bitmap* pTitleBitmap)
1421 SysTryReturn(NID_UI_CTRL, (__formStyle & FORM_STYLE_TITLE), E_INVALID_OPERATION,
1422 E_INVALID_OPERATION, "[E_INVALID_OPERATION] This API is only for FORM_STYLE_TITLE.");
1424 SysTryReturn(NID_UI_CTRL, __pHeader, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] The title is not valid.");
1426 result r = __pHeader->SetTitleIcon(*pTitleBitmap);
1427 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1433 _Form::SetTitleText(const String& title, HorizontalAlignment alignment)
1435 SysTryReturn(NID_UI_CTRL, (__formStyle & FORM_STYLE_TITLE), E_INVALID_OPERATION,
1436 E_INVALID_OPERATION, "[E_INVALID_OPERATION] This API is only for FORM_STYLE_TITLE.");
1438 SysTryReturn(NID_UI_CTRL, __pHeader, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] The title is not valid.");
1440 result r = __pHeader->SetTitleText(title, alignment);
1441 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1447 _Form::SetSoftkeyEnabled(_Softkey softkey, bool enable)
1449 result r = E_SYSTEM;
1451 if (CheckSoftkey(softkey) == false)
1456 __enableSoftkey[softkey] = enable;
1464 _Form::SetOptionkeyActionId(int actionId)
1466 result r = E_SYSTEM;
1468 if (HasOptionkey() == false)
1473 __actionId[SOFTKEY_COUNT] = actionId;
1481 _Form::SetSoftkeyActionId(_Softkey softkey, int actionId)
1483 result r = E_SYSTEM;
1485 if (CheckSoftkey(softkey) == false)
1490 __actionId[softkey] = actionId;
1498 _Form::SetSoftkeyText(_Softkey softkey, const String& text)
1500 result r = E_SYSTEM;
1502 if (CheckSoftkey(softkey) == false)
1507 __softkeyText[softkey] = text;
1515 _Form::SetSoftkeyIcon(_Softkey softkey, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap)
1517 result r = E_SYSTEM;
1519 if (CheckSoftkey(softkey) == false)
1524 float softkey_icon_size = 0.0f;
1526 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_ICON_SIZE, GetOrientation(), softkey_icon_size);
1528 Bitmap* pClonedNormalBitmap = _BitmapImpl::CloneN(normalBitmap);
1530 if (pClonedNormalBitmap)
1532 if (__pSoftkeyNormalIcon[softkey] != null)
1534 delete __pSoftkeyNormalIcon[softkey];
1537 __pSoftkeyNormalIcon[softkey] = pClonedNormalBitmap;
1539 __pSoftkeyNormalIcon[softkey]->Scale(FloatDimension(softkey_icon_size, softkey_icon_size));
1544 if (pPressedBitmap != null)
1546 Bitmap* pClonedPressedBitmap = _BitmapImpl::CloneN(*pPressedBitmap);
1548 if (pClonedPressedBitmap)
1550 if (__pSoftkeyPressedIcon[softkey] != null)
1552 delete __pSoftkeyPressedIcon[softkey];
1555 __pSoftkeyPressedIcon[softkey] = pClonedPressedBitmap;
1557 __pSoftkeyPressedIcon[softkey]->Scale(FloatDimension(softkey_icon_size, softkey_icon_size));
1567 _Form::HasFooter(void) const
1580 _Form::HasHeader(void) const
1593 _Form::HasIndicator(void) const
1595 if (__pIndicator && (GetFormStyle() & FORM_STYLE_INDICATOR))
1606 _Form::HasTitle(void) const
1608 if (__pHeader && (__formStyle & FORM_STYLE_TITLE))
1619 _Form::HasTab(void) const
1621 if ((__pTab && (__formStyle & FORM_STYLE_TEXT_TAB))
1622 || (__pTab && (__formStyle & FORM_STYLE_ICON_TAB)))
1633 _Form::IsIndicatorVisible(void) const
1635 _Control* pParent = GetParent();
1636 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
1638 bool visible = true;
1640 if (pFrame && IsAttachedToMainTree())
1642 visible = __pIndicator->GetIndicatorShowState();
1643 SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1647 visible = __indicatorShowState;
1654 _Form::IsHeaderVisible(void) const
1658 return __pHeader->IsVisible();
1667 _Form::IsFooterVisible(void) const
1671 return __pFooter->IsVisible();
1680 _Form::IsIndicatorTranslucent(void) const
1682 _Control* pParent = GetParent();
1683 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
1685 _IndicatorOpacity opacity = _INDICATOR_OPACITY_UNKNOWN;
1687 bool transparent = false;
1689 if (pFrame && IsAttachedToMainTree())
1691 FrameShowMode mode = pFrame->GetShowMode();
1692 if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
1694 opacity = __pIndicator->GetIndicatorOpacity();
1695 SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1697 if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
1701 else if (opacity == _INDICATOR_OPACITY_OPAQUE)
1703 transparent = false;
1709 transparent = __transparentIndicator;
1716 _Form::IsHeaderTranslucent(void) const
1718 return __transparentHeader;
1722 _Form::IsFooterTranslucent(void) const
1724 return __transparentFooter;
1728 _Form::IsTabTranslucent(void) const
1730 return __transparentTab;
1734 _Form::HasOptionkey(void) const
1736 if (GetFormStyle() & FORM_STYLE_OPTIONKEY)
1747 _Form::HasSoftkey(_Softkey softkey) const
1749 unsigned long __formStyle = FORM_STYLE_NORMAL;
1751 if (softkey == _SOFTKEY_0)
1753 __formStyle = FORM_STYLE_SOFTKEY_0;
1755 else if (softkey == _SOFTKEY_1)
1757 __formStyle = FORM_STYLE_SOFTKEY_1;
1764 if (GetFormStyle() & __formStyle)
1775 _Form::IsSoftkeyEnabled(_Softkey softkey) const
1777 if (CheckSoftkey(softkey) == false)
1782 return __enableSoftkey[softkey];
1786 _Form::CheckSoftkey(_Softkey softkey) const
1790 if (HasSoftkey(softkey) == false)
1795 if (softkey >= _SOFTKEY_COUNT)
1804 _Form::IsOrientationRoot(void) const
1810 _Form::TranslateToClientAreaPosition(const Point& position) const
1812 Rectangle clientArea = GetClientBounds();
1813 return Point(position.x - clientArea.x, position.y - clientArea.y);
1817 _Form::TranslateToClientAreaPosition(const FloatPoint& position) const
1819 FloatRectangle clientArea = GetClientBoundsF();
1820 return FloatPoint(position.x - clientArea.x, position.y - clientArea.y);
1824 _Form::TranslateFromClientAreaPosition(const Point& clientPosition) const
1826 Rectangle clientArea = GetClientBounds();
1827 return Point(clientPosition.x + clientArea.x, clientPosition.y + clientArea.y);
1831 _Form::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const
1833 FloatRectangle clientArea = GetClientBoundsF();
1834 return FloatPoint(clientPosition.x + clientArea.x, clientPosition.y + clientArea.y);
1838 _Form::DeflateClientRectHeight(int height)
1849 __deflatedHeight = _CoordinateSystemUtils::ConvertToFloat(height);
1851 AdjustClientBounds();
1855 float adjHeight = 0.0f;
1857 if (!(__pFooter->GetVisibleState()) || IsFooterTranslucent())
1859 adjHeight = GetToolbarHeightF(false);
1862 FloatRectangle bounds(0.0f, GetClientBoundsF().y + GetClientBoundsF().height-adjHeight,
1863 GetClientBoundsF().width, GetToolbarHeightF(false));
1864 SetFooterBounds(bounds);
1871 _Form::DeflateClientRectHeight(float height)
1882 __deflatedHeight = height;
1884 AdjustClientBounds();
1888 float adjHeight = 0.0f;
1890 if (!(__pFooter->GetVisibleState()) || IsFooterTranslucent())
1892 adjHeight = GetToolbarHeightF(false);
1895 FloatRectangle bounds(0.0f, GetClientBoundsF().y + GetClientBoundsF().height-adjHeight,
1896 GetClientBoundsF().width, GetToolbarHeightF(false));
1897 SetFooterBounds(bounds);
1904 _Form::CreateHeaderN(void)
1906 _Toolbar* __pHeader = _Toolbar::CreateToolbarN(true);
1907 SysTryReturn(NID_UI_CTRL, __pHeader, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1913 _Form::CreateFooterN(void)
1915 _Toolbar* __pFooter = _Toolbar::CreateToolbarN(false);
1916 SysTryReturn(NID_UI_CTRL, __pFooter, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1922 _Form::CreateTabN(void)
1924 _Tab* __pTab = _Tab::CreateTabN();
1925 SysTryReturn(NID_UI_CTRL, __pTab, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1931 _Form::CreateIndicatorN(void)
1933 _Indicator* pIndicator = new (std::nothrow) _Indicator;
1934 SysTryReturn(NID_UI_CTRL, pIndicator, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1940 _Form::GetToolbarHeight(bool header) const
1942 int toolbarHeight = 0;
1944 if (header && (__formStyle & FORM_STYLE_HEADER))
1948 toolbarHeight = __pHeader->GetBounds().height;
1951 else if (header && (__formStyle & FORM_STYLE_TITLE))
1953 GET_SHAPE_CONFIG(HEADER::HEIGHT, GetOrientation(), toolbarHeight);
1955 else if (__formStyle & FORM_STYLE_SOFTKEY_0 || __formStyle & FORM_STYLE_SOFTKEY_1 || __formStyle & FORM_STYLE_OPTIONKEY)
1957 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_HEIGHT, GetOrientation(), toolbarHeight);
1963 toolbarHeight = __pFooter->GetBounds().height;
1966 //GET_SHAPE_CONFIG(L"FOOTER_HEIGHT", GetOrientation(), toolbarHeight);
1969 return toolbarHeight;
1973 _Form::GetToolbarHeightF(bool header) const
1975 FloatDimension toolbarSize(0.0f, 0.0f);
1977 if (header && (__formStyle & FORM_STYLE_HEADER))
1981 toolbarSize.height = __pHeader->GetBoundsF().height;
1984 else if (header && (__formStyle & FORM_STYLE_TITLE))
1986 GET_SHAPE_CONFIG(HEADER::HEIGHT, GetOrientation(), toolbarSize.height);
1988 else if (__formStyle & FORM_STYLE_SOFTKEY_0 || __formStyle & FORM_STYLE_SOFTKEY_1 || __formStyle & FORM_STYLE_OPTIONKEY)
1990 GET_SHAPE_CONFIG(FOOTER::SOFTKEY_HEIGHT, GetOrientation(), toolbarSize.height);
1996 toolbarSize.height = __pFooter->GetBoundsF().height;
2000 toolbarSize = TranslateSize(toolbarSize);
2002 return toolbarSize.height;
2006 _Form::GetTabHeight(void) const
2010 if ((__formStyle & FORM_STYLE_TEXT_TAB) || (__formStyle & FORM_STYLE_ICON_TAB))
2012 GET_SHAPE_CONFIG(TAB::HEIGHT, GetOrientation(), height);
2019 _Form::GetTabHeightF(void) const
2021 FloatDimension tabSize(0.0f, 0.0f);
2023 if ((__formStyle & FORM_STYLE_TEXT_TAB) || (__formStyle & FORM_STYLE_ICON_TAB))
2025 GET_SHAPE_CONFIG(TAB::HEIGHT, GetOrientation(), tabSize.height);
2028 tabSize = TranslateSize(tabSize);
2030 return tabSize.height;
2034 _Form::RemoveHeader(void)
2036 result r = E_SUCCESS;
2039 if (IsAttachedToMainTree())
2041 r = DetachSystemChild(*__pHeader);
2042 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
2046 AdjustClientBounds();
2057 _Form::RemoveFooter(void)
2059 result r = E_SUCCESS;
2062 if (IsAttachedToMainTree())
2064 r = DetachSystemChild(*__pFooter);
2065 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
2069 AdjustClientBounds();
2080 _Form::RemoveTab(void)
2082 result r = E_SUCCESS;
2085 if (IsAttachedToMainTree())
2087 r = DetachSystemChild(*__pTab);
2088 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
2092 AdjustClientBounds();
2103 _Form::RemoveIndicator(void)
2105 result r = E_SUCCESS;
2108 r = DetachSystemChild(*__pIndicator);
2109 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
2110 __pIndicator = null;
2121 _Form::SetHeaderBounds(Rectangle& bounds)
2123 SysTryReturn(NID_UI_CTRL, __pHeader, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Header isn't constructed.");
2125 bool movable = __pHeader->IsMovable();
2126 bool resizable = __pHeader->IsResizable();
2128 __pHeader->SetMovable(true);
2129 __pHeader->SetResizable(true);
2131 result r = E_SUCCESS;
2132 r = __pHeader->SetBounds(_CoordinateSystemUtils::ConvertToFloat(bounds));
2133 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2135 __pHeader->SetMovable(movable);
2136 __pHeader->SetResizable(resizable);
2138 AdjustClientBounds();
2144 _Form::SetHeaderBounds(FloatRectangle& bounds)
2146 SysTryReturn(NID_UI_CTRL, __pHeader, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Header isn't constructed.");
2148 bool movable = __pHeader->IsMovable();
2149 bool resizable = __pHeader->IsResizable();
2151 __pHeader->SetMovable(true);
2152 __pHeader->SetResizable(true);
2154 result r = E_SUCCESS;
2155 r = __pHeader->SetBounds(bounds);
2156 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2158 __pHeader->SetMovable(movable);
2159 __pHeader->SetResizable(resizable);
2161 AdjustClientBounds();
2167 _Form::SetFooterBounds(Rectangle& bounds)
2169 SysTryReturn(NID_UI_CTRL, __pFooter, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
2171 bool movable = __pFooter->IsMovable();
2172 bool resizable = __pFooter->IsResizable();
2174 __pFooter->SetMovable(true);
2175 __pFooter->SetResizable(true);
2177 result r = E_SUCCESS;
2178 r = __pFooter->SetBounds(_CoordinateSystemUtils::ConvertToFloat(bounds));
2179 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2181 __pFooter->SetMovable(movable);
2182 __pFooter->SetResizable(resizable);
2184 AdjustClientBounds();
2190 _Form::SetFooterBounds(FloatRectangle& bounds)
2192 SysTryReturn(NID_UI_CTRL, __pFooter, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
2194 bool movable = __pFooter->IsMovable();
2195 bool resizable = __pFooter->IsResizable();
2197 __pFooter->SetMovable(true);
2198 __pFooter->SetResizable(true);
2200 result r = E_SUCCESS;
2201 r = __pFooter->SetBounds(bounds);
2202 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2204 __pFooter->SetMovable(movable);
2205 __pFooter->SetResizable(resizable);
2207 AdjustClientBounds();
2213 _Form::SetTabBounds(Rectangle& bounds)
2215 SysTryReturn(NID_UI_CTRL, __pTab, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Tab isn't constructed.");
2217 bool movable = __pTab->IsMovable();
2218 bool resizable = __pTab->IsResizable();
2220 __pTab->SetMovable(true);
2221 __pTab->SetResizable(true);
2223 result r = E_SUCCESS;
2224 r = __pTab->SetBounds(_CoordinateSystemUtils::ConvertToFloat(bounds));
2225 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2227 __pTab->SetMovable(movable);
2228 __pTab->SetResizable(resizable);
2230 AdjustClientBounds();
2236 _Form::SetTabBounds(FloatRectangle& bounds)
2238 SysTryReturn(NID_UI_CTRL, __pTab, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Tab isn't constructed.");
2240 bool movable = __pTab->IsMovable();
2241 bool resizable = __pTab->IsResizable();
2243 __pTab->SetMovable(true);
2244 __pTab->SetResizable(true);
2246 result r = E_SUCCESS;
2247 r = __pTab->SetBounds(bounds);
2248 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2250 __pTab->SetMovable(movable);
2251 __pTab->SetResizable(resizable);
2253 AdjustClientBounds();
2259 _Form::AddActionEventListener(_IActionEventListener& listener)
2261 if (__pActionEvent == null)
2263 __pActionEvent = _ActionEvent::CreateInstanceN(*this);
2265 SysTryReturn(NID_UI_CTRL, __pActionEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.")
2268 result r = __pActionEvent->AddListener(listener);
2269 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2275 _Form::AddOptionkeyActionListener(_IActionEventListener& listener)
2277 if (HasOptionkey() == false)
2284 _Form::AddSoftkeyActionListener(_Softkey softkey, _IActionEventListener& listener)
2286 if (CheckSoftkey(softkey) == false)
2293 _Form::RemoveActionEventListener(_IActionEventListener& listener)
2295 SysTryReturn(NID_UI_CTRL, __pActionEvent, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance isn't constructed.")
2296 // Todo : check fail case of RemoveListener
2297 result r = __pActionEvent->RemoveListener(listener);
2298 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2304 _Form::RemoveOptionkeyActionListener(_IActionEventListener& listener)
2306 if (HasOptionkey() == false)
2313 _Form::RemoveSoftkeyActionListener(_Softkey softkey, _IActionEventListener& listener)
2315 if (CheckSoftkey(softkey) == false)
2322 _Form::OnActionPerformed(const _Control& source, int actionId)
2326 case ID_BACK_BUTTON:
2327 if (__keypadShowstate)
2329 _SystemUtilImpl::GenerateKeyEvent(KEY_EVENT_TYPE_PRESSED, _KEY_STOP);
2330 _SystemUtilImpl::GenerateKeyEvent(KEY_EVENT_TYPE_RELEASED, _KEY_STOP);
2334 if (__pFormBackEventListener)
2336 __pFormBackEventListener->OnFormBackRequested(*this);
2347 _Form::OnChildVisibleStateChanged(const _Control& child)
2349 if (IsHeaderVisible())
2351 float adjHeight = 0.0f;
2352 if (IsIndicatorVisible())
2354 FloatRectangle indicatorBounds = GetIndicatorBoundsF();
2355 adjHeight = indicatorBounds.height;
2357 if (IsIndicatorTranslucent())
2359 if (!IsHeaderTranslucent())
2365 if (GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
2372 FloatRectangle bounds = __pHeader->GetBoundsF();
2373 bounds.y = adjHeight;
2374 SetHeaderBounds(bounds);
2377 AdjustClientBounds();
2381 _Form::GetIndicatorBounds(void) const
2383 _Control* pParent = GetParent();
2384 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
2388 FrameShowMode mode = pFrame->GetShowMode();
2389 if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
2391 return Rectangle(0, 0, 0, 0);
2395 int indicatorwidth = GetClientBounds().width;
2396 int indicatorheight = 0;
2398 if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
2400 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
2404 GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetOrientation(), indicatorheight);
2407 Rectangle rect (0, 0, indicatorwidth, indicatorheight);
2409 SetLastResult(E_SUCCESS);
2415 _Form::GetIndicatorBoundsF(void) const
2417 _Control* pParent = GetParent();
2418 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
2422 FrameShowMode mode = pFrame->GetShowMode();
2423 if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
2425 return FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f);
2429 float indicatorwidth = GetClientBoundsF().width;
2430 float indicatorheight = 0.0f;
2432 if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
2434 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
2438 GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetOrientation(), indicatorheight);
2441 FloatRectangle rect (0.0f, 0.0f, indicatorwidth, indicatorheight);
2443 SetLastResult(E_SUCCESS);
2449 _Form::SetHeader(_Toolbar* pToolbar)
2451 __pHeader = pToolbar;
2455 _Form::SetFooter(_Toolbar* pToolbar)
2457 __pFooter = pToolbar;
2461 _Form::SetTab(_Tab* pTab)
2467 _Form::SetTabStyle(int style)
2469 __pTab->SetStyle(style);
2473 _Form::SetIndicatorShowState(bool state, bool hide)
2475 result r = E_SUCCESS;
2477 _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
2478 SysTryReturn(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to get evas");
2480 _Control* pParent = GetParent();
2483 pParent = const_cast<_Control*>(pEcoreEvas->GetFrame());
2485 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
2487 if (pFrame && IsAttachedToMainTree())
2489 FrameShowMode mode = pFrame->GetShowMode();
2490 if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
2492 r = __pIndicator->SetIndicatorShowState(state, hide);
2493 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2497 r = __pIndicator->SetIndicatorShowState(false);
2501 else if (!pFrame && IsAttachedToMainTree())
2503 r = __pIndicator->SetIndicatorShowState(false, true);
2506 __indicatorShowState = state;
2512 _Form::SetIndicatorOpacity(_IndicatorOpacity opacity)
2514 result r = E_SUCCESS;
2516 _Control* pParent = GetParent();
2517 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
2519 if (pFrame && IsAttachedToMainTree())
2521 FrameShowMode mode = pFrame->GetShowMode();
2522 if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
2524 r = __pIndicator->SetIndicatorOpacity(opacity);
2525 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
2529 if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
2531 __transparentIndicator = true;
2533 else if (opacity == _INDICATOR_OPACITY_OPAQUE)
2535 __transparentIndicator = false;
2542 _Form::AddIndicatorObject(void)
2544 result r = E_SUCCESS;
2548 r = __pIndicator->AddIndicatorObject(this);
2555 _Form::DeleteIndicatorObject(void)
2557 result r = E_SUCCESS;
2560 r = __pIndicator->DeleteIndicatorObject();
2567 _Form::SetKeypadShowState(bool state)
2569 __keypadShowstate = state;
2574 __pHeader->SetHideButton(true);
2578 __pFooter->SetHideButton(true);
2585 __pHeader->SetHideButton(false);
2589 __pFooter->SetHideButton(false);
2596 _Form::AttachedToMainTree(void)
2598 _Frame* pFrame = dynamic_cast<_Frame*>(GetParent());
2601 FrameShowMode mode = pFrame->GetShowMode();
2602 if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
2604 SetBounds(FloatRectangle(0.0f, 0.0f, pFrame->GetBoundsF().width, pFrame->GetBoundsF().height));
2608 result r = E_SUCCESS;
2610 if (FORM_STYLE_INDICATOR & GetFormStyle())
2612 AddIndicatorObject();
2614 if (__indicatorShowState != IsIndicatorVisible())
2616 SetIndicatorShowState(__indicatorShowState);
2619 if (__transparentIndicator != IsIndicatorTranslucent())
2621 if (__transparentIndicator == true)
2623 SetIndicatorOpacity(_INDICATOR_OPACITY_TRANSLUCENT);
2627 SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
2631 r = GetLastResult();
2632 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2634 else if (FORM_STYLE_INDICATOR_AUTO_HIDE & GetFormStyle())
2636 SetIndicatorShowState(__indicatorShowState, true);
2640 r = SetIndicatorShowState(false);
2641 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2648 _Form::DetachingFromMainTree(void)
2650 result r = E_SUCCESS;
2651 r = DeleteIndicatorObject();
2656 _Form::AdjustClientBounds(void)
2658 result r = E_SUCCESS;
2660 FloatDimension size = GetSizeF();
2661 FloatRectangle clientBounds(0.0f, 0.0f, size.width, size.height);
2665 clientBounds.height -= __deflatedHeight;
2668 FloatRectangle indicatorBounds = GetIndicatorBoundsF();
2670 _Control* pParent = GetParent();
2671 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
2674 FrameShowMode mode = pFrame->GetShowMode();
2675 if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
2677 if (FORM_STYLE_INDICATOR & __formStyle)
2679 if (IsIndicatorVisible() && !IsIndicatorTranslucent())
2681 clientBounds.y += indicatorBounds.height;
2682 clientBounds.height -= indicatorBounds.height;
2689 if (FORM_STYLE_INDICATOR & __formStyle)
2691 if (IsIndicatorVisible() && !IsIndicatorTranslucent())
2693 clientBounds.y += indicatorBounds.height;
2694 clientBounds.height -= indicatorBounds.height;
2701 if (__pHeader->GetVisibleState() && !IsHeaderTranslucent())
2703 clientBounds.y += GetToolbarHeightF(true);
2704 clientBounds.height -= GetToolbarHeightF(true);
2710 if (__pTab->GetVisibleState()) //&& !IsHeaderTranslucent())
2712 clientBounds.y += GetTabHeightF();
2713 clientBounds.height -= GetTabHeightF();
2719 if (FORM_STYLE_FOOTER & __formStyle || FORM_STYLE_SOFTKEY_0 & __formStyle || FORM_STYLE_SOFTKEY_1 & __formStyle
2720 || FORM_STYLE_OPTIONKEY & __formStyle)
2722 if (__pFooter->GetVisibleState() && !IsFooterTranslucent())
2724 clientBounds.height -= GetToolbarHeightF(false);
2729 SetClientBounds(clientBounds);
2735 _Form::OnBoundsChanged(void)
2737 FloatRectangle toolbarBounds;
2738 FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f);
2740 float indicatorheight = 0.0f;
2742 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
2745 __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
2747 AdjustClientBounds();
2751 if (IsIndicatorVisible())
2753 indicatorFloatBounds = GetIndicatorBoundsF();
2754 if (IsIndicatorTranslucent())
2756 if (!IsHeaderTranslucent())
2758 indicatorFloatBounds.height = 0.0f;
2762 if (GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
2764 indicatorFloatBounds.height = 0.0f;
2770 toolbarBounds = GetHeader()->GetBoundsF();
2771 toolbarBounds.width = GetSizeF().width;
2773 FloatRectangle bounds(toolbarBounds.x, indicatorFloatBounds.height, toolbarBounds.width, toolbarBounds.height);
2774 SetHeaderBounds(bounds);
2779 toolbarBounds = GetFooter()->GetBoundsF();
2780 toolbarBounds.width = GetSizeF().width;
2781 toolbarBounds.y = GetSizeF().height - toolbarBounds.height;
2782 SetFooterBounds(toolbarBounds);
2787 toolbarBounds = GetTab()->GetBoundsF();
2788 toolbarBounds.width = GetSizeF().width;
2789 SetTabBounds(toolbarBounds);
2792 AdjustClientBounds();
2796 _Form::TranslateSize(FloatDimension size ) const
2798 FloatDimension returnSize(0.0f, 0.0f);
2799 returnSize = CoordinateSystem::AlignToDevice(size);
2805 _Form::SetNotificationTrayOpenEnabled(bool enable)
2807 SysTryReturnResult(NID_UI_CTRL, (__formStyle & FORM_STYLE_INDICATOR || __formStyle & FORM_STYLE_INDICATOR_AUTO_HIDE), E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of form is invalid.");
2811 __pIndicator->SetNotificationTrayOpenEnabled(enable);
2817 _Form::IsNotificationTrayOpenEnabled(void) const
2819 SysTryReturnResult(NID_UI_CTRL, (__formStyle & FORM_STYLE_INDICATOR || __formStyle & FORM_STYLE_INDICATOR_AUTO_HIDE), E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of form is invalid.");
2823 __pIndicator->IsNotificationTrayOpenEnabled();
2829 _Form::GetFocusList(void) const
2831 if(!__pFocusControlList)
2833 __pFocusControlList.reset(GetFocusListN());
2834 __pFocusControlList->InsertAt(const_cast<_Form*>(this), 0);
2836 return __pFocusControlList.get();
2840 _Form::ResetFocusList(void)
2842 if(__pFocusControlList)
2844 __pFocusControlList.reset();
2849 _Form::UpdateClientBounds(const FloatDimension& size, FloatRectangle& clientBounds)
2851 clientBounds.width = size.width;
2852 clientBounds.height = size.height;
2856 clientBounds.height -= __deflatedHeight;
2859 FloatRectangle indicatorBounds = GetIndicatorBoundsF();
2861 _Control* pParent = GetParent();
2862 _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
2865 FrameShowMode mode = pFrame->GetShowMode();
2866 if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
2868 if (FORM_STYLE_INDICATOR & __formStyle)
2870 if (IsIndicatorVisible() && !IsIndicatorTranslucent())
2872 clientBounds.y += indicatorBounds.height;
2873 clientBounds.height -= indicatorBounds.height;
2880 if (FORM_STYLE_INDICATOR & __formStyle)
2882 if (IsIndicatorVisible() && !IsIndicatorTranslucent())
2884 clientBounds.y += indicatorBounds.height;
2885 clientBounds.height -= indicatorBounds.height;
2892 if (__pHeader->GetVisibleState() && !IsHeaderTranslucent())
2894 clientBounds.y += GetToolbarHeightF(true);
2895 clientBounds.height -= GetToolbarHeightF(true);
2901 if (__pTab->GetVisibleState()) //&& !IsHeaderTranslucent())
2903 clientBounds.y += GetTabHeightF();
2904 clientBounds.height -= GetTabHeightF();
2910 if (FORM_STYLE_FOOTER & __formStyle || FORM_STYLE_SOFTKEY_0 & __formStyle || FORM_STYLE_SOFTKEY_1 & __formStyle
2911 || FORM_STYLE_OPTIONKEY & __formStyle)
2913 if (__pFooter->GetVisibleState() && !IsFooterTranslucent())
2915 clientBounds.height -= GetToolbarHeightF(false);
2921 }}} // Tizen::Ui::Controls