- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Functions
Clock

## Macros
#define | elm_obj_clock_time_set(hrs, min, sec) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_SET), EO_TYPECHECK(int, hrs), EO_TYPECHECK(int, min), EO_TYPECHECK(int, sec)
#define | elm_obj_clock_time_get(hrs, min, sec) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_GET), EO_TYPECHECK(int *, hrs), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, sec)
#define | elm_obj_clock_edit_set(edit) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_SET), EO_TYPECHECK(Eina_Bool, edit)
#define | elm_obj_clock_edit_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_clock_edit_mode_set(digedit) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_SET), EO_TYPECHECK(Elm_Clock_Edit_Mode, digedit)
#define | elm_obj_clock_edit_mode_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_GET), EO_TYPECHECK(Elm_Clock_Edit_Mode *, ret)
#define | elm_obj_clock_show_am_pm_set(am_pm) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_SET), EO_TYPECHECK(Eina_Bool, am_pm)
#define | elm_obj_clock_show_am_pm_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_clock_show_seconds_set(seconds) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_SET), EO_TYPECHECK(Eina_Bool, seconds)
#define | elm_obj_clock_show_seconds_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_clock_first_interval_set(interval) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_SET), EO_TYPECHECK(double, interval)
#define | elm_obj_clock_first_interval_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_GET), EO_TYPECHECK(double *, ret)

## Functions
Evas_Object * | elm_clock_add (Evas_Object *parent)
| Add a new clock widget to the given parent Elementary (container) object. More...
void | elm_clock_time_set (Evas_Object *obj, int hrs, int min, int sec)
| Set a clock widget's time, programmatically. More...
void | elm_clock_time_get (const Evas_Object *obj, int *hrs, int *min, int *sec)
| Get a clock widget's time values. More...
void | elm_clock_edit_set (Evas_Object *obj, Eina_Bool edit)
| Set whether a given clock widget is under edition mode or under (default) displaying-only mode. More...
Eina_Bool | elm_clock_edit_get (const Evas_Object *obj)
| Retrieve whether a given clock widget is under editing mode or under (default) displaying-only mode. More...
void | elm_clock_edit_mode_set (Evas_Object *obj, Elm_Clock_Edit_Mode digedit)
| Set what digits of the given clock widget should be editable when in edition mode. More...
Elm_Clock_Edit_Mode | elm_clock_edit_mode_get (const Evas_Object *obj)
| Retrieve what digits of the given clock widget should be editable when in edition mode. More...
void | elm_clock_show_am_pm_set (Evas_Object *obj, Eina_Bool am_pm)
| Set if the given clock widget must show hours in military or am/pm mode. More...
Eina_Bool | elm_clock_show_am_pm_get (const Evas_Object *obj)
| Get if the given clock widget shows hours in military or am/pm mode. More...
void | elm_clock_show_seconds_set (Evas_Object *obj, Eina_Bool seconds)
| Set if the given clock widget must show time with seconds or not. More...
Eina_Bool | elm_clock_show_seconds_get (const Evas_Object *obj)
| Get whether the given clock widget is showing time with seconds or not. More...
void | elm_clock_first_interval_set (Evas_Object *obj, double interval)
| Set the first interval on time updates for a user mouse button hold on clock widgets' time edition. More...
double | elm_clock_first_interval_get (const Evas_Object *obj)
| Get the first interval on time updates for a user mouse button hold on clock widgets' time edition. More...

## Detailed Description

This is a digital clock widget. In its default theme, it has a vintage "flipping numbers clock" appearance, which will animate sheets of individual algorisms individually as time goes by.

A newly created clock will fetch system's time (already considering local time adjustments) to start with, and will tick accordingly. It may or may not show seconds.

Clocks have an edition mode. When in it, the sheets will display extra arrow indications on the top and bottom and the user may click on them to raise or lower the time values. After it's told to exit edition mode, it will keep ticking with that new time set (it keeps the difference from local time).

Also, when under edition mode, user clicks on the cited arrows which are held for some time will make the clock to flip the sheet, thus editing the time, continuously and automatically for the user. The interval between sheet flips will keep reducing in time, so that it helps the user to reach a time which is distant from the one set.

The time display is, by default, in military mode (24h), but an am/pm indicator may be optionally shown, too, when it will switch to 12h.

This widget inherits from the Layout one, so that all the functions acting on it also work for clock objects.

This widget emits the following signals, besides the ones sent from Layout:

- `"changed"` - the clock's user changed the time
- `"focused"` - When the clock ehas received focus. (since 1.8)
- `"unfocused"` - When the clock has lost focus. (since 1.8)

Supported elm_object common APIs.

- elm_object_signal_emit
- elm_object_signal_callback_add
- elm_object_signal_callback_del

Here is an example on its usage:

- Clock widget example

## Macro Definition Documentation

#define elm_obj_clock_edit_get | ( |  | ret | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Retrieve whether a given clock widget is under editing mode under (default) displaying-only mode.

Parameters

  [out] | ret |

See Also
  elm_clock_edit_get

Referenced by elm_clock_edit_get().

#define elm_obj_clock_edit_mode_get | ( |  | ret | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_GET), EO_TYPECHECK(Elm_Clock_Edit_Mode *, ret)

Since
  1.8

Retrieve what digits of the given clock widget should be editable when in edition mode.

Parameters

  [out] | ret |

See Also
  elm_clock_edit_mode_get

Referenced by elm_clock_edit_mode_get().

#define elm_obj_clock_edit_mode_set | ( |  | digedit | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_SET), EO_TYPECHECK(Elm_Clock_Edit_Mode, digedit)

Since
  1.8

Set what digits of the given clock widget should be editable

Parameters

  [in] | digedit |

See Also
  elm_clock_edit_mode_set

Referenced by elm_clock_edit_mode_set().

#define elm_obj_clock_edit_set | ( |  | edit | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_SET), EO_TYPECHECK(Eina_Bool, edit)

Since
  1.8

Set whether a given clock widget is under edition mode or under (default) displaying-only mode.

Parameters

  [in] | edit |

See Also
  elm_clock_edit_set

Referenced by elm_clock_edit_set().

#define elm_obj_clock_first_interval_get | ( |  | ret | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_GET), EO_TYPECHECK(double *, ret)

Since
  1.8

Get the first interval on time updates for a user mouse button hold

Parameters

  [out] | ret |

See Also
  elm_clock_first_interval_get

Referenced by elm_clock_first_interval_get().

#define elm_obj_clock_first_interval_set | ( |  | interval | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_SET), EO_TYPECHECK(double, interval)

Since
  1.8

Set the first interval on time updates for a user mouse button hold

Parameters

  [in] | interval |

See Also
  elm_clock_first_interval_set

Referenced by elm_clock_first_interval_set().

#define elm_obj_clock_show_am_pm_get | ( |  | ret | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get if the given clock widget shows hours in military or am/pm mode

Parameters

  [out] | ret |

See Also
  elm_clock_show_am_pm_get

Referenced by elm_clock_show_am_pm_get().

#define elm_obj_clock_show_am_pm_set | ( |  | am_pm | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_SET), EO_TYPECHECK(Eina_Bool, am_pm)

Since
  1.8

Set if the given clock widget must show hours in military or am/pm mode

Parameters

  [in] | am_pm |

See Also
  elm_clock_show_am_pm_set

Referenced by elm_clock_show_am_pm_set().

#define elm_obj_clock_show_seconds_get | ( |  | ret | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get whether the given clock widget is showing time with seconds

Parameters

  [out] | ret |

See Also
  elm_clock_show_seconds_get

Referenced by elm_clock_show_seconds_get().

#define elm_obj_clock_show_seconds_set | ( |  | seconds | ) | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_SET), EO_TYPECHECK(Eina_Bool, seconds)

Since
  1.8

Set if the given clock widget must show time with seconds or not

Parameters

  [in] | seconds |

See Also
  elm_clock_show_seconds_set

Referenced by elm_clock_show_seconds_set().

#define elm_obj_clock_time_get | ( |  | hrs,
|  |  | min,
|  |  | sec
| ) |  | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_GET), EO_TYPECHECK(int *, hrs), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, sec)

Since
  1.8

Get a clock widget's time values

Parameters

  [out] | hrs |
  [out] | min |
  [out] | sec |

See Also
  elm_clock_time_get

Referenced by elm_clock_time_get().

#define elm_obj_clock_time_set | ( |  | hrs,
|  |  | min,
|  |  | sec
| ) |  | ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_SET), EO_TYPECHECK(int, hrs), EO_TYPECHECK(int, min), EO_TYPECHECK(int, sec)

Since
  1.8

Set a clock widget's time, programmatically

Parameters

  [in] | hrs |
  [in] | min |
  [in] | sec |

See Also
  elm_clock_time_set

Referenced by elm_clock_time_set().

## Function Documentation

Evas_Object* elm_clock_add | ( | Evas_Object * | parent | ) |

Add a new clock widget to the given parent Elementary (container) object.

Parameters

  parent | The parent object

Returns
  a new clock widget handle or `NULL`, on errors

This function inserts a new clock widget on the canvas.

Eina_Bool elm_clock_edit_get | ( | const Evas_Object * | obj | ) |

Retrieve whether a given clock widget is under editing mode or under (default) displaying-only mode.

Parameters

  obj | The clock object

Returns
  `EINA_TRUE`, if it's in edition mode, `EINA_FALSE` otherwise

This function retrieves whether the clock's time can be edited or not by user interaction.

See Also
  elm_clock_edit_set() for more details

References elm_obj_clock_edit_get.

Elm_Clock_Edit_Mode elm_clock_edit_mode_get | ( | const Evas_Object * | obj | ) |

Retrieve what digits of the given clock widget should be editable when in edition mode.

Parameters

  obj | The clock object

Returns
  Bit mask indicating the digits to be editable (values in #Elm_Clock_Edit_Mode).

See Also
  elm_clock_edit_mode_set() for more details

References elm_obj_clock_edit_mode_get.

void elm_clock_edit_mode_set | ( | Evas_Object * | obj,
|  | Elm_Clock_Edit_Mode | digedit
| ) |  |

Set what digits of the given clock widget should be editable when in edition mode.

Parameters

  obj | The clock object
  digedit | Bit mask indicating the digits to be editable (values in #Elm_Clock_Edit_Mode).

See Also
  elm_clock_edit_mode_get()

References elm_obj_clock_edit_mode_set.

void elm_clock_edit_set | ( | Evas_Object * | obj,
|  | Eina_Bool | edit
| ) |  |

Set whether a given clock widget is under edition mode or under (default) displaying-only mode.

Parameters

  obj | The clock object
  edit | `EINA_TRUE` to put it in edition, `EINA_FALSE` to put it back to "displaying only" mode

This function makes a clock's time to be editable or not by user interaction. When in edition mode, clocks stop ticking, until one brings them back to canonical mode. The elm_clock_edit_mode_set() function will influence which digits of the clock will be editable.

Note
  am/pm sheets, if being shown, will always be editable under edition mode.

See Also
  elm_clock_edit_get()

References elm_obj_clock_edit_set.

double elm_clock_first_interval_get | ( | const Evas_Object * | obj | ) |

Get the first interval on time updates for a user mouse button hold on clock widgets' time edition.

Parameters

  obj | The clock object

Returns
  The first interval value, in seconds, set on it

See Also
  elm_clock_first_interval_set() for more details

References elm_obj_clock_first_interval_get.

void elm_clock_first_interval_set | ( | Evas_Object * | obj,
|  | double | interval
| ) |  |

Set the first interval on time updates for a user mouse button hold on clock widgets' time edition.

Parameters

  obj | The clock object
  interval | The first interval value in seconds

This interval value is decreased while the user holds the mouse pointer either incrementing or decrementing a given the clock digit's value.

This helps the user to get to a given time distant from the current one easier/faster, as it will start to flip quicker and quicker on mouse button holds.

The calculation for the next flip interval value, starting from the one set with this call, is the previous interval divided by 1.05, so it decreases a little bit.

The default starting interval value for automatic flips is 0.85 seconds.

See Also
  elm_clock_first_interval_get()

References elm_obj_clock_first_interval_set.

Eina_Bool elm_clock_show_am_pm_get | ( | const Evas_Object * | obj | ) |

Get if the given clock widget shows hours in military or am/pm mode.

Parameters

  obj | The clock object

Returns
  `EINA_TRUE`, if in am/pm mode, `EINA_FALSE` if in military

This function gets if the clock shows hours in military or am/pm mode.

See Also
  elm_clock_show_am_pm_set() for more details

References elm_obj_clock_show_am_pm_get.

void elm_clock_show_am_pm_set | ( | Evas_Object * | obj,
|  | Eina_Bool | am_pm
| ) |  |

Set if the given clock widget must show hours in military or am/pm mode.

Parameters

  obj | The clock object
  am_pm | `EINA_TRUE` to put it in am/pm mode, `EINA_FALSE` to military mode

This function sets if the clock must show hours in military or am/pm mode. In some countries like Brazil the military mode (00-24h-format) is used, in opposition to the USA, where the am/pm mode is more commonly used.

See Also
  elm_clock_show_am_pm_get()

References elm_obj_clock_show_am_pm_set.

Eina_Bool elm_clock_show_seconds_get | ( | const Evas_Object * | obj | ) |

Get whether the given clock widget is showing time with seconds or not.

Parameters

  obj | The clock object

Returns
  `EINA_TRUE` if it's showing seconds, `EINA_FALSE` otherwise

This function gets whether `obj` is showing or not the elapsed seconds.

See Also
  elm_clock_show_seconds_set()

References elm_obj_clock_show_seconds_get.

void elm_clock_show_seconds_set | ( | Evas_Object * | obj,
|  | Eina_Bool | seconds
| ) |  |

Set if the given clock widget must show time with seconds or not.

Parameters

  obj | The clock object
  seconds | `EINA_TRUE` to show seconds, `EINA_FALSE` otherwise

This function sets if the given clock must show or not elapsed seconds. By default, they are not shown.

See Also
  elm_clock_show_seconds_get()

References elm_obj_clock_show_seconds_set.

void elm_clock_time_get | ( | const Evas_Object * | obj,
|  | int * | hrs,
|  | int * | min,
|  | int * | sec
| ) |  |

Get a clock widget's time values.

Parameters

  | obj | The clock object
  [out] | hrs | Pointer to the variable to get the hours value
  [out] | min | Pointer to the variable to get the minutes value
  [out] | sec | Pointer to the variable to get the seconds value

This function gets the time set for `obj`, returning it on the variables passed as the arguments to function

Note
  Use `NULL` pointers on the time values you're not interested in: they'll be ignored by the function.

References elm_obj_clock_time_get.

void elm_clock_time_set | ( | Evas_Object * | obj,
|  | int | hrs,
|  | int | min,
|  | int | sec
| ) |  |

Set a clock widget's time, programmatically.

Parameters

  obj | The clock widget object
  hrs | The hours to set
  min | The minutes to set
  sec | The seconds to set

This function updates the time that is showed by the clock widget.

Values must be set within the following ranges:

- 0 - 23, for hours
- 0 - 59, for minutes
- 0 - 59, for seconds,

even if the clock is not in "military" mode.

Warning
  The behavior for values set out of those ranges is undefined.

References elm_obj_clock_time_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:12