19707ec8d1be7cc4d3d25ec23eece656e62255b6
[framework/uifw/elementary.git] / src / lib / elm_colorselector.h
1 /**
2  * @defgroup Colorselector Colorselector
3  *
4  * @{
5  *
6  * @image html img/widget/colorselector/preview-00.png
7  * @image latex img/widget/colorselector/preview-00.eps
8  *
9  * @brief Widget for user to select a color.
10  *
11  * Signals that you can add callbacks for are:
12  * "changed" - When the color value changes(event_info is NULL).
13  *
14  * See @ref tutorial_colorselector.
15  */
16
17 typedef enum
18 {
19    ELM_COLORSELECTOR_PALETTE = 0,
20    ELM_COLORSELECTOR_COMPONENTS,
21    ELM_COLORSELECTOR_BOTH
22 } Elm_Colorselector_Mode;
23
24 /**
25  * @brief Add a new colorselector to the parent
26  *
27  * @param parent The parent object
28  * @return The new object or NULL if it cannot be created
29  *
30  * @ingroup Colorselector
31  */
32 EAPI Evas_Object *elm_colorselector_add(Evas_Object *parent);
33
34 /**
35  * Set a color for the colorselector
36  *
37  * @param obj   Colorselector object
38  * @param r     r-value of color
39  * @param g     g-value of color
40  * @param b     b-value of color
41  * @param a     a-value of color
42  *
43  * @ingroup Colorselector
44  */
45 EAPI void elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a);
46
47 /**
48  * Get a color from the colorselector
49  *
50  * @param obj   Colorselector object
51  * @param r     integer pointer for r-value of color
52  * @param g     integer pointer for g-value of color
53  * @param b     integer pointer for b-value of color
54  * @param a     integer pointer for a-value of color
55  *
56  * @ingroup Colorselector
57  */
58 EAPI void elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
59
60 /**
61  * Set a Colorselector mode.
62  * Colorselector 
63  *
64  * @param obj Colorselector object
65  * @param mode 
66  * @param g G color value to be returned
67  * @param b B color value to be returned
68  * @param a A color value to be returned
69  * 
70  * @ingroup Colorselector
71  */
72 EAPI void elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode);
73
74 /**
75  * Get a Colorselector mode.
76  *
77  * @param item The color palette item.
78  * @param r R color value to be returned
79  * @param g G color value to be returned
80  * @param b B color value to be returned
81  * @param a A color value to be returned
82  * 
83  * @ingroup Colorselector
84  */
85 EAPI Elm_Colorselector_Mode elm_colorselector_mode_get(const Evas_Object *obj);
86
87 /**
88  * Get a palette item's color.
89  *
90  * @param item The color palette item.
91  * @param r integer pointer for r-value of color
92  * @param g integer pointer for g-value of color
93  * @param b integer pointer for b-value of color
94  * @param a integer pointer for a-value of color
95  * 
96  * @ingroup Colorselector
97  */
98 EAPI void elm_colorselector_palette_item_color_get(const Elm_Object_Item *it, int *r, int *g, int *b, int *a);
99
100 /**
101  * Set the palette item's color.
102  *
103  * @param item The color palette item.
104  * @param r r-value of color
105  * @param g g-value of color
106  * @param b b-value of color
107  * @param a a-value of color
108  *
109  * @ingroup Colorselector
110  */
111 EAPI void elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r, int g, int b, int a);
112
113 /**
114  * Add a new color item to palette.
115  *
116  * @param obj The Colorselector object
117  * @param r r-value of color
118  * @param g g-value of color
119  * @param b b-value of color
120  * @param a a-value of color
121  * @return A new color palette Item.
122  *
123  * @ingroup Colorselector
124  */
125 EAPI Elm_Object_Item *elm_colorselector_palette_color_add(Evas_Object *obj, int r, int g, int b, int a);
126
127 /**
128  * Clear the palette items.
129  *
130  * @param obj The Colorselector object
131  *
132  * @note This API will be available when ELM_COLORSELECTOR_PALETTE or
133  * ELM_COLORSELECTOR_BOTH mode is set.
134  *
135  * @ingroup Colorselector
136  */
137 EAPI void elm_colorselector_palette_clear(Evas_Object *obj);
138
139 /**
140  * Set current palette's name
141  *
142  * @param obj The Colorselector object
143  * @param palette_name Name of palette
144  *
145  * When colorpalette name is set, colors will be loaded from and saved to config
146  * using the set name. If no name is set then colors will be loaded from or
147  * saved to "default" config.
148  *
149  * @ingroup Colorselector
150  */
151 EAPI void                    elm_colorselector_palette_name_set(Evas_Object *obj, const char *palette_name);
152
153 /**
154  * Get current palette's name
155  *
156  * @param obj The Colorselector object
157  * @return Name of palette
158  *
159  * Returns the currently set palette name using which colors will be 
160  * saved/loaded in to config.
161  *
162  * @ingroup Colorselector
163  */
164 EAPI const char             *elm_colorselector_palette_name_get(const Evas_Object *obj);
165
166 /**
167  * @}
168  */