b970f2efc00ddaf1ab1dec6d17affa0e4905f2cd
[apps/core/preloaded/calendar.git] / src / month-data.h
1 /*
2   *
3   *  Copyright 2012  Samsung Electronics Co., Ltd
4   *
5   *  Licensed under the Flora License, Version 1.0 (the "License");
6   *  you may not use this file except in compliance with the License.
7   *  You may obtain a copy of the License at
8   *
9   *       http://floralicense.org/license/
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17
18 #ifndef __MONTH_DATA_H__
19 #define __MONTH_DATA_H__
20
21 #include "cld.h"
22
23 #define WEEKS_OF_MONTH 6
24 #define DAYS_OF_WEEK 7
25 #define DAYS_OF_WEEKLY_MONTHS_VIEW 42
26 #define LINES_OF_WEEKLY_MONTHS_EVENT 3
27 #define LINES_OF_WEEKLY_MONTHS_EVENT_LANDSCAPE 1
28
29 #define CAL_MONTH_MAX_ROWS_PER_CELL 3
30
31 typedef struct {
32         int calendar_id;
33         int width;
34         char* title;
35         int prev_row;
36         int next_row;
37 } cal_month_calendar_event;
38
39 typedef void* cal_month_data_h;
40
41 cal_month_data_h cal_month_data_create(struct appdata *ad, int rows_per_cell);
42
43 int cal_month_data_load(cal_month_data_h month_data);
44
45 int cal_month_data_get_event_count(cal_month_data_h month_data, int week, int wday);
46
47 cal_month_calendar_event* cal_month_data_get_event(cal_month_data_h month_data, int mweek, int wday, int row);
48
49 void cal_month_data_clear(cal_month_data_h month_data);
50
51 int cal_month_data_get_day_time_by_pos(struct appdata *ad,
52                         int pos_today, int pos_selected, int pos_start, int pos_end,
53                         int *first_day, int *last_day, struct tm *start_time, struct tm *end_time, int day_pos);
54
55 void cal_month_data_destroy(cal_month_data_h month_data);
56
57 #endif