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
42 const char *color_name;
45 typedef struct _Elm_Custom_Palette
47 const char *palette_name;
48 Eina_List *color_list;
52 * @enum Elm_Colorselector_Mode
53 * @typedef Elm_Colorselector_Mode
55 * Different modes supported by Colorselector
57 * @see elm_colorselector_mode_set()
58 * @see elm_colorselector_mode_get()
62 ELM_COLORSELECTOR_PALETTE = 0, /**< only color palette is displayed */
63 ELM_COLORSELECTOR_COMPONENTS, /**< only color selector is displayed */
64 ELM_COLORSELECTOR_BOTH, /**< Both Palette and selector is displayed, default */
65 ELM_COLORSELECTOR_PICKER, /**< only color picker is displayed */
66 ELM_COLORSELECTOR_PLANE, /**< only color plane is displayed */
67 ELM_COLORSELECTOR_PALETTE_PLANE, /**< both palette and plane is displayed */
68 ELM_COLORSELECTOR_ALL /**< all possible color selector is displayed */
69 } Elm_Colorselector_Mode;
72 * @brief Add a new colorselector to the parent
74 * @param parent The parent object
75 * @return The new object or NULL if it cannot be created
77 * @ingroup Colorselector
79 EAPI Evas_Object *elm_colorselector_add(Evas_Object *parent);
82 * Set color to colorselector
84 * @param obj Colorselector object
85 * @param r r-value of color
86 * @param g g-value of color
87 * @param b b-value of color
88 * @param a a-value of color
90 * @ingroup Colorselector
92 EAPI void elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a);
95 * Get current color from colorselector
97 * @param obj Colorselector object
98 * @param r integer pointer for r-value of color
99 * @param g integer pointer for g-value of color
100 * @param b integer pointer for b-value of color
101 * @param a integer pointer for a-value of color
103 * @ingroup Colorselector
105 EAPI void elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
108 * Set Colorselector's mode.
110 * @param obj Colorselector object
111 * @param mode Elm_Colorselector_Mode
113 * Colorselector supports three modes palette only, selector only and both.
115 * @ingroup Colorselector
117 EAPI void elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode);
120 * Get Colorselector's mode.
122 * @param obj Colorselector object
123 * @return mode The current mode of colorselector
125 * @ingroup Colorselector
127 EAPI Elm_Colorselector_Mode elm_colorselector_mode_get(const Evas_Object *obj);
130 * Get Palette item's color.
132 * @param it The color palette item.
133 * @param r integer pointer for r-value of color
134 * @param g integer pointer for g-value of color
135 * @param b integer pointer for b-value of color
136 * @param a integer pointer for a-value of color
138 * @ingroup Colorselector
140 EAPI void elm_colorselector_palette_item_color_get(const Elm_Object_Item *it, int *r, int *g, int *b, int *a);
143 * Set palette item's color.
145 * @param it The color palette item.
146 * @param r r-value of color
147 * @param g g-value of color
148 * @param b b-value of color
149 * @param a a-value of color
151 * @ingroup Colorselector
153 EAPI void elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r, int g, int b, int a);
156 * Add a new color item to palette.
158 * @param obj The Colorselector object
159 * @param r r-value of color
160 * @param g g-value of color
161 * @param b b-value of color
162 * @param a a-value of color
163 * @return A new color palette Item.
165 * @ingroup Colorselector
167 EAPI Elm_Object_Item *elm_colorselector_palette_color_add(Evas_Object *obj, int r, int g, int b, int a);
170 * Clear the palette items.
172 * @param obj The Colorselector object
174 * @ingroup Colorselector
176 EAPI void elm_colorselector_palette_clear(Evas_Object *obj);
179 * Get list of palette item's.
181 * @param obj The Colorselector object
182 * @return The list of color items.
184 * @ingroup Colorselector
186 EAPI Eina_List *elm_colorselector_palette_items_get(const Evas_Object *obj);
189 * Set current palette's name
191 * @param obj The Colorselector object
192 * @param palette_name Name of palette
194 * When colorpalette name is set, colors will be loaded from and saved to config
195 * using the set name. If no name is set then colors will be loaded from or
196 * saved to "default" config.
198 * @ingroup Colorselector
200 EAPI void elm_colorselector_palette_name_set(Evas_Object *obj, const char *palette_name);
203 * Get current palette's name
205 * @param obj The Colorselector object
206 * @return Name of palette
208 * Returns the currently set palette name using which colors will be
209 * saved/loaded in to config.
211 * @ingroup Colorselector
213 EAPI const char *elm_colorselector_palette_name_get(const Evas_Object *obj);