Enumerations | Functions
Clock

Enumerations

enum  Elm_Clock_Edit_Mode { ,
  ELM_CLOCK_EDIT_HOUR_DECIMAL = 1,
  ELM_CLOCK_EDIT_HOUR_UNIT = 2,
  ELM_CLOCK_EDIT_MIN_DECIMAL = 4,
  ELM_CLOCK_EDIT_MIN_UNIT = 8,
  ELM_CLOCK_EDIT_SEC_DECIMAL = 16,
  ELM_CLOCK_EDIT_SEC_UNIT = 32,
  ELM_CLOCK_EDIT_ALL = 63 ,
  ELM_CLOCK_EDIT_HOUR_DECIMAL = 1,
  ELM_CLOCK_EDIT_HOUR_UNIT = 2,
  ELM_CLOCK_EDIT_MIN_DECIMAL = 4,
  ELM_CLOCK_EDIT_MIN_UNIT = 8,
  ELM_CLOCK_EDIT_SEC_DECIMAL = 16,
  ELM_CLOCK_EDIT_SEC_UNIT = 32,
  ELM_CLOCK_EDIT_ALL = 63
}
 Identifiers for which clock digits should be editable, when a clock widget is in edition mode. More...
 
enum  Elm_Clock_Edit_Mode { ,
  ELM_CLOCK_EDIT_HOUR_DECIMAL = 1,
  ELM_CLOCK_EDIT_HOUR_UNIT = 2,
  ELM_CLOCK_EDIT_MIN_DECIMAL = 4,
  ELM_CLOCK_EDIT_MIN_UNIT = 8,
  ELM_CLOCK_EDIT_SEC_DECIMAL = 16,
  ELM_CLOCK_EDIT_SEC_UNIT = 32,
  ELM_CLOCK_EDIT_ALL = 63 ,
  ELM_CLOCK_EDIT_HOUR_DECIMAL = 1,
  ELM_CLOCK_EDIT_HOUR_UNIT = 2,
  ELM_CLOCK_EDIT_MIN_DECIMAL = 4,
  ELM_CLOCK_EDIT_MIN_UNIT = 8,
  ELM_CLOCK_EDIT_SEC_DECIMAL = 16,
  ELM_CLOCK_EDIT_SEC_UNIT = 32,
  ELM_CLOCK_EDIT_ALL = 63
}
 Identifiers for which clock digits should be editable, when a clock widget is in edition mode. More...
 

Functions

EOAPI void elm_obj_clock_show_am_pm_set (Eina_Bool am_pm)
 Set if the given clock widget must show hours in military or am/pm mode. More...
 
EOAPI Eina_Bool elm_obj_clock_show_am_pm_get (void)
 Get if the given clock widget shows hours in military or am/pm mode. More...
 
EOAPI void elm_obj_clock_first_interval_set (double interval)
 Set the first interval on time updates for a user mouse button hold on clock widgets' time edition. More...
 
EOAPI double elm_obj_clock_first_interval_get (void)
 Get the first interval on time updates for a user mouse button hold on clock widgets' time edition. More...
 
EOAPI void elm_obj_clock_show_seconds_set (Eina_Bool seconds)
 Set if the given clock widget must show time with seconds or not. More...
 
EOAPI Eina_Bool elm_obj_clock_show_seconds_get (void)
 Get whether the given clock widget is showing time with seconds or not. More...
 
EOAPI void elm_obj_clock_edit_set (Eina_Bool edit)
 Set whether a given clock widget is under edition mode or under (default) displaying-only mode. More...
 
EOAPI Eina_Bool elm_obj_clock_edit_get (void)
 Get whether a given clock widget is under editing mode or under (default) displaying-only mode. More...
 
EOAPI void elm_obj_clock_pause_set (Eina_Bool paused)
 Set whether the given clock widget should be paused or not. More...
 
EOAPI Eina_Bool elm_obj_clock_pause_get (void)
 Get whether the given clock widget is paused. More...
 
EOAPI void elm_obj_clock_time_set (int hrs, int min, int sec)
 Set a clock widget's time, programmatically. More...
 
EOAPI void elm_obj_clock_time_get (int *hrs, int *min, int *sec)
 Get a clock widget's time values. More...
 
EOAPI void elm_obj_clock_edit_mode_set (Elm_Clock_Edit_Mode digedit)
 Set what digits of the given clock widget should be editable when in edition mode. More...
 
EOAPI Elm_Clock_Edit_Mode elm_obj_clock_edit_mode_get (void)
 Get what digits of the given clock widget should be editable when in edition mode. More...
 
void elm_clock_show_am_pm_set (Elm_Clock *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 Elm_Clock *obj)
 Get if the given clock widget shows hours in military or am/pm mode. More...
 
void elm_clock_first_interval_set (Elm_Clock *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 Elm_Clock *obj)
 Get the first interval on time updates for a user mouse button hold on clock widgets' time edition. More...
 
void elm_clock_show_seconds_set (Elm_Clock *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 Elm_Clock *obj)
 Get whether the given clock widget is showing time with seconds or not. More...
 
void elm_clock_edit_set (Elm_Clock *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 Elm_Clock *obj)
 Get whether a given clock widget is under editing mode or under (default) displaying-only mode. More...
 
void elm_clock_pause_set (Elm_Clock *obj, Eina_Bool paused)
 Set whether the given clock widget should be paused or not. More...
 
Eina_Bool elm_clock_pause_get (const Elm_Clock *obj)
 Get whether the given clock widget is paused. More...
 
void elm_clock_time_set (Elm_Clock *obj, int hrs, int min, int sec)
 Set a clock widget's time, programmatically. More...
 
void elm_clock_time_get (const Elm_Clock *obj, int *hrs, int *min, int *sec)
 Get a clock widget's time values. More...
 
void elm_clock_edit_mode_set (Elm_Clock *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 Elm_Clock *obj)
 Get what digits of the given clock widget should be editable when in edition mode. More...
 
Evas_Object * elm_clock_add (Evas_Object *parent)
 Add a new clock widget to the given parent Elementary (container) object. More...
 

Detailed Description

clock_inheritance_tree.png
preview-00.png

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:

Supported elm_object common APIs.

Here is an example on its usage:

Enumeration Type Documentation

Identifiers for which clock digits should be editable, when a clock widget is in edition mode.

Values may be OR-ed together to make a mask, naturally.

See also elm_obj_clock_edit_set, elm_obj_clock_edit_mode_set.

Enumerator
ELM_CLOCK_EDIT_HOUR_DECIMAL 

Default value.

Means that all digits are editable, when in edition mode.

ELM_CLOCK_EDIT_HOUR_UNIT 

Decimal digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_DECIMAL 

Unit digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_UNIT 

Decimal digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_DECIMAL 

Unit digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_UNIT 

Decimal digit of seconds value should be editable.

ELM_CLOCK_EDIT_ALL 

Unit digit of seconds value should be editable.

ELM_CLOCK_EDIT_HOUR_DECIMAL 

Default value.

Means that all digits are editable, when in edition mode.

ELM_CLOCK_EDIT_HOUR_UNIT 

Decimal digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_DECIMAL 

Unit digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_UNIT 

Decimal digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_DECIMAL 

Unit digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_UNIT 

Decimal digit of seconds value should be editable.

ELM_CLOCK_EDIT_ALL 

Unit digit of seconds value should be editable.

Identifiers for which clock digits should be editable, when a clock widget is in edition mode.

Values may be OR-ed together to make a mask, naturally.

See also elm_clock_edit_set, elm_clock_edit_mode_set.

Enumerator
ELM_CLOCK_EDIT_HOUR_DECIMAL 

Default value.

Means that all digits are editable, when in edition mode.

ELM_CLOCK_EDIT_HOUR_UNIT 

Decimal digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_DECIMAL 

Unit digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_UNIT 

Decimal digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_DECIMAL 

Unit digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_UNIT 

Decimal digit of seconds value should be editable.

ELM_CLOCK_EDIT_ALL 

Unit digit of seconds value should be editable.

ELM_CLOCK_EDIT_HOUR_DECIMAL 

Default value.

Means that all digits are editable, when in edition mode.

ELM_CLOCK_EDIT_HOUR_UNIT 

Decimal digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_DECIMAL 

Unit digit of hours value should be editable.

ELM_CLOCK_EDIT_MIN_UNIT 

Decimal digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_DECIMAL 

Unit digit of minutes value should be editable.

ELM_CLOCK_EDIT_SEC_UNIT 

Decimal digit of seconds value should be editable.

ELM_CLOCK_EDIT_ALL 

Unit digit of seconds value should be editable.

Function Documentation

Evas_Object* elm_clock_add ( Evas_Object *  parent)

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

Parameters
parentThe 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 Elm_Clock *  obj)

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

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

Returns
true to put it in edition, false to put it back to "displaying only" mode

References elm_obj_clock_edit_get().

Elm_Clock_Edit_Mode elm_clock_edit_mode_get ( const Elm_Clock *  obj)

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

See also elm_clock_edit_mode_set for more details.

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

References elm_obj_clock_edit_mode_get().

void elm_clock_edit_mode_set ( Elm_Clock *  obj,
Elm_Clock_Edit_Mode  digedit 
)

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

See also elm_clock_edit_mode_get.

Parameters
[in]digeditBit mask indicating the digits to be editable (values in Elm_Clock_Edit_Mode).

References elm_obj_clock_edit_mode_set().

void elm_clock_edit_set ( Elm_Clock *  obj,
Eina_Bool  edit 
)

Set whether a given clock widget is under edition mode or under (default) 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.

Parameters
[in]edittrue to put it in edition, false to put it back to "displaying only" mode

References elm_obj_clock_edit_set().

double elm_clock_first_interval_get ( const Elm_Clock *  obj)

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

See also elm_clock_first_interval_set for more details.

Returns
The first interval value in seconds

References elm_obj_clock_first_interval_get().

void elm_clock_first_interval_set ( Elm_Clock *  obj,
double  interval 
)

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

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.

Parameters
[in]intervalThe first interval value in seconds

References elm_obj_clock_first_interval_set().

Eina_Bool elm_clock_pause_get ( const Elm_Clock *  obj)

Get whether the given clock widget is paused.

This function gets whether the clock is paused or not.

See also elm_clock_pause_set.

Returns
true to pause clock, false otherwise
Since
1.9

References elm_obj_clock_pause_get().

void elm_clock_pause_set ( Elm_Clock *  obj,
Eina_Bool  paused 
)

Set whether the given clock widget should be paused or not.

This function pauses or starts the clock widget.

See also elm_clock_pause_get.

Parameters
[in]pausedtrue to pause clock, false otherwise
Since
1.9

References elm_obj_clock_pause_set().

Eina_Bool elm_clock_show_am_pm_get ( const Elm_Clock *  obj)

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

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.

Returns
true to put it in am/pm mode, false to military mode

References elm_obj_clock_show_am_pm_get().

void elm_clock_show_am_pm_set ( Elm_Clock *  obj,
Eina_Bool  am_pm 
)

Set if the given clock widget must show hours in military or am/pm 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.

Parameters
[in]am_pmtrue to put it in am/pm mode, false to military mode

References elm_obj_clock_show_am_pm_set().

Eina_Bool elm_clock_show_seconds_get ( const Elm_Clock *  obj)

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

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

See also elm_clock_show_seconds_set.

Returns
true to show seconds, false otherwise.

References elm_obj_clock_show_seconds_get().

void elm_clock_show_seconds_set ( Elm_Clock *  obj,
Eina_Bool  seconds 
)

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

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.

Parameters
[in]secondstrue to show seconds, false otherwise.

References elm_obj_clock_show_seconds_set().

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

Get a clock widget's time values.

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.
Parameters
[out]hrsThe hours to set
[out]minThe minutes to set
[out]secThe seconds to set

References elm_obj_clock_time_get().

void elm_clock_time_set ( Elm_Clock *  obj,
int  hrs,
int  min,
int  sec 
)

Set a clock widget's time, programmatically.

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

Values must be set within 0-23 for hours and 0-59 for minutes and seconds, even if the clock is not in "military" mode.

Warning
The behavior for values set out of those ranges is undefined.
Parameters
[in]hrsThe hours to set
[in]minThe minutes to set
[in]secThe seconds to set

References elm_obj_clock_time_set().

EOAPI Eina_Bool elm_obj_clock_edit_get ( void  )

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

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

See also elm_obj_clock_edit_set for more details

Returns
true to put it in edition, false to put it back to "displaying only" mode

Referenced by elm_clock_edit_get().

EOAPI Elm_Clock_Edit_Mode elm_obj_clock_edit_mode_get ( void  )

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

See also elm_obj_clock_edit_mode_set for more details.

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

Referenced by elm_clock_edit_mode_get().

EOAPI void elm_obj_clock_edit_mode_set ( Elm_Clock_Edit_Mode  digedit)

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

See also elm_obj_clock_edit_mode_get.

Parameters
[in]digeditBit mask indicating the digits to be editable (values in Elm_Clock_Edit_Mode).

Referenced by elm_clock_edit_mode_set().

EOAPI void elm_obj_clock_edit_set ( Eina_Bool  edit)

Set whether a given clock widget is under edition mode or under (default) 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_obj_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_obj_clock_edit_get.

Parameters
[in]edittrue to put it in edition, false to put it back to "displaying only" mode

Referenced by elm_clock_edit_set().

EOAPI double elm_obj_clock_first_interval_get ( void  )

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

See also elm_obj_clock_first_interval_set for more details.

Returns
The first interval value in seconds

Referenced by elm_clock_first_interval_get().

EOAPI void elm_obj_clock_first_interval_set ( double  interval)

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

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_obj_clock_first_interval_get.

Parameters
[in]intervalThe first interval value in seconds

Referenced by elm_clock_first_interval_set().

EOAPI Eina_Bool elm_obj_clock_pause_get ( void  )

Get whether the given clock widget is paused.

This function gets whether the clock is paused or not.

See also elm_obj_clock_pause_set.

Returns
true to pause clock, false otherwise
Since
1.9

Referenced by elm_clock_pause_get().

EOAPI void elm_obj_clock_pause_set ( Eina_Bool  paused)

Set whether the given clock widget should be paused or not.

This function pauses or starts the clock widget.

See also elm_obj_clock_pause_get.

Parameters
[in]pausedtrue to pause clock, false otherwise
Since
1.9

Referenced by elm_clock_pause_set().

EOAPI Eina_Bool elm_obj_clock_show_am_pm_get ( void  )

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

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

See also elm_obj_clock_show_am_pm_set for more details.

Returns
true to put it in am/pm mode, false to military mode

Referenced by elm_clock_show_am_pm_get().

EOAPI void elm_obj_clock_show_am_pm_set ( Eina_Bool  am_pm)

Set if the given clock widget must show hours in military or am/pm 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_obj_clock_show_am_pm_get.

Parameters
[in]am_pmtrue to put it in am/pm mode, false to military mode

Referenced by elm_clock_show_am_pm_set().

EOAPI Eina_Bool elm_obj_clock_show_seconds_get ( void  )

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

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

See also elm_obj_clock_show_seconds_set.

Returns
true to show seconds, false otherwise.

Referenced by elm_clock_show_seconds_get().

EOAPI void elm_obj_clock_show_seconds_set ( Eina_Bool  seconds)

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

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

See also elm_obj_clock_show_seconds_get.

Parameters
[in]secondstrue to show seconds, false otherwise.

Referenced by elm_clock_show_seconds_set().

EOAPI void elm_obj_clock_time_get ( int *  hrs,
int *  min,
int *  sec 
)

Get a clock widget's time values.

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.
Parameters
[out]hrsThe hours to set
[out]minThe minutes to set
[out]secThe seconds to set

Referenced by elm_clock_time_get().

EOAPI void elm_obj_clock_time_set ( int  hrs,
int  min,
int  sec 
)

Set a clock widget's time, programmatically.

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

Values must be set within 0-23 for hours and 0-59 for minutes and seconds, even if the clock is not in "military" mode.

Warning
The behavior for values set out of those ranges is undefined.
Parameters
[in]hrsThe hours to set
[in]minThe minutes to set
[in]secThe seconds to set

Referenced by elm_clock_time_set().