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
|
|
|
|
|
|
|
/**
|
|
|
|
* @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 _Elm_Calendar_Smart_Data Elm_Calendar_Smart_Data;
|
|
|
|
|
|
|
|
typedef enum _Day_Color // EINA_DEPRECATED
|
|
|
|
{
|
|
|
|
DAY_WEEKDAY = 0,
|
|
|
|
DAY_SATURDAY = 1,
|
|
|
|
DAY_SUNDAY = 2
|
|
|
|
} Day_Color;
|
|
|
|
|
|
|
|
struct _Elm_Calendar_Smart_Data
|
|
|
|
{
|
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;
|
|
|
|
int year_min, year_max, spin_speed;
|
|
|
|
int today_it, selected_it, first_day_it;
|
|
|
|
Elm_Calendar_Weekday first_week_day;
|
2013-01-03 12:50:10 -08:00
|
|
|
Ecore_Timer *spin_month, *spin_year, *update_timer;
|
2012-07-31 15:06:52 -07:00
|
|
|
Elm_Calendar_Format_Cb format_func;
|
|
|
|
const char *weekdays[ELM_DAY_LAST];
|
|
|
|
struct tm current_time, selected_time, shown_time;
|
|
|
|
Day_Color day_color[42]; // EINA_DEPRECATED
|
|
|
|
Elm_Calendar_Select_Mode select_mode;
|
2013-01-03 12:50:10 -08:00
|
|
|
Evas_Object *inc_btn_month_access;
|
|
|
|
Evas_Object *dec_btn_month_access;
|
2012-09-12 01:25:10 -07:00
|
|
|
Evas_Object *month_access;
|
2013-01-03 12:50:10 -08:00
|
|
|
Evas_Object *inc_btn_year_access;
|
|
|
|
Evas_Object *dec_btn_year_access;
|
|
|
|
Evas_Object *year_access;
|
2012-07-31 15:06:52 -07:00
|
|
|
Eina_Bool selected : 1;
|
2012-09-11 14:33:54 -07:00
|
|
|
Elm_Calendar_Selectable selectable;
|
2013-01-22 08:37:45 -08:00
|
|
|
Eina_Bool double_spinners : 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) \
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Calendar_Smart_Data * sd = eo_data_get(o, ELM_OBJ_CALENDAR_CLASS)
|
2012-07-31 15:06:52 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#define ELM_CALENDAR_CHECK(obj) \
|
|
|
|
if (!eo_isa((obj), ELM_OBJ_CALENDAR_CLASS)) \
|
2012-07-31 15:06:52 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|