![]() |
![]() |
![]() |
Hildon Reference Manual | ![]() |
---|---|---|---|---|
HildonTimeEditorHildonTimeEditor — A widget used to enter time or duration in hours, minutes, and optional seconds. |
![]() |
enum HildonDateTimeError; HildonTimeEditor; 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_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); void hildon_time_editor_get_time_separators (GtkLabel *hm_sep_label, GtkLabel *ms_sep_label);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----HildonTimeEditor
"duration-max" guint : Read / Write "duration-min" guint : Read / Write "duration-mode" gboolean : Read / Write "show-hours" gboolean : Read / Write "show-seconds" gboolean : Read / Write "ticks" guint : Read / Write
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.
HildonTimeEditor has been deprecated since Hildon 2.2 and should not be used in newly written code. See Migrating Time Widgets section to know how to migrate this deprecated widget.
Example 25. HildonTimePicker example
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 { HILDON_DATE_TIME_ERROR_NO_ERROR = -1, HILDON_DATE_TIME_ERROR_MAX_HOURS, HILDON_DATE_TIME_ERROR_MAX_MINS, HILDON_DATE_TIME_ERROR_MAX_SECS, HILDON_DATE_TIME_ERROR_MAX_DAY, HILDON_DATE_TIME_ERROR_MAX_MONTH, HILDON_DATE_TIME_ERROR_MAX_YEAR, HILDON_DATE_TIME_ERROR_MIN_HOURS, HILDON_DATE_TIME_ERROR_MIN_MINS, HILDON_DATE_TIME_ERROR_MIN_SECS, HILDON_DATE_TIME_ERROR_MIN_DAY, HILDON_DATE_TIME_ERROR_MIN_MONTH, HILDON_DATE_TIME_ERROR_MIN_YEAR, HILDON_DATE_TIME_ERROR_EMPTY_HOURS, HILDON_DATE_TIME_ERROR_EMPTY_MINS, HILDON_DATE_TIME_ERROR_EMPTY_SECS, HILDON_DATE_TIME_ERROR_EMPTY_DAY, HILDON_DATE_TIME_ERROR_EMPTY_MONTH, HILDON_DATE_TIME_ERROR_EMPTY_YEAR, HILDON_DATE_TIME_ERROR_MIN_DURATION, HILDON_DATE_TIME_ERROR_MAX_DURATION, HILDON_DATE_TIME_ERROR_INVALID_CHAR, HILDON_DATE_TIME_ERROR_INVALID_DATE, HILDON_DATE_TIME_ERROR_INVALID_TIME } HildonDateTimeError;
HildonDateTimeError
is deprecated and should not be used in newly-written code.
typedef struct _HildonTimeEditor HildonTimeEditor;
HildonTimeEditor
is deprecated and should not be used in newly-written code.
GtkWidget* hildon_time_editor_new (void);
hildon_time_editor_new
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_set_time
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_get_time
is deprecated and should not be used in newly-written code.
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_set_duration_range (HildonTimeEditor *editor, guint min_seconds, guint max_seconds);
hildon_time_editor_set_duration_range
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_get_duration_range
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_set_ticks
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_get_ticks
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_set_show_seconds
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_get_show_seconds
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_set_show_hours
is deprecated and should not be used in newly-written code.
This function shows or hides the hours field.
editor : |
The HildonTimeEditor. |
show_hours : |
Enable or disable showing of hours. |
gboolean hildon_time_editor_get_show_hours (HildonTimeEditor *editor);
hildon_time_editor_get_show_hours
is deprecated and should not be used in newly-written code.
This function returns a boolean indicating the visibility of
hours in the HildonTimeEditor
editor : |
the HildonTimeEditor widget.
|
Returns : | TRUE if hours are visible. |
void hildon_time_editor_set_duration_mode (HildonTimeEditor *editor, gboolean duration_mode);
hildon_time_editor_set_duration_mode
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_get_duration_mode
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_set_duration_min
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_get_duration_min
is deprecated and should not be used in newly-written code.
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);
hildon_time_editor_set_duration_max
is deprecated and should not be used in newly-written code.
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 |
guint hildon_time_editor_get_duration_max (HildonTimeEditor *editor);
hildon_time_editor_get_duration_max
is deprecated and should not be used in newly-written code.
This function returns the longest duration the HildonTimeEditor allows in the duration mode.
editor : |
the HildonTimeEditor widget |
Returns : | maximum allowed duration in seconds |
void hildon_time_editor_get_time_separators (GtkLabel *hm_sep_label, GtkLabel *ms_sep_label);
hildon_time_editor_get_time_separators
is deprecated and should not be used in newly-written code.
Gets hour-minute separator and minute-second separator from current locale and sets then to the labels we set as parameters. Both parameters can be NULL if you just want to assing one separator.
hm_sep_label : |
the label that will show the hour:minutes separator |
ms_sep_label : |
the label that will show the minutes:seconds separator |
"duration-max"
property"duration-max" guint : Read / Write
Largest possible duration value.
Default value: 359999
"duration-min"
property"duration-min" guint : Read / Write
Smallest possible duration value.
Allowed values: <= 359999
Default value: 0
"duration-mode"
property"duration-mode" gboolean : Read / Write
Controls whether the TimeEditor is in duration mode.
Default value: FALSE
"show-hours"
property"show-hours" gboolean : Read / Write
Controls whether the hours field is shown in the editor.
Default value: TRUE
"show-seconds"
property"show-seconds" gboolean : Read / Write
Controls whether the seconds are shown in the editor.
Default value: FALSE
"ticks"
property"ticks" guint : Read / Write
If editor is in duration mode, contains the duration seconds. If not, contains seconds since midnight.
Default value: 0
"time-error"
signalgboolean user_function (HildonTimeEditor *hildontimeeditor, HildonDateTimeError arg1, gpointer user_data) : Run Last
hildontimeeditor : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
Returns : |