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_VerticalBoxLayoutImpl.h
19 * @brief This is the header file for _VerticalBoxLayoutImpl class.
21 * This header file contains the declaration of _VerticalBoxLayoutImpl class.
24 #ifndef _FUI_INTERNAL_VERTICAL_BOX_LAYOUT_IMPL_H
25 #define _FUI_INTERNAL_VERTICAL_BOX_LAYOUT_IMPL_H
27 #include <FUiVerticalBoxLayout.h>
28 #include "FUi_LayoutImpl.h"
29 #include "FUi_LayoutLinearLayout.h"
31 namespace Tizen { namespace Ui
34 class VerticalBoxLayout;
36 class _VerticalBoxLayoutImpl
41 * This is the destructor for this class.
45 virtual ~_VerticalBoxLayoutImpl(void);
48 * Creates the instance of _VerticalBoxLayoutImpl.
51 * @return The instance of _VerticalBoxLayoutImpl.
52 * @param[in] pPublicLayout The public class of vertical box layout.
53 * @param[in] direction The direction of vertical box layout.
54 * @exception E_SUCCESS The method was successful.
55 * @exception E_OUT_OF_MEMORY Insufficient memory.
57 static _VerticalBoxLayoutImpl* CreateVerticalBoxLayoutImplN(VerticalBoxLayout* pPublicLayout, VerticalDirection direction = VERTICAL_DIRECTION_DOWNWARD);
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 VerticalBoxLayout& GetPublic(void) const;
76 * Gets the public class.
79 * @return The public class.
81 virtual VerticalBoxLayout& 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 _VerticalBoxLayoutImpl instance for the VerticalBoxLayout.
103 * @return The _VerticalBoxLayoutImpl instance.
104 * @param[in] pLayout The VerticalBoxLayout instance.
106 static const _VerticalBoxLayoutImpl* GetInstance(const VerticalBoxLayout& layout);
109 * Gets the _VerticalBoxLayoutImpl instance for the VerticalBoxLayout.
112 * @return The _VerticalBoxLayoutImpl instance.
113 * @param[in] pLayout The VerticalBoxLayout instance.
115 static _VerticalBoxLayoutImpl* GetInstance(VerticalBoxLayout& layout);
118 * Gets the direction of the VerticalBoxLayout.
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(VerticalDirection& direction) const;
129 * Sets the horizontal 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 horizontal 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 SetHorizontalAlignment(_ControlImpl& control, LayoutHorizontalAlignment horAlign);
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 horizontal 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 SetHorizontalMargin(_ControlImpl& control, float left, float right);
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 SetItemHorizontalFitPolicy(_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 SetItemVerticalFitPolicy(_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 _VerticalBoxLayoutImpl(VerticalBoxLayout* pPublicLayout, _Layout::LinearLayout* pCoreLayout);
249 * This is the copy constructor for this class.
253 _VerticalBoxLayoutImpl(const _VerticalBoxLayoutImpl&);
256 * This is the substitution operator for this class.
260 _VerticalBoxLayoutImpl& operator =(const _VerticalBoxLayoutImpl&);
263 * Initializes this instance of _VerticalBoxLayoutImpl with the specified parameters.
266 * @return An error code
267 * @param[in] direction The direction of vertical 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(VerticalDirection direction);
274 }; // _VerticalBoxLayoutImpl
278 #endif // _FUI_INTERNAL_VERTICAL_BOX_LAYOUT_IMPL_H