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_GridLayoutImpl.h
19 * @brief This is the header file for _GridLayoutImpl class.
21 * This header file contains the declaration of _GridLayoutImpl class.
24 #ifndef _FUI_INTERNAL_GRID_LAYOUT_IMPL_H
25 #define _FUI_INTERNAL_GRID_LAYOUT_IMPL_H
27 #include <FUiGridLayout.h>
28 #include "FUi_LayoutImpl.h"
29 #include "FUi_LayoutTableLayout.h"
31 namespace Tizen { namespace Ui
41 * This is the destructor for this class.
45 virtual ~_GridLayoutImpl(void);
48 * Creates the instance of _GridLayoutImpl.
51 * @return The instance of _GridLayoutImpl.
52 * @param[in] pPublicLayout The public class of grid layout.
53 * @param[in] maxRow The max number of row.
54 * @param[in] maxColumn The max number of column.
55 * @exception E_SUCCESS The method was successful.
56 * @exception E_OUT_OF_MEMORY Insufficient memory.
58 static _GridLayoutImpl* CreateGridLayoutImplN(GridLayout* pPublicLayout, int maxRow, int maxColumn);
61 * Gets the name of public class.
64 * @return The name of public class.
66 virtual const char* GetPublicClassName(void) const;
69 * Gets the public class.
72 * @return The public class.
74 virtual const GridLayout& GetPublic(void) const;
77 * Gets the public class.
80 * @return The public class.
82 virtual GridLayout& GetPublic(void);
85 * Gets the core class.
88 * @return The core class.
90 virtual const _Layout::TableLayout& GetCore(void) const;
93 * Gets the core class.
96 * @return The core class.
98 virtual _Layout::TableLayout& GetCore(void);
101 * Gets the _GridLayoutImpl instance for the GridLayout.
104 * @return The _GridLayoutImpl instance.
105 * @param[in] pLayout The GridLayout instance.
107 static const _GridLayoutImpl* GetInstance(const GridLayout& layout);
110 * Gets the _GridLayoutImpl instance for the GridLayout.
113 * @return The _GridLayoutImpl instance.
114 * @param[in] pLayout The GridLayout instance.
116 static _GridLayoutImpl* GetInstance(GridLayout& layout);
119 * Sets the stretching ability of the specified column.
122 * @return An error code
123 * @param[in] columnIndex The column index
124 * @param[in] stretchable Set to @c true to make the column as stretchable @n
125 * @c false, otherwise
126 * @exception E_SUCCESS The method was successful.
127 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
129 result SetColumnStretchable(int columnIndex, bool stretchable);
132 * Sets the shrinking ability of the specified column.
135 * @return An error code
136 * @param[in] columnIndex The column index
137 * @param[in] shrinkable Set to @c true to make the column as shrinkable @n
138 * @c false, otherwise
139 * @exception E_SUCCESS The method was successful.
140 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
142 result SetColumnShrinkable(int columnIndex, bool shrinkable);
145 * Sets the collapsibility of a column.
148 * @return An error code
149 * @param[in] columnIndex The column index
150 * @param[in] collapsed Set to @c true to make the column as collapsible @n
151 * @c false, otherwise
152 * @exception E_SUCCESS The method was successful.
153 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
155 result SetColumnCollapsed(int columnIndex, bool collapsed);
158 * Sets the stretching ability of all columns.
161 * @return An error code
162 * @param[in] stretchable Set to @c true to set all columns as stretchable @n
163 * @c false, otherwise
164 * @exception E_SUCCESS The method was successful.
165 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
166 * @exception E_OUT_OF_MEMORY Insufficient memory.
168 result SetAllColumnsStretchable(bool stretchable);
171 * Sets the shrinking ability of all columns.
174 * @return An error code
175 * @param[in] shrinkable Set to @c true to set all columns as shrinkable @n
176 * @c false, otherwise
177 * @exception E_SUCCESS The method was successful.
178 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
179 * @exception E_OUT_OF_MEMORY Insufficient memory.
181 result SetAllColumnsShrinkable(bool shrinkable);
184 * Sets the space before the specified column index.
187 * @return An error code
188 * @param[in] columnIndex The column index
189 * @param[in] space The space
190 * @exception E_SUCCESS The method was successful.
191 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
193 result SetColumnSpacing(int columnIndex, float space);
196 * Sets the stretching ability of the specified row.
199 * @return An error code
200 * @param[in] rowIndex The row index
201 * @param[in] stretchable Set to @c true to make the row as stretchable @n
202 * @c false, otherwise
203 * @exception E_SUCCESS The method was successful.
204 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
206 result SetRowStretchable(int rowIndex, bool stretchable);
209 * Sets the shrinking ability of the specified row.
212 * @return An error code
213 * @param[in] rowIndex The row index
214 * @param[in] shrinkable Set to @c true to make the row as shrinkable @n
215 * @c false, otherwise
216 * @exception E_SUCCESS The method was successful.
217 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
219 result SetRowShrinkable(int rowIndex, bool shrinkable);
222 * Sets the collapsibility of the specified row.
225 * @return An error code
226 * @param[in] rowIndex The row index
227 * @param[in] collapsed Set to @c true to make the row as collapsible @n
228 * @c false, otherwise
229 * @exception E_SUCCESS The method was successful.
230 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
232 result SetRowCollapsed(int rowIndex, bool collapsed);
235 * Sets the stretching ability of all rows.
238 * @return An error code
239 * @param[in] stretchable Set to @c true to set all rows as stretchable @n
240 * @c false, otherwise
241 * @exception E_SUCCESS The method was successful.
242 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
243 * @exception E_OUT_OF_MEMORY Insufficient memory.
245 result SetAllRowsStretchable(bool stretchable);
248 * Sets the shrinking ability of all rows.
251 * @return An error code
252 * @param[in] shrinkable Set to @c true to set all rows as shrinkable @n
253 * @c false, otherwise
254 * @exception E_SUCCESS The method was successful.
255 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
256 * @exception E_OUT_OF_MEMORY Insufficient memory.
258 result SetAllRowsShrinkable(bool shrinkable);
261 * Sets the space before the specified column index.
264 * @return An error code
265 * @param[in] rowIndex The row index
266 * @param[in] space The space
267 * @exception E_SUCCESS The method was successful.
268 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
270 result SetRowSpacing(int rowIndex, float space);
273 * Adds the control at the specified position.
274 * Sets the position and span of the control.
277 * @return An error code
278 * @param[in] control The control for which the position is set
279 * @param[in] row The row index
280 * @param[in] column The column index
281 * @param[in] rowSpan The row span specifies how many cells in the row should be merged into a cell.
282 * @param[in] columnSpan The column span specifies how many cells in the column should be merged into a cell.
283 * @exception E_SUCCESS The method was successful.
284 * @exception E_INVALID_ARG The specified input parameter is invalid.
285 * @exception E_OUT_OF_RANGE Input Argument value over the max value.
286 * @exception E_SYSTEM A system error occurred.
288 result SetPosition(_ControlImpl& control, int row, int column, int rowSpan, int columnSpan);
291 * Gets the type of the layout.
294 * @return The layout type
296 virtual LayoutType GetLayoutType(void) const;
300 * This is the default constructor for this class.
304 _GridLayoutImpl(GridLayout* pPublicLayout, _Layout::TableLayout* pCoreLayout);
307 * Gets the number of rows in a grid layout.
310 * @return The number of rows
311 * @exception E_SUCCESS The method was successful.
312 * @exception E_INVALID_STATE This instance is in an invalid state.
314 int GetRowCount(void) const;
317 * Gets the number of columns in a grid layout.
320 * @return The number of columns
321 * @exception E_SUCCESS The method was successful.
322 * @exception E_INVALID_STATE This instance is in an invalid state.
324 int GetColumnCount(void) const;
328 * This is the copy constructor for this class.
332 _GridLayoutImpl(const _GridLayoutImpl&);
335 * This is the substitution operator for this class.
339 _GridLayoutImpl& operator =(const _GridLayoutImpl&);
342 * Initializes this instance of _GridLayoutImpl with the specified parameters.
345 * @return An error code
346 * @param[in] maxRow The max number of rows
347 * @param[in] maxColumn The max number of columns
348 * @exception E_SUCCESS The method was successful.
349 * @exception E_INVALID_STATE This instance is in an invalid state.
350 * @exception E_INVALID_ARG The specified input parameter is invalid.
351 * @exception E_SYSTEM A system error occurred.
353 result Construct(int maxRow, int maxColumn);
359 friend class GridLayout;
360 }; // _GridLayoutImpl
364 #endif // #ifndef _FUI_INTERNAL_GRID_LAYOUT_IMPL_H