21e0d506aef39d265512a56d341e557741143a28
[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 <<<<<<< HEAD
18 =======
19 typedef enum
20 {
21    ELM_COLORSELECTOR_PALETTE = 0,
22    ELM_COLORSELECTOR_COMPONENTS,
23    ELM_COLORSELECTOR_BOTH
24 } Elm_Colorselector_Mode;
25
26 >>>>>>> remotes/origin/upstream
27 /**
28  * @brief Add a new colorselector to the parent
29  *
30  * @param parent The parent object
31  * @return The new object or NULL if it cannot be created
32  *
33  * @ingroup Colorselector
34  */
35 EAPI Evas_Object *elm_colorselector_add(Evas_Object *parent);
36
37 /**
38  * Set a color for the colorselector
39  *
40  * @param obj   Colorselector object
41  * @param r     r-value of color
42  * @param g     g-value of color
43  * @param b     b-value of color
44  * @param a     a-value of color
45  *
46  * @ingroup Colorselector
47  */
48 EAPI void elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a);
49
50 /**
51  * Get a color from the colorselector
52  *
53  * @param obj   Colorselector object
54  * @param r     integer pointer for r-value of color
55  * @param g     integer pointer for g-value of color
56  * @param b     integer pointer for b-value of color
57  * @param a     integer pointer for a-value of color
58  *
59  * @ingroup Colorselector
60  */
61 EAPI void elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
62
63 /**
64 <<<<<<< HEAD
65 =======
66  * Set a Colorselector mode.
67  * Colorselector 
68  *
69  * @param obj Colorselector object
70  * @param mode 
71  * @param g G color value to be returned
72  * @param b B color value to be returned
73  * @param a A color value to be returned
74  * 
75  * @ingroup Colorselector
76  */
77 EAPI void elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode);
78
79 /**
80  * Get a Colorselector mode.
81  *
82  * @param item The color palette item.
83  * @param r R color value to be returned
84  * @param g G color value to be returned
85  * @param b B color value to be returned
86  * @param a A color value to be returned
87  * 
88  * @ingroup Colorselector
89  */
90 EAPI Elm_Colorselector_Mode elm_colorselector_mode_get(const Evas_Object *obj);
91
92 /**
93  * Get a palette item's color.
94  *
95  * @param item The color palette item.
96  * @param r integer pointer for r-value of color
97  * @param g integer pointer for g-value of color
98  * @param b integer pointer for b-value of color
99  * @param a integer pointer for a-value of color
100  * 
101  * @ingroup Colorselector
102  */
103 EAPI void elm_colorselector_palette_item_color_get(const Elm_Object_Item *it, int *r, int *g, int *b, int *a);
104
105 /**
106  * Set the palette item's color.
107  *
108  * @param item The color palette item.
109  * @param r r-value of color
110  * @param g g-value of color
111  * @param b b-value of color
112  * @param a a-value of color
113  *
114  * @ingroup Colorselector
115  */
116 EAPI void elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r, int g, int b, int a);
117
118 /**
119  * Add a new color item to palette.
120  *
121  * @param obj The Colorselector object
122  * @param r r-value of color
123  * @param g g-value of color
124  * @param b b-value of color
125  * @param a a-value of color
126  * @return A new color palette Item.
127  *
128  * @ingroup Colorselector
129  */
130 EAPI Elm_Object_Item *elm_colorselector_palette_color_add(Evas_Object *obj, int r, int g, int b, int a);
131
132 /**
133  * Clear the palette items.
134  *
135  * @param obj The Colorselector object
136  *
137  * @note This API will be available when ELM_COLORSELECTOR_PALETTE or
138  * ELM_COLORSELECTOR_BOTH mode is set.
139  *
140  * @ingroup Colorselector
141  */
142 EAPI void elm_colorselector_palette_clear(Evas_Object *obj);
143
144 /**
145  * Set current palette's name
146  *
147  * @param obj The Colorselector object
148  * @param palette_name Name of palette
149  *
150  * When colorpalette name is set, colors will be loaded from and saved to config
151  * using the set name. If no name is set then colors will be loaded from or
152  * saved to "default" config.
153  *
154  * @ingroup Colorselector
155  */
156 EAPI void                    elm_colorselector_palette_name_set(Evas_Object *obj, const char *palette_name);
157
158 /**
159  * Get current palette's name
160  *
161  * @param obj The Colorselector object
162  * @return Name of palette
163  *
164  * Returns the currently set palette name using which colors will be 
165  * saved/loaded in to config.
166  *
167  * @ingroup Colorselector
168  */
169 EAPI const char             *elm_colorselector_palette_name_get(const Evas_Object *obj);
170
171 /**
172 >>>>>>> remotes/origin/upstream
173  * @}
174  */