1 #ifndef _ELM_SPINNER_EO_H_ 2 #define _ELM_SPINNER_EO_H_ 3 4 #ifndef _ELM_SPINNER_EO_CLASS_TYPE 5 #define _ELM_SPINNER_EO_CLASS_TYPE 6 7 typedef Eo Elm_Spinner; 8 9 #endif 10 11 #ifndef _ELM_SPINNER_EO_TYPES 12 #define _ELM_SPINNER_EO_TYPES 13 14 15 #endif 16 /** Elementary spinner class 17 * 18 * @ingroup Elm_Spinner 19 */ 20 #define ELM_SPINNER_CLASS elm_spinner_class_get() 21 22 EWAPI const Efl_Class *elm_spinner_class_get(void) EINA_CONST; 23 24 /** 25 * @brief Control whether the spinner should wrap when it reaches its minimum 26 * or maximum value. 27 * 28 * Disabled by default. If disabled, when the user tries to increment the 29 * value, but displayed value plus step value is bigger than maximum value, the 30 * new value will be the maximum value. The same happens when the user tries to 31 * decrement it, but the value less step is less than minimum value. In this 32 * case, the new displayed value will be the minimum value. 33 * 34 * When wrap is enabled, when the user tries to increment the value, but 35 * displayed value plus step value is bigger than maximum value, the new value 36 * will be the minimum value. When the the user tries to decrement it, but the 37 * value less step is less than minimum value, the new displayed value will be 38 * the maximum value. 39 * 40 * E.g.: @c min = 10 @c max = 50 @c step = 20 @c displayed = 20 41 * 42 * When the user decrement value (using left or bottom arrow), it will displays 43 * $50. 44 * 45 * @param[in] obj The object. 46 * @param[in] wrap @c true to enable wrap or @c false to disable it. 47 * 48 * @ingroup Elm_Spinner 49 */ 50 EOAPI void elm_obj_spinner_wrap_set(Eo *obj, Eina_Bool wrap); 51 52 /** 53 * @brief Control whether the spinner should wrap when it reaches its minimum 54 * or maximum value. 55 * 56 * Disabled by default. If disabled, when the user tries to increment the 57 * value, but displayed value plus step value is bigger than maximum value, the 58 * new value will be the maximum value. The same happens when the user tries to 59 * decrement it, but the value less step is less than minimum value. In this 60 * case, the new displayed value will be the minimum value. 61 * 62 * When wrap is enabled, when the user tries to increment the value, but 63 * displayed value plus step value is bigger than maximum value, the new value 64 * will be the minimum value. When the the user tries to decrement it, but the 65 * value less step is less than minimum value, the new displayed value will be 66 * the maximum value. 67 * 68 * E.g.: @c min = 10 @c max = 50 @c step = 20 @c displayed = 20 69 * 70 * When the user decrement value (using left or bottom arrow), it will displays 71 * $50. 72 * 73 * @param[in] obj The object. 74 * 75 * @return @c true to enable wrap or @c false to disable it. 76 * 77 * @ingroup Elm_Spinner 78 */ 79 EOAPI Eina_Bool elm_obj_spinner_wrap_get(const Eo *obj); 80 81 /** 82 * @brief Control the interval on time updates for a user mouse button hold on 83 * spinner widgets' arrows. 84 * 85 * This interval value is decreased while the user holds the mouse pointer 86 * either incrementing or decrementing spinner's value. 87 * 88 * This helps the user to get to a given value distant from the current one 89 * easier/faster, as it will start to change quicker and quicker on mouse 90 * button holds. 91 * 92 * The calculation for the next change interval value, starting from the one 93 * set with this call, is the previous interval divided by $1.05, so it 94 * decreases a little bit. 95 * 96 * The default starting interval value for automatic changes is $0.85 seconds. 97 * 98 * @param[in] obj The object. 99 * @param[in] interval The (first) interval value in seconds. 100 * 101 * @ingroup Elm_Spinner 102 */ 103 EOAPI void elm_obj_spinner_interval_set(Eo *obj, double interval); 104 105 /** 106 * @brief Control the interval on time updates for a user mouse button hold on 107 * spinner widgets' arrows. 108 * 109 * This interval value is decreased while the user holds the mouse pointer 110 * either incrementing or decrementing spinner's value. 111 * 112 * This helps the user to get to a given value distant from the current one 113 * easier/faster, as it will start to change quicker and quicker on mouse 114 * button holds. 115 * 116 * The calculation for the next change interval value, starting from the one 117 * set with this call, is the previous interval divided by $1.05, so it 118 * decreases a little bit. 119 * 120 * The default starting interval value for automatic changes is $0.85 seconds. 121 * 122 * @param[in] obj The object. 123 * 124 * @return The (first) interval value in seconds. 125 * 126 * @ingroup Elm_Spinner 127 */ 128 EOAPI double elm_obj_spinner_interval_get(const Eo *obj); 129 130 /** 131 * @brief Control the round value for rounding 132 * 133 * Sets the rounding value used for value rounding in the spinner. 134 * 135 * @param[in] obj The object. 136 * @param[in] rnd The rounding value 137 * 138 * @ingroup Elm_Spinner 139 */ 140 EOAPI void elm_obj_spinner_round_set(Eo *obj, int rnd); 141 142 /** 143 * @brief Control the round value for rounding 144 * 145 * Sets the rounding value used for value rounding in the spinner. 146 * 147 * @param[in] obj The object. 148 * 149 * @return The rounding value 150 * 151 * @ingroup Elm_Spinner 152 */ 153 EOAPI int elm_obj_spinner_round_get(const Eo *obj); 154 155 /** 156 * @brief Control whether the spinner can be directly edited by the user or 157 * not. 158 * 159 * Spinner objects can have edition disabled, in which state they will be 160 * changed only by arrows. Useful for contexts where you don't want your users 161 * to interact with it writing the value. Specially when using special values, 162 * the user can see real value instead of special label on edition. 163 * 164 * It's enabled by default. 165 * 166 * @param[in] obj The object. 167 * @param[in] editable @c true to allow users to edit it or @c false to don't 168 * allow users to edit it directly. 169 * 170 * @ingroup Elm_Spinner 171 */ 172 EOAPI void elm_obj_spinner_editable_set(Eo *obj, Eina_Bool editable); 173 174 /** 175 * @brief Control whether the spinner can be directly edited by the user or 176 * not. 177 * 178 * Spinner objects can have edition disabled, in which state they will be 179 * changed only by arrows. Useful for contexts where you don't want your users 180 * to interact with it writing the value. Specially when using special values, 181 * the user can see real value instead of special label on edition. 182 * 183 * It's enabled by default. 184 * 185 * @param[in] obj The object. 186 * 187 * @return @c true to allow users to edit it or @c false to don't allow users 188 * to edit it directly. 189 * 190 * @ingroup Elm_Spinner 191 */ 192 EOAPI Eina_Bool elm_obj_spinner_editable_get(const Eo *obj); 193 194 /** 195 * @brief Control the base for rounding 196 * 197 * Rounding works as follows: 198 * 199 * rounded_val = base + (double)(((value - base) / round) * round) 200 * 201 * Where rounded_val, value and base are doubles, and round is an integer. 202 * 203 * This means that things will be rounded to increments (or decrements) of 204 * "round" starting from value @c base. The default base for rounding is 0. 205 * 206 * Example: round = 3, base = 2 Values: ..., -2, 0, 2, 5, 8, 11, 14, ... 207 * 208 * Example: round = 2, base = 5.5 Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, 209 * 11.5, ... 210 * 211 * @param[in] obj The object. 212 * @param[in] base The base value 213 * 214 * @ingroup Elm_Spinner 215 */ 216 EOAPI void elm_obj_spinner_base_set(Eo *obj, double base); 217 218 /** 219 * @brief Control the base for rounding 220 * 221 * Rounding works as follows: 222 * 223 * rounded_val = base + (double)(((value - base) / round) * round) 224 * 225 * Where rounded_val, value and base are doubles, and round is an integer. 226 * 227 * This means that things will be rounded to increments (or decrements) of 228 * "round" starting from value @c base. The default base for rounding is 0. 229 * 230 * Example: round = 3, base = 2 Values: ..., -2, 0, 2, 5, 8, 11, 14, ... 231 * 232 * Example: round = 2, base = 5.5 Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, 233 * 11.5, ... 234 * 235 * @param[in] obj The object. 236 * 237 * @return The base value 238 * 239 * @ingroup Elm_Spinner 240 */ 241 EOAPI double elm_obj_spinner_base_get(const Eo *obj); 242 243 /** 244 * @brief Control the format string of the displayed label. 245 * 246 * If @c NULL, this sets the format to "%.0f". If not it sets the format string 247 * for the label text. The label text is provided a floating point value, so 248 * the label text can display up to 1 floating point value. Note that this is 249 * optional. 250 * 251 * Use a format string such as "%1.2f meters" for example, and it will display 252 * values like: "3.14 meters" for a value equal to 3.14159. 253 * 254 * Default is "%0.f". 255 * 256 * @param[in] obj The object. 257 * @param[in] fmt The format string for the label display. 258 * 259 * @ingroup Elm_Spinner 260 */ 261 EOAPI void elm_obj_spinner_label_format_set(Eo *obj, const char *fmt); 262 263 /** 264 * @brief Control the format string of the displayed label. 265 * 266 * If @c NULL, this sets the format to "%.0f". If not it sets the format string 267 * for the label text. The label text is provided a floating point value, so 268 * the label text can display up to 1 floating point value. Note that this is 269 * optional. 270 * 271 * Use a format string such as "%1.2f meters" for example, and it will display 272 * values like: "3.14 meters" for a value equal to 3.14159. 273 * 274 * Default is "%0.f". 275 * 276 * @param[in] obj The object. 277 * 278 * @return The format string for the label display. 279 * 280 * @ingroup Elm_Spinner 281 */ 282 EOAPI const char *elm_obj_spinner_label_format_get(const Eo *obj); 283 284 /** 285 * @brief Control special string to display in the place of the numerical 286 * value. 287 * 288 * It's useful for cases when a user should select an item that is better 289 * indicated by a label than a value. For example, weekdays or months. 290 * 291 * @note If another label was previously set to @c value, it will be replaced 292 * by the new label. 293 * 294 * @param[in] obj The object. 295 * @param[in] value The value to be replaced. 296 * @param[in] label The label to be used. 297 * 298 * @ingroup Elm_Spinner 299 */ 300 EOAPI void elm_obj_spinner_special_value_add(Eo *obj, double value, const char *label); 301 302 EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_CHANGED; 303 304 /** Called when spinner changed 305 * 306 * @ingroup Elm_Spinner 307 */ 308 #define ELM_SPINNER_EVENT_CHANGED (&(_ELM_SPINNER_EVENT_CHANGED)) 309 310 EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_DELAY_CHANGED; 311 312 /** Called when spinner delay changed 313 * 314 * @ingroup Elm_Spinner 315 */ 316 #define ELM_SPINNER_EVENT_DELAY_CHANGED (&(_ELM_SPINNER_EVENT_DELAY_CHANGED)) 317 318 EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_SPINNER_DRAG_START; 319 320 /** Called when spinner drag started 321 * 322 * @ingroup Elm_Spinner 323 */ 324 #define ELM_SPINNER_EVENT_SPINNER_DRAG_START (&(_ELM_SPINNER_EVENT_SPINNER_DRAG_START)) 325 326 EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_SPINNER_DRAG_STOP; 327 328 /** Called when spinner drag stopped 329 * 330 * @ingroup Elm_Spinner 331 */ 332 #define ELM_SPINNER_EVENT_SPINNER_DRAG_STOP (&(_ELM_SPINNER_EVENT_SPINNER_DRAG_STOP)) 333 334 EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_MIN_REACHED; 335 336 /** Called when spinner value reached min 337 * 338 * @ingroup Elm_Spinner 339 */ 340 #define ELM_SPINNER_EVENT_MIN_REACHED (&(_ELM_SPINNER_EVENT_MIN_REACHED)) 341 342 EWAPI extern const Efl_Event_Description _ELM_SPINNER_EVENT_MAX_REACHED; 343 344 /** Called when spinner value reached max 345 * 346 * @ingroup Elm_Spinner 347 */ 348 #define ELM_SPINNER_EVENT_MAX_REACHED (&(_ELM_SPINNER_EVENT_MAX_REACHED)) 349 350 #endif 351