2 * @defgroup Clock Clock
4 * @image html img/widget/clock/preview-00.png
5 * @image latex img/widget/clock/preview-00.eps
7 * This is a @b digital clock widget. In its default theme, it has a
8 * vintage "flipping numbers clock" appearance, which will animate
9 * sheets of individual algarisms individually as time goes by.
11 * A newly created clock will fetch system's time (already
12 * considering local time adjustments) to start with, and will tick
14 * accondingly. It may or may not show seconds.
16 * Clocks have an @b edition mode. When in it, the sheets will
18 * accordingly. It may or may not show seconds.
20 * Clocks have an @b edition mode. When in it, the sheets will
21 >>>>>>> remotes/origin/upstream
22 * display extra arrow indications on the top and bottom and the
23 * user may click on them to raise or lower the time values. After
24 * it's told to exit edition mode, it will keep ticking with that
25 * new time set (it keeps the difference from local time).
27 * Also, when under edition mode, user clicks on the cited arrows
28 * which are @b held for some time will make the clock to flip the
30 * sheet, thus editing the time, continuosly and automatically for
32 * sheet, thus editing the time, continuously and automatically for
33 >>>>>>> remotes/origin/upstream
34 * the user. The interval between sheet flips will keep growing in
35 * time, so that it helps the user to reach a time which is distant
38 * The time display is, by default, in military mode (24h), but an
39 * am/pm indicator may be optionally shown, too, when it will
42 * Smart callbacks one can register to:
43 * - "changed" - the clock's user changed the time
45 * Supported elm_object common APIs.
46 * @li elm_object_signal_emit
47 * @li elm_object_signal_callback_add
49 * @li elm_object_signal_callbacka_del
51 * @li elm_object_signal_callback_del
52 >>>>>>> remotes/origin/upstream
54 * Here is an example on its usage:
55 * @li @ref clock_example
64 * Identifiers for which clock digits should be editable, when a
66 * clock widget is in edition mode. Values may be ORed together to
67 * make a mask, naturally.
69 * @see elm_clock_edit_set()
70 * @see elm_clock_digit_edit_set()
74 ELM_CLOCK_NONE = 0, /**< Default value. Means that all digits are editable, when in edition mode. */
75 ELM_CLOCK_HOUR_DECIMAL = 1 << 0, /**< Decimal algarism of hours value should be editable */
76 ELM_CLOCK_HOUR_UNIT = 1 << 1, /**< Unit algarism of hours value should be editable */
77 ELM_CLOCK_MIN_DECIMAL = 1 << 2, /**< Decimal algarism of minutes value should be editable */
78 ELM_CLOCK_MIN_UNIT = 1 << 3, /**< Unit algarism of minutes value should be editable */
79 ELM_CLOCK_SEC_DECIMAL = 1 << 4, /**< Decimal algarism of seconds value should be editable */
80 ELM_CLOCK_SEC_UNIT = 1 << 5, /**< Unit algarism of seconds value should be editable */
81 ELM_CLOCK_ALL = (1 << 6) - 1 /**< All digits should be editable */
84 * clock widget is in edition mode. Values may be OR-ed together to
85 * make a mask, naturally.
87 * @see elm_clock_edit_set()
88 * @see elm_clock_edit_mode_set()
92 ELM_CLOCK_EDIT_DEFAULT = 0, /**< Default value. Means that all digits are editable, when in edition mode. */
93 ELM_CLOCK_EDIT_HOUR_DECIMAL = 1 << 0, /**< Decimal algarism of hours value should be editable */
94 ELM_CLOCK_EDIT_HOUR_UNIT = 1 << 1, /**< Unit algarism of hours value should be editable */
95 ELM_CLOCK_EDIT_MIN_DECIMAL = 1 << 2, /**< Decimal algarism of minutes value should be editable */
96 ELM_CLOCK_EDIT_MIN_UNIT = 1 << 3, /**< Unit algarism of minutes value should be editable */
97 ELM_CLOCK_EDIT_SEC_DECIMAL = 1 << 4, /**< Decimal algarism of seconds value should be editable */
98 ELM_CLOCK_EDIT_SEC_UNIT = 1 << 5, /**< Unit algarism of seconds value should be editable */
99 ELM_CLOCK_EDIT_ALL = (1 << 6) - 1 /**< All digits should be editable */
100 } Elm_Clock_Edit_Mode;
101 >>>>>>> remotes/origin/upstream
104 * Add a new clock widget to the given parent Elementary
107 * @param parent The parent object
108 * @return a new clock widget handle or @c NULL, on errors
110 * This function inserts a new clock widget on the canvas.
114 EAPI Evas_Object *elm_clock_add(Evas_Object *parent);
117 * Set a clock widget's time, programmatically
119 * @param obj The clock widget object
120 * @param hrs The hours to set
121 * @param min The minutes to set
123 * @param sec The secondes to set
125 * @param sec The seconds to set
126 >>>>>>> remotes/origin/upstream
128 * This function updates the time that is showed by the clock
131 * Values @b must be set within the following ranges:
132 * - 0 - 23, for hours
133 * - 0 - 59, for minutes
134 * - 0 - 59, for seconds,
136 * even if the clock is not in "military" mode.
138 * @warning The behavior for values set out of those ranges is @b
143 EAPI void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec);
146 * Get a clock widget's time values
148 * @param obj The clock object
149 * @param[out] hrs Pointer to the variable to get the hours value
150 * @param[out] min Pointer to the variable to get the minutes value
151 * @param[out] sec Pointer to the variable to get the seconds value
153 * This function gets the time set for @p obj, returning
154 * it on the variables passed as the arguments to function
156 * @note Use @c NULL pointers on the time values you're not
157 * interested in: they'll be ignored by the function.
161 EAPI void elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec);
164 * Set whether a given clock widget is under <b>edition mode</b> or
165 * under (default) displaying-only mode.
167 * @param obj The clock object
168 * @param edit @c EINA_TRUE to put it in edition, @c EINA_FALSE to
169 * put it back to "displaying only" mode
171 * This function makes a clock's time to be editable or not <b>by
172 * user interaction</b>. When in edition mode, clocks @b stop
173 * ticking, until one brings them back to canonical mode. The
175 * elm_clock_digit_edit_set() function will influence which digits
177 * elm_clock_edit_mode_set() function will influence which digits
178 >>>>>>> remotes/origin/upstream
179 * of the clock will be editable. By default, all of them will be
182 * @note am/pm sheets, if being shown, will @b always be editable
183 * under edition mode.
185 * @see elm_clock_edit_get()
189 EAPI void elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit);
192 * Retrieve whether a given clock widget is under editing mode
193 * or under (default) displaying-only mode.
195 * @param obj The clock object
196 * @return @c EINA_TRUE, if it's in edition mode, @c EINA_FALSE otherwise
198 * This function retrieves whether the clock's time can be edited
199 * or not by user interaction.
201 * @see elm_clock_edit_set() for more details
205 EAPI Eina_Bool elm_clock_edit_get(const Evas_Object *obj);
208 * Set what digits of the given clock widget should be editable
209 * when in edition mode.
211 * @param obj The clock object
212 * @param digedit Bit mask indicating the digits to be editable
214 * (values in #Elm_Clock_Digedit).
216 * (values in #Elm_Clock_Edit_Mode).
217 >>>>>>> remotes/origin/upstream
219 * If the @p digedit param is #ELM_CLOCK_NONE, editing will be
220 * disabled on @p obj (same effect as elm_clock_edit_set(), with @c
224 * @see elm_clock_digit_edit_get()
228 EAPI void elm_clock_digit_edit_set(Evas_Object *obj, Elm_Clock_Digedit digedit);
230 * @see elm_clock_edit_mode_get()
234 EAPI void elm_clock_edit_mode_set(Evas_Object *obj, Elm_Clock_Edit_Mode digedit);
235 >>>>>>> remotes/origin/upstream
238 * Retrieve what digits of the given clock widget should be
239 * editable when in edition mode.
241 * @param obj The clock object
242 * @return Bit mask indicating the digits to be editable
244 * (values in #Elm_Clock_Digedit).
246 * @see elm_clock_digit_edit_set() for more details
250 EAPI Elm_Clock_Digedit elm_clock_digit_edit_get(const Evas_Object *obj);
252 * (values in #Elm_Clock_Edit_Mode).
254 * @see elm_clock_edit_mode_set() for more details
258 EAPI Elm_Clock_Edit_Mode elm_clock_edit_mode_get(const Evas_Object *obj);
259 >>>>>>> remotes/origin/upstream
262 * Set if the given clock widget must show hours in military or
265 * @param obj The clock object
266 * @param am_pm @c EINA_TRUE to put it in am/pm mode, @c EINA_FALSE
269 * This function sets if the clock must show hours in military or
270 * am/pm mode. In some countries like Brazil the military mode
271 * (00-24h-format) is used, in opposition to the USA, where the
272 * am/pm mode is more commonly used.
274 * @see elm_clock_show_am_pm_get()
278 EAPI void elm_clock_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm);
281 * Get if the given clock widget shows hours in military or am/pm
284 * @param obj The clock object
285 * @return @c EINA_TRUE, if in am/pm mode, @c EINA_FALSE if in
288 * This function gets if the clock shows hours in military or am/pm
291 * @see elm_clock_show_am_pm_set() for more details
295 EAPI Eina_Bool elm_clock_show_am_pm_get(const Evas_Object *obj);
298 * Set if the given clock widget must show time with seconds or not
300 * @param obj The clock object
301 * @param seconds @c EINA_TRUE to show seconds, @c EINA_FALSE otherwise
303 * This function sets if the given clock must show or not elapsed
304 * seconds. By default, they are @b not shown.
306 * @see elm_clock_show_seconds_get()
310 EAPI void elm_clock_show_seconds_set(Evas_Object *obj, Eina_Bool seconds);
313 * Get whether the given clock widget is showing time with seconds
316 * @param obj The clock object
317 * @return @c EINA_TRUE if it's showing seconds, @c EINA_FALSE otherwise
319 * This function gets whether @p obj is showing or not the elapsed
322 * @see elm_clock_show_seconds_set()
326 EAPI Eina_Bool elm_clock_show_seconds_get(const Evas_Object *obj);
330 * Set the interval on time updates for an user mouse button hold
331 * on clock widgets' time edition.
333 * @param obj The clock object
334 * @param interval The (first) interval value in seconds
336 * Set the first interval on time updates for a user mouse button hold
337 * on clock widgets' time edition.
339 * @param obj The clock object
340 * @param interval The first interval value in seconds
341 >>>>>>> remotes/origin/upstream
343 * This interval value is @b decreased while the user holds the
344 * mouse pointer either incrementing or decrementing a given the
345 * clock digit's value.
347 * This helps the user to get to a given time distant from the
348 * current one easier/faster, as it will start to flip quicker and
349 * quicker on mouse button holds.
351 * The calculation for the next flip interval value, starting from
352 * the one set with this call, is the previous interval divided by
353 * 1.05, so it decreases a little bit.
355 * The default starting interval value for automatic flips is
359 * @see elm_clock_interval_get()
363 EAPI void elm_clock_interval_set(Evas_Object *obj, double interval);
366 * Get the interval on time updates for an user mouse button hold
367 * on clock widgets' time edition.
369 * @param obj The clock object
370 * @return The (first) interval value, in seconds, set on it
372 * @see elm_clock_interval_set() for more details
376 EAPI double elm_clock_interval_get(const Evas_Object *obj);
378 * @see elm_clock_first_interval_get()
382 EAPI void elm_clock_first_interval_set(Evas_Object *obj, double interval);
385 * Get the first interval on time updates for a user mouse button hold
386 * on clock widgets' time edition.
388 * @param obj The clock object
389 * @return The first interval value, in seconds, set on it
391 * @see elm_clock_first_interval_set() for more details
395 EAPI double elm_clock_first_interval_get(const Evas_Object *obj);
396 >>>>>>> remotes/origin/upstream