1 #ifndef _ELM_CLOCK_EO_H_ 2 #define _ELM_CLOCK_EO_H_ 3 4 #ifndef _ELM_CLOCK_EO_CLASS_TYPE 5 #define _ELM_CLOCK_EO_CLASS_TYPE 6 7 typedef Eo Elm_Clock; 8 9 #endif 10 11 #ifndef _ELM_CLOCK_EO_TYPES 12 #define _ELM_CLOCK_EO_TYPES 13 14 /** 15 * @brief Identifiers for which clock digits should be editable, when a clock 16 * widget is in editing mode. Values may be OR-ed together to make a mask, 17 * naturally. 18 * 19 * See also @ref elm_obj_clock_edit_set, @ref elm_obj_clock_edit_mode_set. 20 * 21 * @ingroup Elm_Clock 22 */ 23 typedef enum 24 { 25 ELM_CLOCK_EDIT_DEFAULT = 0, /**< Default value. Means that all digits are 26 * editable, when in editing mode. */ 27 ELM_CLOCK_EDIT_HOUR_DECIMAL = 1 /* 1 >> 0 */, /**< Decimal digit of hours 28 * value should be editable. */ 29 ELM_CLOCK_EDIT_HOUR_UNIT = 2 /* 1 >> 1 */, /**< Unit digit of hours value 30 * should be editable. */ 31 ELM_CLOCK_EDIT_MIN_DECIMAL = 4 /* 1 >> 2 */, /**< Decimal digit of minutes 32 * value should be editable. */ 33 ELM_CLOCK_EDIT_MIN_UNIT = 8 /* 1 >> 3 */, /**< Unit digit of minutes value 34 * should be editable. */ 35 ELM_CLOCK_EDIT_SEC_DECIMAL = 16 /* 1 >> 4 */, /**< Decimal digit of seconds 36 * value should be editable. */ 37 ELM_CLOCK_EDIT_SEC_UNIT = 32 /* 1 >> 5 */, /**< Unit digit of seconds value 38 * should be editable. */ 39 ELM_CLOCK_EDIT_ALL = 63 /* (1 >> 6) * 1 */ /**< All digits should be editable. 40 */ 41 } Elm_Clock_Edit_Mode; 42 43 44 #endif 45 /** 46 * @brief Digital clock widget 47 * 48 * This is a digital clock widget. In its default theme, it has a vintage 49 * "flipping numbers clock" appearance, which will animate sheets of individual 50 * algorisms individually as time goes by. 51 * 52 * A newly created clock will fetch system's time (already considering local 53 * time adjustments) to start with, and will tick accordingly. 54 * 55 * @ingroup Elm_Clock 56 */ 57 #define ELM_CLOCK_CLASS elm_clock_class_get() 58 59 EWAPI const Efl_Class *elm_clock_class_get(void) EINA_CONST; 60 61 /** 62 * @brief If the given clock widget must show hours in military or am/pm mode 63 * 64 * Set if the clock must show hours in military or am/pm mode. In some 65 * countries like Brazil the military mode (00-24h-format) is used, in 66 * opposition to the USA, where the am/pm mode is more commonly used. 67 * 68 * @param[in] obj The object. 69 * @param[in] am_pm @c true to put it in am/pm mode, @c false to military mode 70 * 71 * @ingroup Elm_Clock 72 */ 73 EOAPI void elm_obj_clock_show_am_pm_set(Eo *obj, Eina_Bool am_pm); 74 75 /** 76 * @brief If the given clock widget must show hours in military or am/pm mode 77 * 78 * Set if the clock must show hours in military or am/pm mode. In some 79 * countries like Brazil the military mode (00-24h-format) is used, in 80 * opposition to the USA, where the am/pm mode is more commonly used. 81 * 82 * @param[in] obj The object. 83 * 84 * @return @c true to put it in am/pm mode, @c false to military mode 85 * 86 * @ingroup Elm_Clock 87 */ 88 EOAPI Eina_Bool elm_obj_clock_show_am_pm_get(const Eo *obj); 89 90 /** 91 * @brief The first interval on time updates for a user mouse button hold on 92 * clock widgets' time editing. 93 * 94 * This interval value is decreased while the user holds the mouse pointer 95 * either incrementing or decrementing a given the clock digit's value. 96 * 97 * This helps the user to get to a given time distant from the current one 98 * easier/faster, as it will start to flip quicker and quicker on mouse button 99 * holds. 100 * 101 * The calculation for the next flip interval value, starting from the one set 102 * with this call, is the previous interval divided by 1.05, so it decreases a 103 * little bit. 104 * 105 * The default starting interval value for automatic flips is 0.85 seconds. 106 * 107 * @param[in] obj The object. 108 * @param[in] interval The first interval value in seconds 109 * 110 * @ingroup Elm_Clock 111 */ 112 EOAPI void elm_obj_clock_first_interval_set(Eo *obj, double interval); 113 114 /** 115 * @brief The first interval on time updates for a user mouse button hold on 116 * clock widgets' time editing. 117 * 118 * This interval value is decreased while the user holds the mouse pointer 119 * either incrementing or decrementing a given the clock digit's value. 120 * 121 * This helps the user to get to a given time distant from the current one 122 * easier/faster, as it will start to flip quicker and quicker on mouse button 123 * holds. 124 * 125 * The calculation for the next flip interval value, starting from the one set 126 * with this call, is the previous interval divided by 1.05, so it decreases a 127 * little bit. 128 * 129 * The default starting interval value for automatic flips is 0.85 seconds. 130 * 131 * @param[in] obj The object. 132 * 133 * @return The first interval value in seconds 134 * 135 * @ingroup Elm_Clock 136 */ 137 EOAPI double elm_obj_clock_first_interval_get(const Eo *obj); 138 139 /** 140 * @brief If the given clock widget must show time with seconds or not 141 * 142 * This function sets if the given clock must show or not elapsed seconds. By 143 * default, they are not shown. 144 * 145 * @param[in] obj The object. 146 * @param[in] seconds @c true to show seconds, @c false otherwise. 147 * 148 * @ingroup Elm_Clock 149 */ 150 EOAPI void elm_obj_clock_show_seconds_set(Eo *obj, Eina_Bool seconds); 151 152 /** 153 * @brief If the given clock widget must show time with seconds or not 154 * 155 * This function sets if the given clock must show or not elapsed seconds. By 156 * default, they are not shown. 157 * 158 * @param[in] obj The object. 159 * 160 * @return @c true to show seconds, @c false otherwise. 161 * 162 * @ingroup Elm_Clock 163 */ 164 EOAPI Eina_Bool elm_obj_clock_show_seconds_get(const Eo *obj); 165 166 /** 167 * @brief Whether a given clock widget is under editing mode or under (default) 168 * displaying-only mode. 169 * 170 * This function makes a clock's time to be editable or not by user 171 * interaction. When in editing mode, clocks stop ticking, until one brings 172 * them back to display mode. The @ref elm_obj_clock_edit_mode_set function 173 * will influence which digits of the clock will be editable. 174 * 175 * @note am/pm sheets, if being shown, will always be editable under editing 176 * mode. 177 * 178 * @param[in] obj The object. 179 * @param[in] edit @c true to put it in editing, @c false to put it back to 180 * "displaying only" mode 181 * 182 * @ingroup Elm_Clock 183 */ 184 EOAPI void elm_obj_clock_edit_set(Eo *obj, Eina_Bool edit); 185 186 /** 187 * @brief Whether a given clock widget is under editing mode or under (default) 188 * displaying-only mode. 189 * 190 * This function makes a clock's time to be editable or not by user 191 * interaction. When in editing mode, clocks stop ticking, until one brings 192 * them back to display mode. The @ref elm_obj_clock_edit_mode_set function 193 * will influence which digits of the clock will be editable. 194 * 195 * @note am/pm sheets, if being shown, will always be editable under editing 196 * mode. 197 * 198 * @param[in] obj The object. 199 * 200 * @return @c true to put it in editing, @c false to put it back to "displaying 201 * only" mode 202 * 203 * @ingroup Elm_Clock 204 */ 205 EOAPI Eina_Bool elm_obj_clock_edit_get(const Eo *obj); 206 207 /** 208 * @brief Whether the given clock widget should be paused or not. 209 * 210 * This function pauses or starts the clock widget. 211 * 212 * @param[in] obj The object. 213 * @param[in] paused @c true to pause clock, @c false otherwise 214 * 215 * @since 1.9 216 * 217 * @ingroup Elm_Clock 218 */ 219 EOAPI void elm_obj_clock_pause_set(Eo *obj, Eina_Bool paused); 220 221 /** 222 * @brief Whether the given clock widget should be paused or not. 223 * 224 * This function pauses or starts the clock widget. 225 * 226 * @param[in] obj The object. 227 * 228 * @return @c true to pause clock, @c false otherwise 229 * 230 * @since 1.9 231 * 232 * @ingroup Elm_Clock 233 */ 234 EOAPI Eina_Bool elm_obj_clock_pause_get(const Eo *obj); 235 236 /** 237 * @brief Clock widget's time 238 * 239 * Values must be set within 0-23 for hours and 0-59 for minutes and seconds, 240 * even if the clock is not in "military" mode. 241 * 242 * @warning The behavior for values set out of those ranges is undefined. 243 * 244 * @param[in] obj The object. 245 * @param[in] hrs The hours to set 246 * @param[in] min The minutes to set 247 * @param[in] sec The seconds to set 248 * 249 * @ingroup Elm_Clock 250 */ 251 EOAPI void elm_obj_clock_time_set(Eo *obj, int hrs, int min, int sec); 252 253 /** 254 * @brief Clock widget's time 255 * 256 * Values must be set within 0-23 for hours and 0-59 for minutes and seconds, 257 * even if the clock is not in "military" mode. 258 * 259 * @note Use @c null pointers on the time values you're not interested in: 260 * they'll be ignored by the function. 261 * 262 * @param[in] obj The object. 263 * @param[out] hrs The hours to set 264 * @param[out] min The minutes to set 265 * @param[out] sec The seconds to set 266 * 267 * @ingroup Elm_Clock 268 */ 269 EOAPI void elm_obj_clock_time_get(const Eo *obj, int *hrs, int *min, int *sec); 270 271 /** 272 * @brief Digits of the given clock widget should be editable when in editing 273 * mode. 274 * 275 * @param[in] obj The object. 276 * @param[in] digedit Bit mask indicating the digits to be editable (values in 277 * @ref Elm_Clock_Edit_Mode). 278 * 279 * @ingroup Elm_Clock 280 */ 281 EOAPI void elm_obj_clock_edit_mode_set(Eo *obj, Elm_Clock_Edit_Mode digedit); 282 283 /** 284 * @brief Digits of the given clock widget should be editable when in editing 285 * mode. 286 * 287 * @param[in] obj The object. 288 * 289 * @return Bit mask indicating the digits to be editable (values in 290 * @ref Elm_Clock_Edit_Mode). 291 * 292 * @ingroup Elm_Clock 293 */ 294 EOAPI Elm_Clock_Edit_Mode elm_obj_clock_edit_mode_get(const Eo *obj); 295 296 EWAPI extern const Efl_Event_Description _ELM_CLOCK_EVENT_CHANGED; 297 298 /** The clock's user changed the time 299 * 300 * @ingroup Elm_Clock 301 */ 302 #define ELM_CLOCK_EVENT_CHANGED (&(_ELM_CLOCK_EVENT_CHANGED)) 303 304 #endif 305