2017-10-25 00:42:39 -07:00
|
|
|
#ifndef EFL_UI_CALENDAR_PRIVATE_H
|
2017-11-22 00:14:07 -08:00
|
|
|
#define EFL_UI_CALENDAR_PRIVATE_H
|
2017-10-25 00:42:39 -07:00
|
|
|
|
|
|
|
#include "Elementary.h"
|
|
|
|
|
|
|
|
/* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
|
|
|
typedef struct _Efl_Ui_Calendar_Data Efl_Ui_Calendar_Data;
|
|
|
|
|
|
|
|
struct _Efl_Ui_Calendar_Data
|
|
|
|
{
|
|
|
|
Evas_Object *obj; // the object itself
|
|
|
|
double interval, first_interval;
|
|
|
|
int spin_speed;
|
|
|
|
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;
|
2017-10-25 00:42:39 -07:00
|
|
|
const char *weekdays[ELM_DAY_LAST];
|
|
|
|
struct tm current_date, shown_date, date, date_min, date_max;
|
|
|
|
Evas_Object *inc_btn_month;
|
|
|
|
Evas_Object *dec_btn_month;
|
|
|
|
Evas_Object *month_access;
|
|
|
|
Eo *items[42];
|
|
|
|
|
Efl.Ui.Format revamp
This class helps widgets which contain a numerical value and must display it,
like Progressbar (units label), Spin, Spin_Button, Slider (both units and popup
labels, in legacy), Tags (when in shrunk mode) or Calendar (year_month label).
Previously this was a mix of interface and mixin: widgets had to support setting a
formatting func, and the mixin offered support for formatting strings, by setting
an internal formatting func. On top of that, the spinner widget supported "special
values", a list of values that should be shown as certain strings instead.
This has now been simplified and unified:
Widgets including this mixin can use the formatted_value_get() method which accepts
an Eina_Value and returns a string. Thats's it.
The mixin adds three properties to the widget (format_values, format_func and
format_string) which users can use to tailor formatting. The widget does not need
to know which method has been used, it just retrieves the resulting string.
This removes a lot of duplicated widget code, and adds functionality which was
missing before. For example, all widgets support passing a list of values now.
Widgets must implement the apply_formatted_value() method so they are notified
of changes in the format and they can redraw anything they need.
Tests have been added to the Elementary Spec suite for all cases.
Legacy widgets behavior has not been modified, although a few needed some code
changes.
2019-07-02 05:40:06 -07:00
|
|
|
Efl_Ui_Calendar_Weekday first_week_day;
|
2017-10-25 00:42:39 -07:00
|
|
|
unsigned char first_day_it;
|
|
|
|
|
|
|
|
Eina_Bool selected : 1;
|
|
|
|
Eina_Bool filling : 1;
|
|
|
|
Eina_Bool weekdays_set : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define EFL_UI_CALENDAR_DATA_GET(o, sd) \
|
|
|
|
Efl_Ui_Calendar_Data * sd = efl_data_scope_get(o, EFL_UI_CALENDAR_CLASS)
|
|
|
|
|
|
|
|
#endif
|