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.h
19 * @brief This is the header file for the %_Form class.
21 * This header file contains the declarations of the %_Form class.
23 #ifndef _FUI_CTRL_INTERNAL_FORM_H_
24 #define _FUI_CTRL_INTERNAL_FORM_H_
26 #include <FUiCtrlControlsTypes.h>
27 #include <FUiCtrlOverlayRegion.h>
28 #include "FUi_Control.h"
29 #include "FUiCtrl_IActionEventListener.h"
30 #include "FUi_EcoreEvas.h"
33 namespace Tizen { namespace Ui { namespace Controls
41 class _OverlayRegionImpl;
42 class _IFormBackEventListener;
46 _FORM_STYLE_NORMAL = 0x00000000, /**< The basic form style */
47 _FORM_STYLE_TITLE = 0x00000001, /**< @deprecated This enumeration field is deprecated because the use of the Title control is no longer recommended.*/
48 _FORM_STYLE_INDICATOR = 0x00000002, /**< The form with the indicator area */
49 _FORM_STYLE_SOFTKEY_0 = 0x00000010, /**< @deprecated This enumeration field is deprecated because the use of the Softkey control is no longer recommended.*/
50 _FORM_STYLE_SOFTKEY_1 = 0x00000020, /**< @deprecated This enumeration field is deprecated because the use of the Softkey control is no longer recommended.*/
51 _FORM_STYLE_OPTIONKEY = 0x00000040, /**< @deprecated This enumeration field is deprecated because the use of the Optionkey control is no longer recommended.*/
52 _FORM_STYLE_TEXT_TAB = 0x00000100, /**< @deprecated This enumeration field is deprecated because the use of the Tab control is no longer recommended.*/
53 _FORM_STYLE_ICON_TAB = 0x00000200, /**< @deprecated This enumeration field is deprecated because the use of the Tab control is no longer recommended.*/
54 _FORM_STYLE_HEADER = 0x00001000, /**< The form with a header @b Since: @b 2.0 */
55 _FORM_STYLE_FOOTER = 0x00002000 /**< The form with a footer @b Since: @b 2.0 */
60 _SOFTKEY_0, /**< The left softkey */
61 _SOFTKEY_1, /**< The right softkey */
62 _SOFTKEY_COUNT /**< This is internal. If used in an application, the application can get rejected during the certification process. Define the softkey count */
71 class _OSP_EXPORT_ _Form
73 , public _IActionEventListener
74 , virtual public Tizen::Base::Runtime::IEventListener
75 , virtual public Tizen::Ui::_IUiEventListener
76 , virtual public Tizen::Ui::_IUiEventPreviewer
85 static _Form* CreateFormN(void);
87 void SetFormBackEventListener(_IFormBackEventListener* pFormBackEventListener);
89 unsigned long GetFormStyle(void) const;
90 _Toolbar* GetFooter(void) const;
91 _Toolbar* GetHeader(void) const;
92 _Tab* GetTab(void) const;
93 _Indicator* GetIndicator(void) const;
94 Tizen::Base::String GetTitleText(void) const;
95 HorizontalAlignment GetTitleTextHorizontalAlignment(void) const;
96 OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::Rectangle& rect, OverlayRegionType regionType);
97 int GetOverlayRegionCount(void) const;
98 Tizen::Graphics::Canvas* GetClientAreaCanvasN(void) const;
99 int GetSoftkeyActionId(_Softkey softkey) const;
100 int GetOptionkeyActionId(void) const;
101 Tizen::Base::String GetSoftkeyText(_Softkey softkey) const;
103 void SetFormStyle(unsigned long formStyle);
104 result SetActionBarsTranslucent(unsigned long actionBars, bool translucent);
105 result SetActionBarsVisible(unsigned long actionBars, bool visible);
106 result SetTitleIcon(const Tizen::Graphics::Bitmap* pTitleBitmap);
107 result SetTitleText(const Tizen::Base::String& title, HorizontalAlignment alignment);
108 result SetSoftkeyEnabled(_Softkey softkey, bool enable);
109 result SetOptionkeyActionId(int actionId);
110 result SetSoftkeyActionId(_Softkey softkey, int actionId);
111 result SetSoftkeyText(_Softkey softkey, const Tizen::Base::String& text);
112 result SetSoftkeyIcon(_Softkey softkey, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap);
114 bool HasFooter(void) const;
115 bool HasHeader(void) const;
116 bool HasIndicator(void) const;
117 bool HasTitle(void) const;
118 bool HasTab(void) const;
119 bool IsIndicatorVisible(void) const;
120 bool IsHeaderVisible(void) const;
121 bool IsFooterVisible(void) const;
122 bool IsIndicatorTranslucent(void) const;
123 bool IsHeaderTranslucent(void) const;
124 bool IsFooterTranslucent(void) const;
125 bool IsTabTranslucent(void) const;
126 bool HasOptionkey(void) const;
127 bool HasSoftkey(_Softkey softkey) const;
128 bool IsSoftkeyEnabled(_Softkey softkey) const;
129 bool CheckSoftkey(_Softkey softkey) const;
130 virtual bool IsOrientationRoot(void) const;
132 Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const;
133 Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const;
135 bool DeflateClientRectHeight(int height);
137 static _Toolbar* CreateHeaderN(void);
138 static _Toolbar* CreateFooterN(void);
139 static _Tab* CreateTabN(void);
140 static _Indicator* CreateIndicatorN(void);
142 int GetToolbarHeight(bool header) const;
143 int GetTabHeight(void) const;
144 bool RemoveHeader(void);
145 bool RemoveFooter(void);
146 bool RemoveTab(void);
147 bool RemoveIndicator(void);
148 result SetHeaderBounds(Tizen::Graphics::Rectangle& bounds);
149 result SetHeaderFloatBounds(Tizen::Graphics::FloatRectangle& bounds);
150 result SetFooterBounds(Tizen::Graphics::Rectangle& bounds);
151 result SetTabBounds(Tizen::Graphics::Rectangle& bounds);
152 Tizen::Graphics::Rectangle GetIndicatorBounds(void) const;
153 Tizen::Graphics::FloatRectangle GetIndicatorFloatBounds(void) const;
155 void SetHeader(_Toolbar* pToolbar);
156 void SetFooter(_Toolbar* pToolbar);
157 void SetTab(_Tab* pTab);
158 void CreateSoftkey(unsigned long formStyle);
159 void SetTabStyle(int style);
161 result SetIndicatorShowState(bool state);
162 result SetIndicatorOpacity(_IndicatorOpacity opacity);
164 result AdjustClientBounds(void);
166 result AddActionEventListener(Tizen::Ui::Controls::_IActionEventListener& listener);
167 void AddOptionkeyActionListener(Tizen::Ui::Controls::_IActionEventListener& listener);
168 void AddSoftkeyActionListener(_Softkey softkey, Tizen::Ui::Controls::_IActionEventListener& listener);
169 result RemoveActionEventListener(Tizen::Ui::Controls::_IActionEventListener& listener);
170 void RemoveOptionkeyActionListener(Tizen::Ui::Controls::_IActionEventListener& listener);
171 void RemoveSoftkeyActionListener(_Softkey softkey, Tizen::Ui::Controls::_IActionEventListener& listener);
173 result AttachedToMainTree(void);
174 result DetachingFromMainTree(void);
176 result AddIndicatorObject(void);
177 result DeleteIndicatorObject(void);
180 virtual void OnDraw(void);
181 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
182 virtual void OnChildVisibleStateChanged(const _Control& child);
183 virtual void OnBoundsChanged(void);
187 result SetPresenter(const _FormPresenter& formPresenter);
190 _Form(const _Form& value);
191 _Form& operator =(const _Form& value);
193 void MoveOverlayRegion(bool top);
194 void UpdateSoftkey(unsigned long formStyle);
196 virtual Tizen::Base::String GetDescription(void) const;
200 _FormPresenter* __pFormPresenter;
201 _IFormBackEventListener* __pFormBackEventListener;
203 unsigned long __formStyle;
204 _ActionEvent* __pActionEvent;
209 _Indicator* __pIndicator;
211 bool __transparentIndicator;
212 bool __transparentHeader;
213 bool __transparentFooter;
214 bool __transparentTab;
216 bool __indicatorShowState;
219 int __deflatedHeight;
221 int __overlayRegionCount;
222 _OverlayRegionImpl** __ppOverlayerRegionImplArray;
225 int __updatedSoftkeyCount;
226 int __actionId[_SOFTKEY_COUNT + 1];
227 bool __enableSoftkey[_SOFTKEY_COUNT + 1];
228 bool __showSoftkey[_SOFTKEY_COUNT + 1];
230 Tizen::Base::String __softkeyText[_SOFTKEY_COUNT + 1];
232 Tizen::Graphics::Bitmap* __pSoftkeyNormalBitmap[_SOFTKEY_COUNT+1];
233 Tizen::Graphics::Bitmap* __pSoftkeyNormalEffectBitmap[_SOFTKEY_COUNT+1];
234 Tizen::Graphics::Bitmap* __pSoftkeyPressedBitmap[_SOFTKEY_COUNT+1];
235 Tizen::Graphics::Bitmap* __pSoftkeyPressedEffectBitmap[_SOFTKEY_COUNT+1];
237 Tizen::Graphics::Bitmap* __pSoftkeyNormalIcon[_SOFTKEY_COUNT];
238 Tizen::Graphics::Bitmap* __pSoftkeyPressedIcon[_SOFTKEY_COUNT];
240 //Back button action ID
241 static const int ID_BACK_BUTTON = -10;
244 friend class _OverlayRegionImpl;
247 }}} // Tizen::Ui::Controls
249 #endif // _FUI_CTRL_INTERNAL_FORM_H_