Tizen 2.1 base
[apps/core/preloaded/calendar.git] / src / base-time-block.h
1 /*\r
2   *\r
3   *  Copyright 2012  Samsung Electronics Co., Ltd\r
4   *\r
5   *  Licensed under the Flora License, Version 1.0 (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_TIME_BLOCK_H__\r
19 #define __CALENDAR_BASE_TIME_BLOCK_H__\r
20 #include <Ecore_X.h>\r
21 \r
22 #include "cld.h"\r
23 #include "base-block.h"\r
24 \r
25 #define TIME_BLOCK_SLICE_COUNT 24\r
26 #define TIME_BLOCK_DAY_HOURS 12\r
27 #define TIME_BLOCK_TEXT_HEIGHT 30\r
28 #define TIME_BLOCK_EXPAND_HEIGHT 520\r
29 #define TIME_BLOCK_CONTENT_HEIGHT 16\r
30 #define TIME_BLOCK_CONTRACT_HEIGHT 60\r
31 #define TIME_BLOCK_NORMAL_HEIGHT 158\r
32 #define TIME_BLOCK_MIN_HEIGHT 16\r
33 \r
34 typedef void *cal_base_time_block_h;\r
35 typedef void *cal_base_time_block_slice_h;\r
36 \r
37 typedef cal_base_time_block_h(* cal_base_time_block_new_func_ptr)(void *data);\r
38 typedef void(* cal_base_time_block_delete_func_ptr)(cal_base_time_block_h base_time_block);\r
39 typedef void(* cal_base_time_block_update_func_ptr)(cal_base_time_block_h base_time_block);\r
40 \r
41 typedef struct {\r
42         cal_base_time_block_new_func_ptr new_func_ptr;\r
43         cal_base_time_block_delete_func_ptr delete_func_ptr;\r
44         cal_base_time_block_update_func_ptr update_func_ptr;\r
45 } cal_base_time_block_operations;\r
46 \r
47 typedef struct {\r
48         int line_index;\r
49         Evas_Object *ly;\r
50         Evas_Coord x;\r
51         Evas_Coord y;\r
52         Evas_Coord height;\r
53         Eina_Bool hide_text;\r
54         int slice_block_count;\r
55         Eina_Bool is_contracted;\r
56 } cal_base_time_block_slice;\r
57 \r
58 typedef struct cal_base_time_block{\r
59         const char *name;\r
60 \r
61         cal_base_block_h base_block;\r
62 \r
63         Evas_Object *parent;\r
64 \r
65         Evas_Object *clip;\r
66 \r
67         cal_base_time_block_slice time_block_slice_array[TIME_BLOCK_SLICE_COUNT];\r
68 \r
69         Evas_Object *event_block_slice_object_array[EVENT_SLICE_COUNT];\r
70 \r
71         Evas_Coord normal_height;\r
72 \r
73         Evas_Coord width;\r
74         Evas_Coord height;\r
75         Evas_Coord x;\r
76         Evas_Coord y;\r
77 \r
78         int current_hour;\r
79 \r
80         cal_base_time_block_operations base_operations;\r
81 } cal_base_time_block_s;\r
82 \r
83 cal_base_time_block_h cal_base_time_block_new(cal_base_type type, Evas_Object *parent, Evas_Object *clip, Evas_Object *clip_block, int current_hour, void *data);\r
84 cal_base_time_block_h cal_base_time_block_create(cal_base_time_block_operations *base_operations, void *data);\r
85 void cal_base_time_block_update(cal_base_time_block_h base_time_block);\r
86 void cal_base_time_block_delete(cal_base_time_block_h base_time_block);\r
87 void cal_base_time_block_move(cal_base_time_block_h base_time_block, Evas_Coord x, Evas_Coord y);\r
88 void cal_base_time_block_resize_time_block_slices(cal_base_time_block_h base_time_block);\r
89 void cal_base_time_block_move_event_blocks(cal_base_time_block_h base_time_block);\r
90 void cal_base_time_block_figure_time_block_slice_block_count(cal_base_time_block_h base_time_block);\r
91 void cal_base_time_block_clear_time_block_slice_block_count(cal_base_time_block_h base_time_block);\r
92 void cal_base_time_block_get_geometry(cal_base_time_block_h base_time_block, Evas_Coord_Rectangle *r);\r
93 void cal_base_time_block_move_to_time_line(cal_base_time_block_h base_time_block);\r
94 int cal_base_time_block_get_time_block_slice_index_by_coord_point(cal_base_time_block_h base_time_block, Evas_Coord_Point *mouse_down_coord);\r
95 void    cal_base_time_block_show(cal_base_time_block_h base_time_block);\r
96 void    cal_base_time_block_hide(cal_base_time_block_h base_time_block);\r
97 #endif\r