3 * Copyright 2012 Samsung Electronics Co., Ltd
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
9 * http://www.tizenopensource.org/license
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.
19 #ifndef __CALENDAR_TIMEBLOCK_H__
20 #define __CALENDAR_TIMEBLOCK_H__
24 #define TIMEBLOCK_INDEX 24
25 #define EVENTBLOCK_INDEX 48
27 enum timeblock_event_type {
33 struct timeblock_slice {
47 struct eventblock_slice {
49 const Evas_Object *base;
50 Eina_List *list; // evt list
56 struct timeblock_event {
64 Evas_Coord initial_coord_x;
65 Evas_Coord initial_coord_y;
66 Evas_Coord mouse_down_y;
71 struct eventblock_overlap
79 Evas_Object *parent; //scroller
82 struct timeblock_slice tbs[TIMEBLOCK_INDEX];
88 Evas_Coord normal_height;
89 Evas_Coord expand_height;
91 struct eventblock_slice ebs[EVENTBLOCK_INDEX];
97 void (*cb)(void *data, struct timeblock *tb, enum timeblock_event_type e, void *event_info);
101 Eina_List *more_ev_list;
103 Ecore_Timer* long_press_timer;
104 struct timeblock_event *long_pressed_event;
105 Eina_Bool is_block_update;
113 struct timeblock* cal_time_block_create_time_block(Evas_Object *p, Evas_Object *clip, struct appdata *ad);
114 void cal_time_block_delete_time_block(struct timeblock **tb);
116 void cal_time_block_move(struct timeblock *tb, Evas_Coord x, Evas_Coord y);
117 void cal_time_block_resize(struct timeblock *tb, Evas_Coord y, Evas_Coord h);
118 void cal_time_block_get_geometry(struct timeblock *tb, Evas_Coord_Rectangle *r);
119 Evas_Coord cal_time_block_get_first_event_y(struct timeblock *tb);
121 void cal_time_block_add_event(struct timeblock *tb, int cid, int hh, int sz, const char *text, cal_struct *cs);
122 void cal_time_block_set_event_lock(struct timeblock *tb, Eina_Bool lock);
123 void cal_time_block_clear_event(struct timeblock *tb);
125 Evas_Coord cal_time_block_get_min();
126 Evas_Coord cal_time_block_get_max(struct timeblock *tb);
127 Evas_Coord cal_time_block_get_expand_max(struct timeblock *tb);
128 Evas_Coord cal_time_block_get_current(struct timeblock *tb);
130 void cal_time_block_set_callback(struct timeblock *tb, void (*cb)(void *data, struct timeblock *tb, enum timeblock_event_type e, void *event_info), void *data);
131 void cal_time_block_unset_callback(struct timeblock *tb);
133 void cal_time_block_show_current_time_line(struct timeblock *tb, int hour);
134 void cal_time_block_hide_current_time_line(struct timeblock *tb);
136 int cal_time_block_get_default_current_height(void);
138 #endif /* __CALENDAR_TIMEBLOCK_H__ */