hildon-libs 0.14.11 Reference Manual |
---|
HildonTimeEditorHildonTimeEditor — A widget used to enter time or duration in hours, minutes, and optional seconds |
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);
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 );
...
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;
GtkWidget* hildon_time_editor_new (void);
This function creates a new time editor.
Returns : | pointer to a new HildonTimeEditor widget |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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
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
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 |
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 |
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 |
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 |
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 |
<< HildonRangeEditor | HildonDateEditor >> |