362130e4089c1e1236d6233e8b92d84aa70d0e13
[framework/uifw/elementary.git] / src / lib / elm_grid.h
1    /**
2     * @defgroup Grid Grid
3     *
4     * The grid is a grid layout widget that lays out a series of children as a
5     * fixed "grid" of widgets using a given percentage of the grid width and
6     * height each using the child object.
7     *
8     * The Grid uses a "Virtual resolution" that is stretched to fill the grid
9     * widgets size itself. The default is 100 x 100, so that means the
10     * position and sizes of children will effectively be percentages (0 to 100)
11     * of the width or height of the grid widget
12     *
13     * @{
14     */
15
16    /**
17     * Add a new grid to the parent
18     *
19     * @param parent The parent object
20     * @return The new object or NULL if it cannot be created
21     *
22     * @ingroup Grid
23     */
24    EAPI Evas_Object *elm_grid_add(Evas_Object *parent);
25
26    /**
27     * Set the virtual size of the grid
28     *
29     * @param obj The grid object
30     * @param w The virtual width of the grid
31     * @param h The virtual height of the grid
32     *
33     * @ingroup Grid
34     */
35    EAPI void         elm_grid_size_set(Evas_Object *obj, int w, int h);
36
37    /**
38     * Get the virtual size of the grid
39     *
40     * @param obj The grid object
41     * @param w Pointer to integer to store the virtual width of the grid
42     * @param h Pointer to integer to store the virtual height of the grid
43     *
44     * @ingroup Grid
45     */
46    EAPI void         elm_grid_size_get(Evas_Object *obj, int *w, int *h);
47
48    /**
49     * Pack child at given position and size
50     *
51     * @param obj The grid object
52     * @param subobj The child to pack
53     * @param x The virtual x coord at which to pack it
54     * @param y The virtual y coord at which to pack it
55     * @param w The virtual width at which to pack it
56     * @param h The virtual height at which to pack it
57     *
58     * @ingroup Grid
59     */
60    EAPI void         elm_grid_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h);
61
62    /**
63     * Unpack a child from a grid object
64     *
65     * @param obj The grid object
66     * @param subobj The child to unpack
67     *
68     * @ingroup Grid
69     */
70    EAPI void         elm_grid_unpack(Evas_Object *obj, Evas_Object *subobj);
71
72    /**
73     * Faster way to remove all child objects from a grid object.
74     *
75     * @param obj The grid object
76     * @param clear If true, it will delete just removed children
77     *
78     * @ingroup Grid
79     */
80    EAPI void         elm_grid_clear(Evas_Object *obj, Eina_Bool clear);
81
82    /**
83     * Set packing of an existing child at to position and size
84     *
85     * @param subobj The child to set packing of
86     * @param x The virtual x coord at which to pack it
87     * @param y The virtual y coord at which to pack it
88     * @param w The virtual width at which to pack it
89     * @param h The virtual height at which to pack it
90     *
91     * @ingroup Grid
92     */
93    EAPI void         elm_grid_pack_set(Evas_Object *subobj, int x, int y, int w, int h);
94
95    /**
96     * get packing of a child
97     *
98     * @param subobj The child to query
99     * @param x Pointer to integer to store the virtual x coord
100     * @param y Pointer to integer to store the virtual y coord
101     * @param w Pointer to integer to store the virtual width
102     * @param h Pointer to integer to store the virtual height
103     *
104     * @ingroup Grid
105     */
106    EAPI void         elm_grid_pack_get(Evas_Object *subobj, int *x, int *y, int *w, int *h);
107
108    /**
109     * @}
110     */
111