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_RelativeLayoutImpl.h
19 * @brief This is the header file for _RelativeLayoutImpl class.
21 * This header file contains the declaration of _RelativeLayoutImpl class.
24 #ifndef _FUI_INTERNAL_RELATIVE_LAYOUT_IMPL_H
25 #define _FUI_INTERNAL_RELATIVE_LAYOUT_IMPL_H
27 #include <FUiRelativeLayout.h>
28 #include "FUi_LayoutImpl.h"
29 #include "FUi_LayoutRelativeLayout.h"
31 namespace Tizen { namespace Ui
36 class _RelativeLayoutImpl
41 * This is the destructor for this class.
45 virtual ~_RelativeLayoutImpl(void);
48 * Creates the instance of _RelativeLayoutImpl.
51 * @return The instance of _RelativeLayoutImpl.
52 * @param[in] pPublicLayout The public class of relative layout.
53 * @exception E_SUCCESS The method was successful.
54 * @exception E_OUT_OF_MEMORY Insufficient memory.
56 static _RelativeLayoutImpl* CreateRelativeLayoutImplN(RelativeLayout* pPublicLayout);
59 * Gets the name of public class.
62 * @return The name of public class.
64 virtual const char* GetPublicClassName(void) const;
67 * Gets the public class.
70 * @return The public class.
72 virtual const RelativeLayout& GetPublic(void) const;
75 * Gets the public class.
78 * @return The public class.
80 virtual RelativeLayout& GetPublic(void);
83 * Gets the core class.
86 * @return The core class.
88 virtual const _Layout::RelativeLayout& GetCore(void) const;
91 * Gets the core class.
94 * @return The core class.
96 virtual _Layout::RelativeLayout& GetCore(void);
99 * Gets the _RelativeLayoutImpl instance for the RelativeLayout.
102 * @return The _RelativeLayoutImpl instance.
103 * @param[in] pLayout The RelativeLayout instance.
105 static const _RelativeLayoutImpl* GetInstance(const RelativeLayout& layout);
108 * Gets the _RelativeLayoutImpl instance for the RelativeLayout.
111 * @return The _RelativeLayoutImpl instance.
112 * @param[in] pLayout The RelativeLayout instance.
114 static _RelativeLayoutImpl* GetInstance(RelativeLayout& layout);
117 * Sets the specified control at the center of the parent control.
120 * @return An error code
121 * @param[in] control The control to be center aligned
122 * @param[in] alignment The center alignment for a control either vertically or horizontally
123 * @exception E_SUCCESS The method was successful.
124 * @exception E_INVALID_STATE This instance is in an invalid state.
125 * @exception E_INVALID_ARG The specified input parameter is invalid.
126 * @exception E_SYSTEM A system error occurred.
128 result SetCenterAligned(_ControlImpl& control, CenterAlignmentType alignment);
131 * Sets the relation of the specified child control for the edge with other control.
134 * @return An error code
135 * @param[in] childControl The control for which the relation is set
136 * @param[in] targetControl The target control @n
137 * It should be a parent or sibling.
138 * @param[in] edgeRelation The edge of the specified control to be aligned with the edge of the target control
139 * @exception E_SUCCESS The method was successful.
140 * @exception E_INVALID_STATE This instance is in an invalid state.
141 * @exception E_INVALID_ARG The specified input parameter is invalid.
142 * @exception E_SYSTEM A system error occurred.
144 result SetRelation(_ControlImpl& childControl, _ControlImpl& targetControl, RectangleEdgeRelation edgeRelation);
147 * Resets the center position of the specified control.
150 * @return An error code
151 * @param[in] childControl The control to be center aligned
152 * @param[in] alignment The center alignment for a control either vertically or horizontally
153 * @exception E_SUCCESS The method was successful.
154 * @exception E_INVALID_STATE This instance is in an invalid state.
155 * @exception E_INVALID_ARG The specified input parameter is invalid.
156 * @exception E_SYSTEM A system error occurred.
158 result ResetCenterAligned(_ControlImpl& control, CenterAlignmentType alignment);
161 * Resets the relation of the specified control for the vertical edge.
164 * @return An error code
165 * @param[in] childControl The control for which the relation is reset
166 * @param[in] edgeType The edge type of the specified control
167 * @exception E_SUCCESS The method was successful.
168 * @exception E_INVALID_STATE This instance is in an invalid state.
169 * @exception E_INVALID_ARG The specified input parameter is invalid.
170 * @exception E_SYSTEM A system error occurred.
172 result ResetRelation(_ControlImpl& control, RectangleEdgeType edgeType);
175 * Sets the height of the specified control to the fixed size.
178 * @return An error code
179 * @param[in] childControl The control for which the height is set
180 * @param[in] height The value of the height
181 * @exception E_SUCCESS The method was successful.
182 * @exception E_INVALID_STATE This instance is in an invalid state.
184 result SetHeight(_ControlImpl& control, float height);
187 * Sets the width of the specified control to the fixed size.
190 * @return An error code
191 * @param[in] childControl The control for which the width is set
192 * @param[in] width The value of the width
193 * @exception E_SUCCESS The method was successful.
194 * @exception E_INVALID_STATE This instance is in an invalid state.
196 result SetWidth(_ControlImpl& control, float width);
199 * Sets the margins of the specified control.
202 * @return An error code
203 * @param[in] item The control for which the margins are set
204 * @param[in] left The left margin
205 * @param[in] right The right margin
206 * @param[in] top The top margin
207 * @param[in] bottom The bottom margin
208 * @exception E_SUCCESS The method was successful.
209 * @exception E_INVALID_STATE This instance is in an invalid state.
211 result SetItemMargin(const _ControlImpl& item, float left, float right, float top, float bottom);
214 * Sets the width of the specified control as per the fitting policy.
217 * @return An error code
218 * @param[in] item The control for which the width is set
219 * @param[in] policy The fitting policy for the width
220 * @exception E_SUCCESS The method was successful.
221 * @exception E_INVALID_STATE This instance is in an invalid state.
223 result SetItemHorizontalFitPolicy(const _ControlImpl& item, const FitPolicy policy);
226 * Sets the height of the specified control as per the fitting policy.
229 * @return An error code
230 * @param[in] childControl The control for which the height is set
231 * @param[in] policy The fitting policy for the height
232 * @exception E_SUCCESS The method was successful.
233 * @exception E_INVALID_STATE This instance is in an invalid state.
235 result SetItemVerticalFitPolicy(const _ControlImpl& item, const FitPolicy policy);
238 * Gets the type of the layout.
241 * @return The layout type
243 virtual LayoutType GetLayoutType(void) const;
247 * This is the default constructor for this class.
251 _RelativeLayoutImpl(RelativeLayout* pPublicLayout, _Layout::RelativeLayout* pCoreLayout);
252 }; // _RelativeLayoutImpl
256 #endif // _FUI_INTERNAL_RELATIVE_LAYOUT_IMPL_H