HildonTimeEditor

HildonTimeEditor — A widget used to enter time or duration in hours, minutes, and optional seconds

Synopsis




enum        HildonTimeEditorErrorType;
GtkWidget*  hildon_time_editor_new          (void);
void        hildon_time_editor_set_time     (HildonTimeEditor *editor,
                                             guint hours,
                                             guint minutes,
                                             guint seconds);
void        hildon_time_editor_get_time     (HildonTimeEditor *editor,
                                             guint *hours,
                                             guint *minutes,
                                             guint *seconds);
void        hildon_time_editor_show_seconds (HildonTimeEditor *editor,
                                             gboolean enable);
void        hildon_time_editor_enable_duration_mode
                                            (HildonTimeEditor *editor,
                                             gboolean enable);
void        hildon_time_editor_set_duration_range
                                            (HildonTimeEditor *editor,
                                             guint min_seconds,
                                             guint max_seconds);
void        hildon_time_editor_get_duration_range
                                            (HildonTimeEditor *editor,
                                             guint *min_seconds,
                                             guint *max_seconds);
void        hildon_time_editor_set_ticks    (HildonTimeEditor *editor,
                                             guint ticks);
guint       hildon_time_editor_get_ticks    (HildonTimeEditor *editor);
void        hildon_time_editor_set_show_seconds
                                            (HildonTimeEditor *editor,
                                             gboolean show_seconds);
gboolean    hildon_time_editor_get_show_seconds
                                            (HildonTimeEditor *editor);
void        hildon_time_editor_set_show_hours
                                            (HildonTimeEditor *editor,
                                             gboolean show_hours);
gboolean    hildon_time_editor_get_show_hours
                                            (HildonTimeEditor *editor);
void        hildon_time_editor_set_duration_mode
                                            (HildonTimeEditor *editor,
                                             gboolean duration_mode);
gboolean    hildon_time_editor_get_duration_mode
                                            (HildonTimeEditor *editor);
void        hildon_time_editor_set_duration_min
                                            (HildonTimeEditor *editor,
                                             guint duration_min);
guint       hildon_time_editor_get_duration_min
                                            (HildonTimeEditor *editor);
void        hildon_time_editor_set_duration_max
                                            (HildonTimeEditor *editor,
                                             guint duration_max);
guint       hildon_time_editor_get_duration_max
                                            (HildonTimeEditor *editor);

Description

HildonTimeEditor is used to edit time or duration. Time mode is restricted to normal 24 hour cycle, but Duration mode can select any amount of time up to 99 hours. It consists of entries for hours, minutes and seconds, and pm/am indicator as well as a button which popups a HildonTimePicker dialog.

...
editor = hildon_time_editor_new();
hildon_time_editor_set_time( editor, h, m, s );
...
gtk_box_pack_start ( ..., editor )
...
hildon_time_editor_get_time( editor, &h, &m, &s );
...

Details

enum HildonTimeEditorErrorType

typedef enum
{
  NO_TIME_ERROR = -1,
  MAX_HOURS,
  MAX_MINS,
  MAX_SECS,
  MIN_HOURS,
  MIN_MINS,
  MIN_SECS,
  EMPTY_HOURS,
  EMPTY_MINS,
  EMPTY_SECS,
  MIN_DUR,
  MAX_DUR,
  INVALID_TIME,
  INVALID_CHAR
} HildonTimeEditorErrorType;


hildon_time_editor_new ()

GtkWidget*  hildon_time_editor_new          (void);

This function creates a new time editor.

Returns : pointer to a new HildonTimeEditor widget

hildon_time_editor_set_time ()

void        hildon_time_editor_set_time     (HildonTimeEditor *editor,
                                             guint hours,
                                             guint minutes,
                                             guint seconds);

This function sets the time on an existing time editor. If the time specified by the arguments is invalid, it's fixed. The time is assumed to be in 24h format.

editor : the HildonTimeEditor widget
hours : hours
minutes : minutes
seconds : seconds

hildon_time_editor_get_time ()

void        hildon_time_editor_get_time     (HildonTimeEditor *editor,
                                             guint *hours,
                                             guint *minutes,
                                             guint *seconds);

Gets the time of the HildonTimeEditor widget. The time returned is always in 24h format.

editor : the HildonTimeEditor widget
hours : hours
minutes : minutes
seconds : seconds

hildon_time_editor_show_seconds ()

void        hildon_time_editor_show_seconds (HildonTimeEditor *editor,
                                             gboolean enable);

This function is deprecated, use hildon_time_editor_set_show_seconds instead.

editor : the HildonTimeEditor
enable : enable or disable showing of seconds

hildon_time_editor_enable_duration_mode ()

void        hildon_time_editor_enable_duration_mode
                                            (HildonTimeEditor *editor,
                                             gboolean enable);

This function is deprecated, use hildon_time_editor_set_duration_mode instead.

editor : the HildonTimeEditor
enable : enable or disable duration editor mode

hildon_time_editor_set_duration_range ()

void        hildon_time_editor_set_duration_range
                                            (HildonTimeEditor *editor,
                                             guint min_seconds,
                                             guint max_seconds);

Sets the duration editor time range of the HildonTimeEditor widget.

editor : the HildonTimeEditor widget
min_seconds : minimum allowed time in seconds
max_seconds : maximum allowed time in seconds

hildon_time_editor_get_duration_range ()

void        hildon_time_editor_get_duration_range
                                            (HildonTimeEditor *editor,
                                             guint *min_seconds,
                                             guint *max_seconds);

Gets the duration editor time range of the HildonTimeEditor widget.

editor : the HildonTimeEditor widget
min_seconds : pointer to guint
max_seconds : pointer to guint

hildon_time_editor_set_ticks ()

void        hildon_time_editor_set_ticks    (HildonTimeEditor *editor,
                                             guint ticks);

Sets the current duration in seconds. This means seconds from midnight, if not in duration mode. In case of any errors, it tries to fix it.

editor : the HildonTimeEditor widget
ticks : the duration to set, in seconds

hildon_time_editor_get_ticks ()

guint       hildon_time_editor_get_ticks    (HildonTimeEditor *editor);

This function returns the current duration, in seconds. This means seconds from midnight, if not in duration mode.

editor : the HildonTimeEditor widget
Returns : current duration in seconds

hildon_time_editor_set_show_seconds ()

void        hildon_time_editor_set_show_seconds
                                            (HildonTimeEditor *editor,
                                             gboolean show_seconds);

This function shows or hides the seconds field.

editor : the HildonTimeEditor
show_seconds : enable or disable showing of seconds

hildon_time_editor_get_show_seconds ()

gboolean    hildon_time_editor_get_show_seconds
                                            (HildonTimeEditor *editor);

This function returns a boolean indicating the visibility of seconds in the HildonTimeEditor

editor : the HildonTimeEditor widget
Returns : TRUE if the seconds are visible

hildon_time_editor_set_show_hours ()

void        hildon_time_editor_set_show_hours
                                            (HildonTimeEditor *editor,
                                             gboolean show_hours);

This function shows or hides the hours field.

editor : The HildonTimeEditor.
show_hours :

Since 0.12.4


hildon_time_editor_get_show_hours ()

gboolean    hildon_time_editor_get_show_hours
                                            (HildonTimeEditor *editor);

This function returns a boolean indicating the visibility of hours in the HildonTimeEditor

editor :
Returns : TRUE if hours are visible.

Since 0.12.4-1


hildon_time_editor_set_duration_mode ()

void        hildon_time_editor_set_duration_mode
                                            (HildonTimeEditor *editor,
                                             gboolean duration_mode);

This function sets the duration editor mode in which the maximum hours is 99.

editor : the HildonTimeEditor
duration_mode : enable or disable duration editor mode

hildon_time_editor_get_duration_mode ()

gboolean    hildon_time_editor_get_duration_mode
                                            (HildonTimeEditor *editor);

This function returns a boolean indicating whether the HildonTimeEditor is in the duration mode.

editor : the HildonTimeEditor widget
Returns : TRUE if the HildonTimeEditor is in duration mode

hildon_time_editor_set_duration_min ()

void        hildon_time_editor_set_duration_min
                                            (HildonTimeEditor *editor,
                                             guint duration_min);

Sets the minimum allowed duration for the duration mode. Note: Has no effect in time mode

editor : the HildonTimeEditor widget
duration_min : mimimum allowed duration

hildon_time_editor_get_duration_min ()

guint       hildon_time_editor_get_duration_min
                                            (HildonTimeEditor *editor);

This function returns the smallest duration the HildonTimeEditor allows in the duration mode.

editor : the HildonTimeEditor widget
Returns : minimum allowed duration in seconds

hildon_time_editor_set_duration_max ()

void        hildon_time_editor_set_duration_max
                                            (HildonTimeEditor *editor,
                                             guint duration_max);

Sets the maximum allowed duration in seconds for the duration mode. Note: Has no effect in time mode

editor : the HildonTimeEditor widget
duration_max : maximum allowed duration in seconds

hildon_time_editor_get_duration_max ()

guint       hildon_time_editor_get_duration_max
                                            (HildonTimeEditor *editor);

This function returns the longest duration the HildonTimeEditor allows in the duration mode.

editor : the HildonTimeEditor widget
Returns : maximum allowed duration in seconds

See Also

HildonTimePicker