2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 FUi_HorizontalBoxLayoutImpl.h
19 * @brief This is the header file for _HorizontalBoxLayoutImpl class.
21 * This header file contains the declaration of _HorizontalBoxLayoutImpl class.
24 #ifndef _FUI_INTERNAL_HORIZONTAL_BOX_LAYOUT_IMPL_H
25 #define _FUI_INTERNAL_HORIZONTAL_BOX_LAYOUT_IMPL_H
27 #include <FUiHorizontalBoxLayout.h>
28 #include "FUi_LayoutImpl.h"
29 #include "FUi_LayoutLinearLayout.h"
31 namespace Tizen { namespace Ui
34 class HorizontalBoxLayout;
36 class _HorizontalBoxLayoutImpl
41 * This is the destructor for this class.
45 virtual ~_HorizontalBoxLayoutImpl(void);
48 * Creates the instance of _HorizontalBoxLayoutImpl.
51 * @return The instance of _HorizontalBoxLayoutImpl.
52 * @param[in] pPublicLayout The public class of horizontal box layout.
53 * @param[in] direction The direction of horizontal box layout.
54 * @exception E_SUCCESS The method was successful.
55 * @exception E_OUT_OF_MEMORY Insufficient memory.
57 static _HorizontalBoxLayoutImpl* CreateHorizontalBoxLayoutImplN(HorizontalBoxLayout* pPublicLayout, HorizontalDirection direction = HORIZONTAL_DIRECTION_RIGHTWARD);
60 * Gets the name of public class.
63 * @return The name of public class.
65 virtual const char* GetPublicClassName(void) const;
68 * Gets the public class.
71 * @return The public class.
73 virtual const HorizontalBoxLayout& GetPublic(void) const;
76 * Gets the public class.
79 * @return The public class.
81 virtual HorizontalBoxLayout& GetPublic(void);
84 * Gets the public class.
87 * @return The public class.
89 virtual const _Layout::LinearLayout& GetCore(void) const;
92 * Gets the public class.
95 * @return The public class.
97 virtual _Layout::LinearLayout& GetCore(void);
100 * Gets the _HorizontalBoxLayoutImpl instance for the HorizontalBoxLayout.
103 * @return The _HorizontalBoxLayoutImpl instance.
104 * @param[in] pLayout The HorizontalBoxLayout instance.
106 static const _HorizontalBoxLayoutImpl* GetInstance(const HorizontalBoxLayout& layout);
109 * Gets the _HorizontalBoxLayoutImpl instance for the HorizontalBoxLayout.
112 * @return The _HorizontalBoxLayoutImpl instance.
113 * @param[in] pLayout The HorizontalBoxLayout instance.
115 static _HorizontalBoxLayoutImpl* GetInstance(HorizontalBoxLayout& layout);
118 * Gets the direction of the HorizontalBoxLayout.
121 * @return An error code
122 * @param[out] direction The direction in which the children are attached
123 * @exception E_SUCCESS The method was successful.
124 * @exception E_INVALID_STATE This instance is in an invalid state.
126 result GetDirection(HorizontalDirection& direction) const;
129 * Sets the vertical alignment of the specified control.
132 * @return An error code
133 * @param[in] control The control for which the alignment is set
134 * @param[in] alignment The vertical alignment
135 * @exception E_SUCCESS The method was successful.
136 * @exception E_INVALID_STATE This instance is in an invalid state.
137 * @exception E_INVALID_ARG The alignment parameter is invalid.
139 result SetVerticalAlignment(_ControlImpl& control, LayoutVerticalAlignment vertAlign);
142 * Sets the space between the specified control and its predecessor.
145 * @return An error code
146 * @param[in] control The control for which the space is set
147 * @param[in] space The space
148 * @exception E_SUCCESS The method was successful.
149 * @exception E_INVALID_ARG The specified input parameter is invalid.
150 * @exception E_INVALID_STATE This instance is in an invalid state.
152 result SetSpacing(_ControlImpl& control, float space);
155 * Sets the vertical margins of the specified control.
158 * @return An error code
159 * @param[in] control The control for which the margins are set
160 * @param[in] top The top margin
161 * @param[in] bottom The bottom margin
162 * @exception E_SUCCESS The method was successful.
163 * @exception E_INVALID_STATE This instance is in an invalid state.
165 result SetVerticalMargin(_ControlImpl& control, float top, float bottom);
168 * Sets the width of the specified control with the fixed length.
171 * @return An error code
172 * @param[in] control The control for which the width is set
173 * @param[in] virWidth This is not used.
174 * @param[in] phyWidth The value of the width
175 * @exception E_SUCCESS The method was successful.
176 * @exception E_INVALID_STATE This instance is in an invalid state.
178 result SetWidth(_ControlImpl& control, float width);
181 * Sets the width of the specified control with the fitting policy.
184 * @return An error code
185 * @param[in] control The control for which the width is set
186 * @param[in] policy The fitting policy for the width
187 * @exception E_SUCCESS The method was successful.
188 * @exception E_INVALID_STATE This instance is in an invalid state.
190 result SetItemVerticalFitPolicy(_ControlImpl& control, FitPolicy policy);
193 * Sets the height of the specified control with fixed length.
196 * @return An error code
197 * @param[in] control The control for which the height is set
198 * @param[in] virHeight This is not used.
199 * @param[in] phyHeight The value of the height
200 * @exception E_SUCCESS The method was successful.
201 * @exception E_INVALID_STATE This instance is in an invalid state.
203 result SetHeight(_ControlImpl& control, float height);
206 * Sets the height of the specified control with the fitting policy.
209 * @return An error code
210 * @param[in] control The control for which the height is set
211 * @param[in] policy The fitting policy for the height
212 * @exception E_SUCCESS The method was successful.
213 * @exception E_INVALID_STATE This instance is in an invalid state.
215 result SetItemHorizontalFitPolicy(_ControlImpl& control, FitPolicy policy);
218 * Sets the weight of the specified control.
221 * @return An error code
222 * @param[in] control The control for which the weight is set
223 * @param[in] weight The weight that indicates how much extra space the control occupies
224 * in proportion to it, in the HorizontalBoxLayout.
225 * @exception E_SUCCESS The method was successful.
226 * @exception E_INVALID_ARG The specified input parameter is invalid.
227 * @exception E_INVALID_STATE This instance is in an invalid state.
229 result SetWeight(_ControlImpl& control, float weight);
232 * Gets the type of the layout.
235 * @return The layout type
237 virtual LayoutType GetLayoutType(void) const;
241 * This is the default constructor for this class.
245 _HorizontalBoxLayoutImpl(HorizontalBoxLayout* pPublicLayout, _Layout::LinearLayout* pCoreLayout);
249 * This is the copy constructor for this class.
253 _HorizontalBoxLayoutImpl(const _HorizontalBoxLayoutImpl&);
256 * This is the substitution operator for this class.
260 _HorizontalBoxLayoutImpl& operator =(const _HorizontalBoxLayoutImpl&);
263 * Initializes this instance of _HorizontalBoxLayoutImpl with the specified parameters.
266 * @return An error code
267 * @param[in] direction The direction of horizontal box layout.
268 * @exception E_SUCCESS The method was successful.
269 * @exception E_INVALID_STATE This instance is in an invalid state.
270 * @exception E_INVALID_ARG The specified input parameter is invalid.
271 * @exception E_SYSTEM A system error occurred.
273 result Construct(HorizontalDirection direction);
274 }; // _HorizontalBoxLayoutImpl
278 #endif // _FUI_INTERNAL_HORIZONTAL_BOX_LAYOUT_IMPL_H