efl/legacy/elementary/src/lib/elm_calendar.eo

433 lines
14 KiB
Plaintext
Raw Normal View History

enum Elm.Calendar.Mark.Repeat.Type
{
[[
Event periodicity, used to define if a mark should be repeated
beyond event's day. It's set when a mark is added.
So, for a mark added to 13th May with periodicity set to WEEKLY,
there will be marks every week after this date. Marks will be displayed
at 13th, 20th, 27th, 3rd June ...
Values don't work as bitmask, only one can be chosen.
See also @Elm.Calendar.mark_add.
]]
legacy: elm_calendar;
unique, [[Default value. Marks will be displayed only on event day.]]
daily, [[Marks will be displayed every day after event day (inclusive).]]
weekly, [[Marks will be displayed every week after event day (inclusive) - i.e. each seven days.]]
monthly, [[Marks will be displayed every month day that coincides to event day. E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb, but will be displayed on 30th Mar.]]
annually, [[Marks will be displayed every year that coincides to event day (and month). E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013.]]
last_day_of_month [[Marks will be displayed every last day of month after event day (inclusive).
@since 1.7]]
}
enum Elm.Calendar.Weekday
{
[[
A weekday
See also @Elm.Calendar.first_day_of_week.set.
]]
legacy: elm_day;
sunday,
monday,
tuesday,
wednesday,
thursday,
friday,
saturday,
last
}
enum Elm.Calendar.Select.Mode
{
[[
The mode, who determine how user could select a day
See also @Elm.Calendar.select_mode.set()
]]
default = 0, [[Default value. a day is always selected.]]
always, [[A day is always selected.]]
none, [[None of the days can be selected.]]
ondemand [[User may have selected a day or not.]]
}
enum Elm.Calendar.Selectable
{
[[
A bitmask used to define which fields of a $tm struct will be taken into
account, when elm_calendar_selected_time_set() is invoked.
See also @Elm.Calendar.selectable.set, @Elm.Calendar.selected_time_set.
@since 1.8
]]
none = 0,
year = (1 << 0),
month = (1 << 1),
day = (1 << 2)
}
class Elm.Calendar (Elm.Layout, Elm_Interface_Atspi_Widget_Action)
2014-03-20 00:44:34 -07:00
{
eo_prefix: elm_obj_calendar;
2015-05-07 09:32:53 -07:00
methods {
@property first_day_of_week {
2014-03-20 00:44:34 -07:00
set {
[[Set the first day of week to use on calendar widgets'.]]
2014-03-20 00:44:34 -07:00
}
get {
[[Get the first day of week, who are used on calendar widgets'.
2014-03-20 00:44:34 -07:00
See also @.first_day_of_week.set for more details.
2014-03-20 00:44:34 -07:00
]]
2014-03-20 00:44:34 -07:00
}
values {
day: Elm.Calendar.Weekday; [[An int which correspond to the first day of the week (Sunday = 0, Monday = 1,
..., Saturday = 6).]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property selectable {
2014-03-20 00:44:34 -07:00
set {
[[Define which fields of a tm struct will be taken into account, when
Elm.Calendar.selected_time.set is invoked.
By Default the bitmask is set to use all fields of a tm struct (year,
month and day of the month).
2014-03-20 00:44:34 -07:00
See also @.selected_time_set.
@since 1.8
]]
2014-03-20 00:44:34 -07:00
}
get {
[[Get how elm_calendar_selected_time_set manage a date
2014-03-20 00:44:34 -07:00
See also @.selectable.set,
@.selected_time_set.
2014-03-20 00:44:34 -07:00
@since 1.8
]]
2014-03-20 00:44:34 -07:00
}
values {
selectable: Elm.Calendar.Selectable; [[A bitmask of Elm_Calendar_Selectable]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property interval {
2014-03-20 00:44:34 -07:00
set {
[[Set the interval on time updates for an user mouse button hold
on calendar widgets' month/year selection.
2014-03-20 00:44:34 -07:00
This interval value is decreased while the user holds the
mouse pointer either selecting next or previous month/year.
2014-03-20 00:44:34 -07:00
This helps the user to get to a given month distant from the
current one easier/faster, as it will start to change quicker and
quicker on mouse button holds.
2014-03-20 00:44:34 -07:00
The calculation for the next change interval value, starting from
the one set with this call, is the previous interval divided by
1.05, so it decreases a little bit.
2014-03-20 00:44:34 -07:00
The default starting interval value for automatic changes is
0.85 seconds.
2014-03-20 00:44:34 -07:00
See also @.interval.get.
]]
2014-03-20 00:44:34 -07:00
}
get {
[[Get the interval on time updates for an user mouse button hold
on calendar widgets' month/year selection.
2014-03-20 00:44:34 -07:00
See also @.interval.set for more details.
]]
2014-03-20 00:44:34 -07:00
}
values {
interval: double; [[The (first) interval value in seconds]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property weekdays_names {
2014-03-20 00:44:34 -07:00
set {
[[Set weekdays names to be displayed by the calendar.
By default, weekdays abbreviations get from system are displayed:
E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat"
The first string should be related to Sunday, the second to Monday...
See also @.weekdays_names.get.
\@ref calendar_example_02.
]]
/* FIXME-doc
*
* The usage should be like this:
* @code
* const char *weekdays[] =
* {
* "Sunday", "Monday", "Tuesday", "Wednesday",
* "Thursday", "Friday", "Saturday"
* };
* elm_calendar_weekdays_names_set(calendar, weekdays);
* @endcode
*/
2014-03-20 00:44:34 -07:00
}
get {
[[Get weekdays names displayed by the calendar.
2014-03-20 00:44:34 -07:00
By default, weekdays abbreviations get from system are displayed:
E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat"
The first string is related to Sunday, the second to Monday...
2014-03-20 00:44:34 -07:00
See also @.weekdays_names.set.
2014-03-20 00:44:34 -07:00
\@ref calendar_example_05.
]]
2014-03-20 00:44:34 -07:00
}
values {
weekdays: const(char)**; [[Array of seven strings to be used as weekday names.
Warning: It must have 7 elements, or it will access invalid memory.
Warning: The strings must be $null terminated ('@\0').]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property select_mode {
2014-03-20 00:44:34 -07:00
set {
[[Set select day mode to use.
2014-03-20 00:44:34 -07:00
Set the day selection mode used.
]]
2014-03-20 00:44:34 -07:00
}
get {
[[Get the select day mode used.
2014-03-20 00:44:34 -07:00
Get the day selection mode used.
2014-03-20 00:44:34 -07:00
See also @.select_mode.set for more details.
2014-03-20 00:44:34 -07:00
]]
2014-03-20 00:44:34 -07:00
}
values {
mode: Elm.Calendar.Select.Mode; [[The select mode to use.]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property min_max_year {
2014-03-20 00:44:34 -07:00
set {
[[Set the minimum and maximum values for the year
2014-03-20 00:44:34 -07:00
Maximum must be greater than minimum, except if you don't want to set
maximum year.
Default values are 1902 and -1.
2014-03-20 00:44:34 -07:00
If the maximum year is a negative value, it will be limited depending
on the platform architecture (year 2037 for 32 bits);
2014-03-20 00:44:34 -07:00
See also @.min_max_year.get.
2014-03-20 00:44:34 -07:00
\@ref calendar_example_03.
]]
2014-03-20 00:44:34 -07:00
}
get {
[[Get the minimum and maximum values for the year
2014-03-20 00:44:34 -07:00
Default values are 1902 and -1.
2014-03-20 00:44:34 -07:00
See also @.min_max_year.set for more details.
2014-03-20 00:44:34 -07:00
\@ref calendar_example_05.
]]
2014-03-20 00:44:34 -07:00
}
values {
min: int; [[The minimum year, greater than 1901;]]
max: int; [[The maximum year;]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property format_function {
2014-03-20 00:44:34 -07:00
set {
[[Set a function to format the string that will be used to display
month and year;
By default it uses strftime with "%B %Y" format string.
It should allocate the memory that will be used by the string,
that will be freed by the widget after usage.
A pointer to the string and a pointer to the time struct will be provided.
\@ref calendar_example_02.
]]
/* FIXME-doc
* Example:
* @code
* static char
* _format_month_year(struct tm *selected_time)
* {
* char buf[32];
* if (!strftime(buf, sizeof(buf), "%B %Y", selected_time)) return NULL;
* return strdup(buf);
* }
*
* elm_calendar_format_function_set(calendar, _format_month_year);
* @endcode
*/
2014-03-20 00:44:34 -07:00
}
values {
format_function: Elm_Calendar_Format_Cb; [[Function to set the month-year string given
the selected date.]]
2014-03-20 00:44:34 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property marks {
2014-03-20 00:44:34 -07:00
get {
[[Get a list of all the calendar marks.
2014-03-20 00:44:34 -07:00
See also @.mark_add,
\@ref elm_calendar_mark_del(),
@.marks_clear.
2014-03-20 00:44:34 -07:00
]]
return: const(list<Elm.Calendar.Mark*>)*;
2014-03-20 00:44:34 -07:00
}
}
selected_time_set {
[[Set selected date to be highlighted on calendar.
2014-03-20 00:44:34 -07:00
Set the selected date, changing the displayed month if needed.
Selected date changes when the user goes to next/previous month or
select a day pressing over it on calendar.
2014-03-20 00:44:34 -07:00
See also @.selected_time_get.
2014-03-20 00:44:34 -07:00
\@ref calendar_example_04
]]
2014-03-20 00:44:34 -07:00
params {
@in selected_time: Elm_Calendar_Time *; [[A tm struct to represent the selected date.]]
2014-03-20 00:44:34 -07:00
}
}
2014-07-22 09:13:52 -07:00
selected_time_get @const {
[[Get selected date.
2014-03-20 00:44:34 -07:00
Get date selected by the user or set by function
@.selected_time_set().
Selected date changes when the user goes to next/previous month or
select a day pressing over it on calendar.
2014-03-20 00:44:34 -07:00
See also @.selected_time_get.
2014-03-20 00:44:34 -07:00
\@ref calendar_example_05.
]]
return: bool;
2014-03-20 00:44:34 -07:00
params {
@inout selected_time: Elm_Calendar_Time; [[A tm struct to point to selected date.]]
2014-03-20 00:44:34 -07:00
}
}
mark_add {
[[Add a new mark to the calendar
Add a mark that will be drawn in the calendar respecting the insertion
time and periodicity. It will emit the type as signal to the widget theme.
Default theme supports "holiday" and "checked", but it can be extended.
It won't immediately update the calendar, drawing the marks.
For this, @.marks_draw(). However, when user selects
next or previous month calendar forces marks drawn.
Marks created with this method can be deleted with
\@ref elm_calendar_mark_del().
See also @.marks_draw,
\@ref elm_calendar_mark_del().
\@ref calendar_example_06
]]
/* FIXME-doc
* Example
* @code
* struct tm selected_time;
* time_t current_time;
*
* current_time = time(NULL) + 5 * (24 * 60 * 60);
* localtime_r(&current_time, &selected_time);
* elm_calendar_mark_add(cal, "holiday", selected_time,
* ELM_CALENDAR_ANNUALLY);
* current_time = time(NULL) + 1 * (24 * 60 * 60);
* localtime_r(&current_time, &selected_time);
* elm_calendar_mark_add(cal, "checked", selected_time, ELM_CALENDAR_UNIQUE);
* elm_calendar_marks_draw(cal);
* @endcode
*/
return: Elm_Calendar_Mark *;
2014-03-20 00:44:34 -07:00
params {
@in mark_type: const(char)*; [[A string used to define the type of mark. It will be
2014-03-20 00:44:34 -07:00
emitted to the theme, that should display a related modification on these
days representation.]]
@in mark_time: Elm_Calendar_Time *; [[A time struct to represent the date of inclusion of the
2014-03-20 00:44:34 -07:00
mark. For marks that repeats it will just be displayed after the inclusion
date in the calendar.]]
@in repeat: Elm.Calendar.Mark.Repeat.Type; [[Repeat the event following this periodicity. Can be a unique
mark (that don't repeat), daily, weekly, monthly or annually.]]
2014-03-20 00:44:34 -07:00
}
}
marks_clear {
[[Remove all calendar's marks
2014-03-20 00:44:34 -07:00
See also @.mark_add,
\@ref elm_calendar_mark_del().
2014-03-20 00:44:34 -07:00
]]
2014-03-20 00:44:34 -07:00
}
marks_draw {
[[Draw calendar marks.
2014-03-20 00:44:34 -07:00
Should be used after adding, removing or clearing marks.
It will go through the entire marks list updating the calendar.
If lots of marks will be added, add all the marks and then call
this function.
2014-03-20 00:44:34 -07:00
When the month is changed, i.e. user selects next or previous month,
marks will be drawn.
2014-03-20 00:44:34 -07:00
See also @.mark_add,
\@ref elm_calendar_mark_del(),
@.marks_clear.
2014-03-20 00:44:34 -07:00
\@ref calendar_example_06
]]
2014-03-20 00:44:34 -07:00
}
2014-07-22 09:13:52 -07:00
displayed_time_get @const {
[[Get the current time displayed in the widget
2014-03-20 00:44:34 -07:00
@since 1.8
]]
return: bool;
2014-03-20 00:44:34 -07:00
params {
@inout displayed_time: Elm_Calendar_Time; [[A tm struct to point to displayed date.]]
2014-03-20 00:44:34 -07:00
}
}
}
implements {
class.constructor;
Eo.Base.constructor;
Evas.Object_Smart.calculate;
Evas.Object_Smart.add;
Evas.Object_Smart.del;
Elm.Widget.theme_apply;
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
Elm.Widget.focus_next;
Elm.Widget.event;
Elm.Layout.sizing_eval;
Elm_Interface_Atspi_Widget_Action.elm_actions.get;
2014-03-20 00:44:34 -07:00
}
events {
changed;
display,changed;
}
}