2 * @defgroup Colorselector Colorselector
5 * @image html colorselector_inheritance_tree.png
6 * @image latex colorselector_inheritance_tree.eps
8 * @image html img/widget/colorselector/preview-00.png
9 * @image latex img/widget/colorselector/preview-00.eps
11 * A ColorSelector is a color selection widget. It allows application
12 * to set a series of colors.It also allows to load/save colors
13 * from/to config with a unique identifier, by default, the colors are
14 * loaded/saved from/to config using "default" identifier. The colors
15 * can be picked by user from the color set by clicking on individual
16 * color item on the palette or by selecting it from selector.
18 * This widget inherits from the @ref Layout one, so that all the
19 * functions acting on it also work for check objects.
21 * This widget emits the following signals, besides the ones sent from
23 * - @c "changed" - When the color value changes on selector
25 * - @c "color,item,selected" - When user clicks on color item. The
26 * event_info parameter of the callback will be the selected color
28 * - @c "color,item,longpressed" - When user long presses on color
29 * item. The event info parameter of the callback contains selected
32 * See @ref tutorial_colorselector.
36 typedef struct _Elm_Color_RGBA
44 typedef struct _Elm_Custom_Palette
46 const char *palette_name;
47 Eina_List *color_list;
51 * @enum Elm_Colorselector_Mode
52 * @typedef Elm_Colorselector_Mode
54 * Different modes supported by Colorselector
56 * @see elm_colorselector_mode_set()
57 * @see elm_colorselector_mode_get()
61 ELM_COLORSELECTOR_PALETTE = 0, /**< only color palette is displayed */
62 ELM_COLORSELECTOR_COMPONENTS, /**< only color selector is displayed */
63 ELM_COLORSELECTOR_BOTH, /**< Both Palette and selector is displayed, default */
64 ELM_COLORSELECTOR_PICKER, /**< only color picker is displayed */
65 ELM_COLORSELECTOR_ALL /**< all possible color selector is displayed */
66 } Elm_Colorselector_Mode;
69 * @brief Add a new colorselector to the parent
71 * @param parent The parent object
72 * @return The new object or NULL if it cannot be created
74 * @ingroup Colorselector
76 EAPI Evas_Object *elm_colorselector_add(Evas_Object *parent);
79 * Set color to colorselector
81 * @param obj Colorselector object
82 * @param r r-value of color
83 * @param g g-value of color
84 * @param b b-value of color
85 * @param a a-value of color
87 * @ingroup Colorselector
89 EAPI void elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a);
92 * Get current color from colorselector
94 * @param obj Colorselector object
95 * @param r integer pointer for r-value of color
96 * @param g integer pointer for g-value of color
97 * @param b integer pointer for b-value of color
98 * @param a integer pointer for a-value of color
100 * @ingroup Colorselector
102 EAPI void elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
105 * Set Colorselector's mode.
107 * @param obj Colorselector object
108 * @param mode Elm_Colorselector_Mode
110 * Colorselector supports three modes palette only, selector only and both.
112 * @ingroup Colorselector
114 EAPI void elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode);
117 * Get Colorselector's mode.
119 * @param obj Colorselector object
120 * @return mode The current mode of colorselector
122 * @ingroup Colorselector
124 EAPI Elm_Colorselector_Mode elm_colorselector_mode_get(const Evas_Object *obj);
127 * Get Palette item's color.
129 * @param it The color palette item.
130 * @param r integer pointer for r-value of color
131 * @param g integer pointer for g-value of color
132 * @param b integer pointer for b-value of color
133 * @param a integer pointer for a-value of color
135 * @ingroup Colorselector
137 EAPI void elm_colorselector_palette_item_color_get(const Elm_Object_Item *it, int *r, int *g, int *b, int *a);
140 * Set palette item's color.
142 * @param it The color palette item.
143 * @param r r-value of color
144 * @param g g-value of color
145 * @param b b-value of color
146 * @param a a-value of color
148 * @ingroup Colorselector
150 EAPI void elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r, int g, int b, int a);
153 * Add a new color item to palette.
155 * @param obj The Colorselector object
156 * @param r r-value of color
157 * @param g g-value of color
158 * @param b b-value of color
159 * @param a a-value of color
160 * @return A new color palette Item.
162 * @ingroup Colorselector
164 EAPI Elm_Object_Item *elm_colorselector_palette_color_add(Evas_Object *obj, int r, int g, int b, int a);
167 * Clear the palette items.
169 * @param obj The Colorselector object
171 * @ingroup Colorselector
173 EAPI void elm_colorselector_palette_clear(Evas_Object *obj);
176 * Set current palette's name
178 * @param obj The Colorselector object
179 * @param palette_name Name of palette
181 * When colorpalette name is set, colors will be loaded from and saved to config
182 * using the set name. If no name is set then colors will be loaded from or
183 * saved to "default" config.
185 * @ingroup Colorselector
187 EAPI void elm_colorselector_palette_name_set(Evas_Object *obj, const char *palette_name);
190 * Get current palette's name
192 * @param obj The Colorselector object
193 * @return Name of palette
195 * Returns the currently set palette name using which colors will be
196 * saved/loaded in to config.
198 * @ingroup Colorselector
200 EAPI const char *elm_colorselector_palette_name_get(const Evas_Object *obj);