2012-07-31 15:06:52 -07:00
|
|
|
#ifndef ELM_WIDGET_CALENDAR_H
|
|
|
|
#define ELM_WIDGET_CALENDAR_H
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-07-31 15:06:52 -07:00
|
|
|
|
2014-08-07 09:26:47 -07:00
|
|
|
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
|
|
|
|
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
|
|
|
|
* FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
|
|
|
|
* IT AT RUNTIME.
|
|
|
|
*/
|
|
|
|
|
2012-07-31 15:06:52 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-calendar-class The Elementary Calendar Class
|
|
|
|
*
|
|
|
|
* Elementary, besides having the @ref Calendar widget, exposes its
|
|
|
|
* foundation -- the Elementary Calendar Class -- in order to create other
|
|
|
|
* widgets which are a calendar with some more logic on top.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base layout smart data extended with calendar instance data.
|
|
|
|
*/
|
2014-03-20 00:44:34 -07:00
|
|
|
typedef struct _Elm_Calendar_Data Elm_Calendar_Data;
|
2012-07-31 15:06:52 -07:00
|
|
|
|
|
|
|
typedef enum _Day_Color // EINA_DEPRECATED
|
|
|
|
{
|
|
|
|
DAY_WEEKDAY = 0,
|
|
|
|
DAY_SATURDAY = 1,
|
|
|
|
DAY_SUNDAY = 2
|
|
|
|
} Day_Color;
|
|
|
|
|
2014-03-20 00:44:34 -07:00
|
|
|
struct _Elm_Calendar_Data
|
2012-07-31 15:06:52 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj; // the object itself
|
2012-07-31 15:06:52 -07:00
|
|
|
Eina_List *marks;
|
|
|
|
double interval, first_interval;
|
2016-11-17 16:39:42 -08:00
|
|
|
int spin_speed;
|
2017-06-05 13:42:08 -07:00
|
|
|
int today_it, selected_it, focused_it;
|
Efl.Ui.Calendar, elm_calendar: Code fixed to support auto repeat feature.
Summary:
1. Why there is a edje signal callback in elm_calendar? and do we need to maintain?
We used edje part like a button before (3 years ago?), So there is a callbacks to get edje signal.
Im pretty sure it is not use anymore. but we need to maintain backward compatibility.
2. elm_calendar using using repeat feature in efl_ui_button for it. why did i change it to manual timer?
We opend elm_calendar_interval_set() APIs. Support this API the manual timer is proper then using button's feature.
3. why scroll freeze? and why only elm_calendar does it?
When the user long press calendar button area and then move the scroll will be activated. it can prevent that weird action.
efl_ui_calendar using button's feature. i not sure scroll freeze is deserve to attached in button side as a feature or not.
So i will consider more for this case.
4. Why efl_ui_calendar doesn't have year buttons (double spinner case)
After interface work, we don't accept style change in the runtime. so that featrue will be supported as API.
The year_button_set/get() property should be added. but i dont know is it really needed...
If the app developer want use year inc/dec button for efl_ui_calendar. they can inherit the class and make it easily.
Test Plan:
View, Action, API test in the elementary-test sample App.
Ps. The issue of the calendar2 crash when it closed. It's not relative with this commit. its focus. i will look around.
Reviewers: Hermet, zmike, ManMower, segfaultxavi, devilhorns
Reviewed By: Hermet
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6626
2018-07-22 23:49:10 -07:00
|
|
|
Ecore_Timer *update_timer, *spin_timer;
|
2012-07-31 15:06:52 -07:00
|
|
|
Elm_Calendar_Format_Cb format_func;
|
|
|
|
const char *weekdays[ELM_DAY_LAST];
|
2016-11-17 16:39:42 -08:00
|
|
|
struct tm current_time, selected_time, shown_time, date_min, date_max;
|
2012-07-31 15:06:52 -07:00
|
|
|
Day_Color day_color[42]; // EINA_DEPRECATED
|
2015-12-22 01:48:16 -08:00
|
|
|
Evas_Object *inc_btn_month;
|
|
|
|
Evas_Object *dec_btn_month;
|
2012-09-12 01:25:10 -07:00
|
|
|
Evas_Object *month_access;
|
2015-12-22 01:48:16 -08:00
|
|
|
Evas_Object *inc_btn_year;
|
|
|
|
Evas_Object *dec_btn_year;
|
2013-01-03 12:50:10 -08:00
|
|
|
Evas_Object *year_access;
|
2017-09-29 14:53:23 -07:00
|
|
|
Eo *items[42];
|
2013-10-17 00:31:06 -07:00
|
|
|
|
|
|
|
Elm_Calendar_Weekday first_week_day;
|
|
|
|
Elm_Calendar_Select_Mode select_mode;
|
2012-09-11 14:33:54 -07:00
|
|
|
Elm_Calendar_Selectable selectable;
|
2013-10-17 00:31:06 -07:00
|
|
|
|
2017-06-05 13:42:08 -07:00
|
|
|
unsigned char first_day_it;
|
|
|
|
|
2013-10-17 00:31:06 -07:00
|
|
|
Eina_Bool selected : 1;
|
2013-01-22 08:37:45 -08:00
|
|
|
Eina_Bool double_spinners : 1;
|
2014-02-19 02:25:32 -08:00
|
|
|
Eina_Bool filling : 1;
|
2015-11-09 12:21:09 -08:00
|
|
|
Eina_Bool weekdays_set : 1;
|
Efl.Ui.Calendar, elm_calendar: Code fixed to support auto repeat feature.
Summary:
1. Why there is a edje signal callback in elm_calendar? and do we need to maintain?
We used edje part like a button before (3 years ago?), So there is a callbacks to get edje signal.
Im pretty sure it is not use anymore. but we need to maintain backward compatibility.
2. elm_calendar using using repeat feature in efl_ui_button for it. why did i change it to manual timer?
We opend elm_calendar_interval_set() APIs. Support this API the manual timer is proper then using button's feature.
3. why scroll freeze? and why only elm_calendar does it?
When the user long press calendar button area and then move the scroll will be activated. it can prevent that weird action.
efl_ui_calendar using button's feature. i not sure scroll freeze is deserve to attached in button side as a feature or not.
So i will consider more for this case.
4. Why efl_ui_calendar doesn't have year buttons (double spinner case)
After interface work, we don't accept style change in the runtime. so that featrue will be supported as API.
The year_button_set/get() property should be added. but i dont know is it really needed...
If the app developer want use year inc/dec button for efl_ui_calendar. they can inherit the class and make it easily.
Test Plan:
View, Action, API test in the elementary-test sample App.
Ps. The issue of the calendar2 crash when it closed. It's not relative with this commit. its focus. i will look around.
Reviewers: Hermet, zmike, ManMower, segfaultxavi, devilhorns
Reviewed By: Hermet
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6626
2018-07-22 23:49:10 -07:00
|
|
|
Eina_Bool month_btn_clicked : 1;
|
2012-07-31 15:06:52 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Elm_Calendar_Mark
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
Eina_List *node;
|
|
|
|
struct tm mark_time;
|
|
|
|
const char *mark_type;
|
|
|
|
Elm_Calendar_Mark_Repeat_Type repeat;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ELM_CALENDAR_DATA_GET(o, sd) \
|
2016-08-15 06:44:41 -07:00
|
|
|
Elm_Calendar_Data * sd = efl_data_scope_get(o, ELM_CALENDAR_CLASS)
|
2012-07-31 15:06:52 -07:00
|
|
|
|
2014-01-15 10:33:40 -08:00
|
|
|
#define ELM_CALENDAR_CHECK(obj) \
|
2016-08-15 06:44:41 -07:00
|
|
|
if (EINA_UNLIKELY(!efl_isa((obj), ELM_CALENDAR_CLASS))) \
|
2012-07-31 15:06:52 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|