Tizen Native API
|
Functions | |
Evas_Object * | elm_datetime_add (Evas_Object *parent) |
Adds a new datetime widget. | |
const char * | elm_datetime_format_get (const Evas_Object *obj) |
Gets the datetime format. Format is a combination of allowed LIBC date format specifiers like: "%b %d, %Y %I : %M %p". | |
void | elm_datetime_format_set (Evas_Object *obj, const char *fmt) |
Sets the datetime format. Format is a combination of allowed LIBC date format specifiers like: "%b %d, %Y %I : %M %p". | |
Eina_Bool | elm_datetime_value_max_get (const Evas_Object *obj, struct tm *maxtime) |
Gets the upper boundary of a field. | |
Eina_Bool | elm_datetime_value_max_set (Evas_Object *obj, const struct tm *maxtime) |
Sets the upper boundary of a field. | |
Eina_Bool | elm_datetime_value_min_get (const Evas_Object *obj, struct tm *mintime) |
Gets the lower boundary of a field. | |
Eina_Bool | elm_datetime_value_min_set (Evas_Object *obj, const struct tm *mintime) |
Sets the lower boundary of a field. | |
void | elm_datetime_field_limit_get (const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int *min, int *max) |
Gets the field limits of a field. | |
void | elm_datetime_field_limit_set (Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int min, int max) |
Sets the field limits of a field. | |
Eina_Bool | elm_datetime_value_get (const Evas_Object *obj, struct tm *currtime) |
Gets the current value of a field. | |
Eina_Bool | elm_datetime_value_set (Evas_Object *obj, const struct tm *newtime) |
Sets the current value of the Datetime object. | |
Eina_Bool | elm_datetime_field_visible_get (const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype) |
Gets whether a field can be visible. | |
void | elm_datetime_field_visible_set (Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, Eina_Bool visible) |
Sets a field to be visible. | |
Typedefs | |
typedef enum _Elm_Datetime_Field_Type | Elm_Datetime_Field_Type |
Enumeration that identifies a Datetime field, the widget supports 6 fields : Year, Month, Date, Hour, Minute, AM/PM. |
The Datetime widget is used to display the input date & time values.
This widget displays date and time as per the system's locale settings (Date includes Day, Month & Year along with the defined separators and Time includes Hour, Minute & AM/PM fields. Separator for AM/PM field is ignored.
The corresponding Month, AM/PM strings are displayed according to the system’s language settings.
The Datetime format is a combination of LIBC standard characters like “%d %b %Y %I : %M %p” which, as a whole represents both Date as well as Time format.
Elm_datetime supports only the following sub set of LIBC date format specifiers:
%Y : The year as a decimal number including the century (example: 2011).
%m : The month as a decimal number (range 01 to 12).
%b : The abbreviated month name according to the current locale.
%B : The full month name according to the current locale.
%h : The abbreviated month name according to the current locale(same as %b).
%d : The day of the month as a decimal number (range 01 to 31).
%e : The day of the month as a decimal number (range 1 to 31). Single digits are preceded by a blank.
%I : The hour as a decimal number using a 12-hour clock (range 01 to 12).
%H : The hour as a decimal number using a 24-hour clock (range 00 to 23).
%k : The hour (24-hour clock) as a decimal number (range 0 to 23). Single digits are preceded by a blank.
%l : The hour (12-hour clock) as a decimal number (range 1 to 12). Single digits are preceded by a blank.
%M : The minute as a decimal number (range 00 to 59).
%p : Either 'AM' or 'PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as 'PM' and midnight as 'AM'
%P : Like p, but in lower case: 'am' or 'pm' or a corresponding string for the current locale.
%c : The preferred date and time representation for the current locale.
%x : The preferred date representation for the current locale without the time.
%X : The preferred time representation for the current locale without the date.
%r : The complete calendar time using the AM/PM format of the current locale.
%R : The hour and minute in decimal numbers using the format H:M.
%T : The time of the day in decimal numbers using the format H:M:S.
%F : The date using the format %Y-%m-%d.
(For more reference on the available LIBC date format specifiers, please visit the link: http://www.gnu.org/s/hello/manual/libc.html#Formatting-Calendar-Time )
The Datetime widget can provide Unicode separators in between its fields except for AM/PM field. A separator can be any Unicode character other than the LIBC standard date format specifiers.( Example: In the format %b %d , %Y %H : %M comma(,) is a separator for the date field %d and colon(:) is a separator for the hour field %H ).
The default format is a predefined one, based on the system Locale.
The Hour format 12hr(1-12) or 24hr(0-23) display can be selected by setting the corresponding user format.
Datetime supports six fields: Year, Month, Date, Hour, Minute, AM/PM. Depending on the Datetime module that is loaded, the user can see different UIs to select the individual field values.
The individual fields of Datetime can be arranged in any order according to the format set by the application.
There is a provision to set the visibility of a particular field as TRUE/ FALSE so that only time/ only date / only required fields are displayed.
Each field has default minimum and maximum values just like the daily calendar information. These min/max values can be modified as per the application usage.
A user can enter the values only in between the range of the maximum and minimum values. Apart from these APIs, there is a provision to display only a limited set of values out of the possible values. APIs to select the individual field limits are intended for this purpose.
The whole widget is left aligned and its size grows horizontally depending on the current format and each field's visible/disabled state.
Datetime individual field selection is implemented in a modular style. Module can be implemented as a Ctxpopup based selection or an ISE based selection, or even a spinner like selection.
Datetime Module design:
The following functions are expected to be implemented in a Datetime module:
Field creation:
__________ __________ | |----- obj_hook() ---------------------->>>| | | |<<<----------------returns Mod_data ------| | | Datetime |_______ | | | widget | |Assign module call backs | Module | | base |<<<____| | | | | | | | |----- field_create() ------------------>>>| | |__________|<<<----------------returns field_obj -----|__________|
Field value setting:
__________ __________ | | | | | Datetime |<<<----------elm_datetime_value_set()---| | | widget | | Module | | base |----display_field_value()------------>>>| | |__________| |__________|
del_hook:
__________ __________ | | | | | Datetime |----obj_unhook()-------------------->>>>| | | widget | | Module | | base | <<<-----frees mod_data---------| | |__________| |__________|
Any module can use the following shared functions that are implemented in elm_datetime.c :
field_format_get() - Gives the field format.
field_limit_get() - Gives the field minimum and maximum limits.
This widget inherits from the Layout one, so that all the functions acting on it also work for datetime objects.
This widget emits the following signals, besides the ones sent from Layout :
Enumeration that identifies a Datetime field, the widget supports 6 fields : Year, Month, Date, Hour, Minute, AM/PM.
Evas_Object* elm_datetime_add | ( | Evas_Object * | parent | ) |
Adds a new datetime widget.
[in] | parent | The parent object |
NULL
if it cannot be created void elm_datetime_field_limit_get | ( | const Evas_Object * | obj, |
Elm_Datetime_Field_Type | fieldtype, | ||
int * | min, | ||
int * | max | ||
) |
Gets the field limits of a field.
[in] | obj | The datetime object |
[in] | fieldtype | The type of the field, ELM_DATETIME_YEAR |
[out] | min | A reference to the field's minimum value |
[out] | max | A reference to field's maximum value |
void elm_datetime_field_limit_set | ( | Evas_Object * | obj, |
Elm_Datetime_Field_Type | fieldtype, | ||
int | min, | ||
int | max | ||
) |
Sets the field limits of a field.
[in] | obj | The datetime object |
[in] | fieldtype | The type of the field, ELM_DATETIME_YEAR |
[in] | min | A reference to the field's minimum value |
[in] | max | A reference to thr field's maximum value |
Eina_Bool elm_datetime_field_visible_get | ( | const Evas_Object * | obj, |
Elm_Datetime_Field_Type | fieldtype | ||
) |
Gets whether a field can be visible.
[in] | obj | The datetime object |
[in] | fieldtype | The type of the field, ELM_DATETIME_YEAR |
EINA_TRUE
if the field can be visible, otherwise EINA_FALSE
void elm_datetime_field_visible_set | ( | Evas_Object * | obj, |
Elm_Datetime_Field_Type | fieldtype, | ||
Eina_Bool | visible | ||
) |
Sets a field to be visible.
true
does not ensure that the field is visible, apart from this, the field's format must be present in the Datetime overall format. If a field's visibility is set to false
then it won't appear even though its format is present in the overall format. So if and only if this API is set to true
and the corresponding field's format is present in the Datetime format, the field is visible.true
.[in] | obj | The datetime object |
[in] | fieldtype | The type of the field, ELM_DATETIME_YEAR |
[in] | visible | If EINA_TRUE the field can be visible, otherwise EINA_FALSE |
const char* elm_datetime_format_get | ( | const Evas_Object * | obj | ) |
Gets the datetime format. Format is a combination of allowed LIBC date format specifiers like: "%b %d, %Y %I : %M %p".
64
chars.6
UTF-8 bytes. Space is also taken as a separator.%Y : The year as a decimal number including the century.
%m : The month as a decimal number (range 01 to 12).
%b : The abbreviated month name according to the current locale.
%B : The full month name according to the current locale.
%h : The abbreviated month name according to the current locale(same as %b).
%d : The day of the month as a decimal number (range 01 to 31).
%e : The day of the month as a decimal number (range 1 to 31). Single digits are preceded by a blank.
%I : The hour as a decimal number using a 12-hour clock (range 01 to 12).
%H : The hour as a decimal number using a 24-hour clock (range 00 to 23).
%k : The hour (24-hour clock) as a decimal number (range 0 to 23). Single digits are preceded by a blank.
%l : The hour (12-hour clock) as a decimal number (range 1 to 12). Single digits are preceded by a blank.
%M : The minute as a decimal number (range 00 to 59).
%p : Either 'AM' or 'PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as 'PM' and midnight as 'AM'.
%P : Like p, but in lower case: 'am' or 'pm' or a corresponding string for the current locale.
%c : The preferred date and time representation for the current locale.
%x : The preferred date representation for the current locale without the time.
%X : The preferred time representation for the current locale without the date.
%r : The complete calendar time using the AM/PM format of the current locale.
%R : The hour and minute in decimal numbers using the format H:M.
%T : The time of the day in decimal numbers using the format H:M:S.
%F : The date using the format %Y-%m-%d.
[in] | obj | The datetime object |
void elm_datetime_format_set | ( | Evas_Object * | obj, |
const char * | fmt | ||
) |
Sets the datetime format. Format is a combination of allowed LIBC date format specifiers like: "%b %d, %Y %I : %M %p".
64
chars.6
UTF-8 bytes. Space is also taken as a separator.%Y : The year as a decimal number including the century.
%m : The month as a decimal number (range 01 to 12).
%b : The abbreviated month name according to the current locale.
%B : The full month name according to the current locale.
%h : The abbreviated month name according to the current locale(same as %b).
%d : The day of the month as a decimal number (range 01 to 31).
%e : The day of the month as a decimal number (range 1 to 31). Single digits are preceded by a blank.
%I : The hour as a decimal number using a 12-hour clock (range 01 to 12).
%H : The hour as a decimal number using a 24-hour clock (range 00 to 23).
%k : The hour (24-hour clock) as a decimal number (range 0 to 23). Single digits are preceded by a blank.
%l : The hour (12-hour clock) as a decimal number (range 1 to 12). Single digits are preceded by a blank.
%M : The minute as a decimal number (range 00 to 59).
%p : Either 'AM' or 'PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as 'PM' and midnight as 'AM'.
%P : Like p, but in lower case: 'am' or 'pm' or a corresponding string for the current locale.
%c : The preferred date and time representation for the current locale.
%x : The preferred date representation for the current locale without the time.
%X : The preferred time representation for the current locale without the date.
%r : The complete calendar time using the AM/PM format of the current locale.
%R : The hour and minute in decimal numbers using the format H:M.
%T : The time of the day in decimal numbers using the format H:M:S.
%F : The date using the format %Y-%m-%d.
[in] | obj | The datetime object |
[in] | fmt | The datetime format |
Eina_Bool elm_datetime_value_get | ( | const Evas_Object * | obj, |
struct tm * | currtime | ||
) |
Gets the current value of a field.
[in] | obj | The datetime object |
[in] | currtime | The time structure |
EINA_TRUE
if the current time is returned successfully, otherwise EINA_FALSE
Eina_Bool elm_datetime_value_max_get | ( | const Evas_Object * | obj, |
struct tm * | maxtime | ||
) |
Gets the upper boundary of a field.
[in] | obj | The datetime object |
[out] | maxtime | The time structure containing the maximum time value |
EINA_TRUE
if the maximum value is returned successfully, otherwise EINA_FALSE
Eina_Bool elm_datetime_value_max_set | ( | Evas_Object * | obj, |
const struct tm * | maxtime | ||
) |
Sets the upper boundary of a field.
[in] | obj | The datetime object |
[in] | maxtime | The time structure containing the maximum time value. |
EINA_TRUE
if the maximum value is accepted, otherwise EINA_FALSE
Eina_Bool elm_datetime_value_min_get | ( | const Evas_Object * | obj, |
struct tm * | mintime | ||
) |
Gets the lower boundary of a field.
[in] | obj | The datetime object |
[out] | mintime | The time structure |
EINA_TRUE
if the minimum value is successfully returned, otherwise EINA_FALSE
Eina_Bool elm_datetime_value_min_set | ( | Evas_Object * | obj, |
const struct tm * | mintime | ||
) |
Sets the lower boundary of a field.
[in] | obj | The datetime object |
[in] | mintime | The time structure containing the minimum time value |
EINA_TRUE
if the minimum value is accepted, otherwise EINA_FALSE
Eina_Bool elm_datetime_value_set | ( | Evas_Object * | obj, |
const struct tm * | newtime | ||
) |
Sets the current value of the Datetime object.
[in] | obj | The datetime object |
[in] | newtime | The time structure filled with values to be set |
EINA_TRUE
if the current time is set successfully, otherwise EINA_FALSE