[misc] Sycn with master branch.
[apps/core/preloaded/calendar.git] / src / base-block.h
1 /*\r
2   *\r
3   *  Copyright 2012  Samsung Electronics Co., Ltd\r
4   *\r
5   *  Licensed under the Flora License, Version 1.1 (the "License");\r
6   *  you may not use this file except in compliance with the License.\r
7   *  You may obtain a copy of the License at\r
8   *\r
9   *       http://floralicense.org/license/\r
10   *\r
11   *  Unless required by applicable law or agreed to in writing, software\r
12   *  distributed under the License is distributed on an "AS IS" BASIS,\r
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14   *  See the License for the specific language governing permissions and\r
15   *  limitations under the License.\r
16   */\r
17 \r
18 #ifndef __CALENDAR_BASE_BLOCK_H__\r
19 #define __CALENDAR_BASE_BLOCK_H__\r
20 #include "cld.h"\r
21 #include "base-data.h"\r
22 \r
23 typedef void* cal_base_block_h;\r
24 typedef void* cal_base_block_item_h;\r
25 \r
26 typedef Eina_Bool(* cal_base_block_foreach_item)(cal_base_block_item_h event_block, int line_index, int height, void *user_data);\r
27 typedef void(* cal_base_block_moving_item_cb)(void *user_data, Evas_Coord time_block_y);\r
28 typedef Eina_Bool(* cal_base_block_query_item_cb)(cal_base_block_item_h event_block, int line_index, int height, void *user_data);\r
29 \r
30 typedef cal_base_block_h(* cal_base_block_new_func_ptr)();\r
31 typedef void(* cal_base_block_delete_func_ptr)(cal_base_block_h base_block);\r
32 typedef cal_base_block_item_h(* cal_base_block_new_item_func_ptr)();\r
33 typedef void(* cal_base_block_delete_item_func_ptr)(cal_base_block_item_h base_item);\r
34 typedef Evas_Object *(* cal_base_block_create_item_layout_func_ptr)(cal_base_block_h base_block, cal_base_data_item_h item_data);\r
35 typedef void (*cal_base_block_move_item_layout_func_ptr)(cal_base_block_h base_block, cal_base_block_item_h block_item, Evas_Coord_Rectangle *base);\r
36 typedef void (*cal_base_block_update_func_ptr)(cal_base_block_h base_block);\r
37 typedef struct {\r
38         cal_base_block_new_func_ptr new_func_ptr;\r
39         cal_base_block_delete_func_ptr delete_func_ptr;\r
40         cal_base_block_new_item_func_ptr new_item_func_ptr;\r
41         cal_base_block_delete_item_func_ptr delete_item_func_ptr;\r
42         cal_base_block_create_item_layout_func_ptr create_item_layout_func_ptr;\r
43         cal_base_block_move_item_layout_func_ptr move_item_layout_func_ptr;\r
44         cal_base_block_update_func_ptr update_func_ptr;\r
45 } cal_base_block_operations;\r
46 \r
47 typedef struct {\r
48         cal_base_data_item_h item_data;\r
49 \r
50         Evas_Object *ly;\r
51 } cal_base_block_item;\r
52 \r
53 \r
54 typedef struct {\r
55         const char *name;\r
56 \r
57         cal_base_data_h base_data;\r
58 \r
59         Eina_List *base_block_list;\r
60 \r
61         Evas_Object *parent;\r
62 \r
63         Evas_Object *clip;\r
64 \r
65         cal_base_block_operations base_operations;\r
66 } cal_base_block_s;\r
67 \r
68 cal_base_block_h cal_base_block_new(cal_base_type type, Evas_Object *parent, Evas_Object *clip, void *data);\r
69 void cal_base_block_delete(cal_base_block_h base_block);\r
70 cal_base_block_h cal_base_block_create(cal_base_block_operations *base_operations);\r
71 void cal_base_block_create_block_list(cal_base_block_h base_block);\r
72 void cal_base_block_destroy_block_list(cal_base_block_h base_block);\r
73 void cal_base_block_move_item(cal_base_block_h base_block, cal_base_block_item_h block_item, Evas_Coord_Rectangle *base);\r
74 void cal_base_block_update(cal_base_block_h base_block);\r
75 void    cal_base_block_show(cal_base_block_h base_block);\r
76 void    cal_base_block_hide(cal_base_block_h base_block);\r
77 int  cal_base_block_foreach_items(cal_base_block_query_item_cb callback, cal_base_block_h base_block, void *usr_data);\r
78 #endif\r
79 \r