summaryrefslogtreecommitdiff
path: root/src/lib/elm_table.h
blob: 8ba6d99d2e2fd955f81981c6d410b11022566087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/**
 * @defgroup Table Table
 * @ingroup elm_container_group
 *
 * @image html table_inheritance_tree.png
 * @image latex table_inheritance_tree.eps
 *
 * @brief A container widget to arrange other widgets in a table where items
 *        can span multiple columns or rows - even overlap (and then be raised
 *        or lowered accordingly to adjust stacking if they do overlap).
 *
 * The row and column count is not fixed. The table widget adjusts itself when
 * subobjects are added to it dynamically.
 *
 * The most common way to use a table is:
 * @code
 * table = elm_table_add(win);
 * evas_object_show(table);
 * elm_table_padding_set(table, space_between_columns, space_between_rows);
 * elm_table_pack(table, table_content_object, x_coord, y_coord, colspan, rowspan);
 * elm_table_pack(table, table_content_object, next_x_coord, next_y_coord, colspan, rowspan);
 * elm_table_pack(table, table_content_object, other_x_coord, other_y_coord, colspan, rowspan);
 * @endcode
 *
 * @{
 */

/**
 * @brief Adds a new table to the parent.
 *
 * @since_tizen 2.3
 *
 * @param[in] parent The parent object
 * @return The new object, otherwise @c NULL if it cannot be created
 *
 * @ingroup Table
 */
EAPI Evas_Object *elm_table_add(Evas_Object *parent);

/**
 * @brief Sets the homogeneous layout in the table.
 *
 * @since_tizen 2.3
 *
 * @param[in] obj The layout object
 * @param[in] homogeneous The boolean value to set if the layout is homogeneous in the
 *                    table (@c EINA_TRUE = homogeneous,  @c EINA_FALSE = no homogeneous)
 *
 * @ingroup Table
 */
EAPI void      elm_table_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);

/**
 * @brief Gets the current table homogeneous mode.
 *
 * @since_tizen 2.3
 *
 * @param[in] obj The table object
 * @return The boolean that indicates if the layout is homogeneous in the table
 *         (@c EINA_TRUE = homogeneous,  @c EINA_FALSE = no homogeneous)
 *
 * @ingroup Table
 */
EAPI Eina_Bool elm_table_homogeneous_get(const Evas_Object *obj);

/**
 * @brief Sets padding between the cells.
 *
 * @since_tizen 2.3
 *
 * @remarks Default value is @c 0.
 *
 * @param[in] obj The layout object
 * @param[in] horizontal The horizontal padding
 * @param[in] vertical The vertical padding
 *
 * @ingroup Table
 */
EAPI void      elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical);

/**
 * @brief Gets the padding between cells.
 *
 * @since_tizen 2.3
 *
 * @param[in] obj The layout object
 * @param[out] horizontal The horizontal padding
 * @param[out] vertical The vertical padding
 *
 * @ingroup Table
 */
EAPI void      elm_table_padding_get(const Evas_Object *obj, Evas_Coord *horizontal, Evas_Coord *vertical);

/**
 * @brief Adds a subobject on the table with the coordinates passed.
 *
 * @since_tizen 2.3
 *
 * @remarks All positioning inside the table is relative to rows and columns, so
 *          a value of @c 0 for @a x and @a y, means the top left cell of the table, and a
 *          value of @c 1 for @a w and @a h means @a subobj only takes that @c 1 cell.
 *
 * @remarks Note that columns and rows only guarantee 16bit unsigned values at best.
 *          That means that col + colspan AND row + rowspan must fit inside 16bit
 *          unsigned values cleanly. You have been warned once that values exceed 15bit
 *          storage, and attempting to use values that are not able to fit in 16bits
 *          result in failure.
 *
 * @param[in] obj The table object
 * @param[in] subobj The subobject to be added to the table
 * @param[in] col The column number
 * @param[in] row The row number
 * @param[in] colspan The column span
 * @param[in] rowspan The row span
 *
 * @ingroup Table
 */
EAPI void      elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int col, int row, int colspan, int rowspan);

/**
 * @brief Removes the child from the table.
 *
 * @since_tizen 2.3
 *
 * @param[in] obj The table object
 * @param[in] subobj The subobject
 *
 * @ingroup Table
 */
EAPI void      elm_table_unpack(Evas_Object *obj, Evas_Object *subobj);

/**
 * @brief Removes all child objects from a table object.
 *
 * @since_tizen 2.3
 *
 * @param[in] obj The table object
 * @param[in] clear If @c true, the children are deleted,
 *              otherwise @c false to just remove them from the table
 *
 * @ingroup Table
 */
EAPI void      elm_table_clear(Evas_Object *obj, Eina_Bool clear);

/**
 * @brief Sets the packing location of an existing child of the table.
 *
 * @since_tizen 2.3
 *
 * @remarks Modifies the position of an object already in the table.
 *
 * @remarks All positioning inside the table is relative to rows and columns, so
 *          a value of @c 0 for @a x and @a y, means the top left cell of the table, and a
 *          value of @c 1 for @a w and @a h means @a subobj only takes that @c 1 cell.
 *
 * @param[in] subobj The subobject to be modified in the table
 * @param[in] x The row number
 * @param[in] y The column number
 * @param[in] w The row span
 * @param[in] h The column span
 *
 * @ingroup Table
 */
EAPI void      elm_table_pack_set(Evas_Object *subobj, int x, int y, int w, int h);

/**
 * @brief Gets the packing location of an existing child of the table.
 *
 * @since_tizen 2.3
 *
 * @param[in] subobj The subobject to be modified in the table
 * @param[out] x The row number
 * @param[out] y The column number
 * @param[out] w The row span
 * @param[out] h The column span
 *
 * @see elm_table_pack_set()
 *
 * @ingroup Table
 */
EAPI void      elm_table_pack_get(Evas_Object *subobj, int *x, int *y, int *w, int *h);

/**
 * @}
 */