3 * Copyright 2012 Samsung Electronics Co., Ltd
\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
9 * http://floralicense.org/license/
\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
18 #ifndef __CALENDAR_BASE_TIME_H__
\r
19 #define __CALENDAR_BASE_TIME_H__
\r
21 #include "base-time-block.h"
\r
23 #define ENABLE_MOUSE_DOWN_FLAG (1)
\r
24 #define ENABLE_MOUSE_UP_FLAG (ENABLE_MOUSE_DOWN_FLAG<<1)
\r
25 #define ENABLE_MOUSE_MOVE_FLAG (ENABLE_MOUSE_UP_FLAG<<1)
\r
26 #define ENABLE_MOUSE_OUT_FLAG (ENABLE_MOUSE_MOVE_FLAG<<1)
\r
27 #define ENABLE_MULTI_DOWN_FLAG (ENABLE_MOUSE_OUT_FLAG<<1)
\r
28 #define ENABLE_MULTI_UP_FLAG (ENABLE_MULTI_DOWN_FLAG<<1)
\r
29 #define ENABLE_MULTI_MOVE_FLAG (ENABLE_MULTI_UP_FLAG<<1)
\r
30 #define ENABLE_GRAG_START_FLAG (ENABLE_MULTI_MOVE_FLAG<<1)
\r
32 enum cal_base_time_state_action_type {
\r
40 STATE_ENABLE_SCROLL,
\r
42 STATE_DISABLE_SCROLL,
\r
45 STATE_DISABLE_FLICK,
\r
47 STATE_ENABLE_MOVEING_EVENT,
\r
48 STATE_DISABLE_MOVEING_EVENT,
\r
56 enum cal_base_time_input_signal_type {
\r
63 SCROLLER_DRAG_START,
\r
65 SCROLLER_ANIMATION_START,
\r
66 SCROLLER_ANIMATION_STOP,
\r
70 typedef void *cal_base_time_h;
\r
72 typedef cal_base_time_h(* cal_base_time_new_func_ptr)(void *data);
\r
73 typedef void(* cal_base_time_delete_func_ptr)(cal_base_time_h base_time);
\r
74 typedef void(* cal_base_time_update_func_ptr)(cal_base_time_h base_time);
\r
75 typedef void (*cal_base_time_state_transition_func_ptr)(cal_base_time_h base_time, enum cal_base_time_input_signal_type input);
\r
76 typedef void(*cal_base_time_state_actions_func_ptr)(cal_base_time_h base_time);
\r
77 typedef void(*cal_base_time_init_func_ptr)(cal_base_time_h base_time);
\r
79 cal_base_time_new_func_ptr new_func_ptr;
\r
80 cal_base_time_delete_func_ptr delete_func_ptr;
\r
81 cal_base_time_init_func_ptr init_func_ptr;
\r
82 cal_base_time_state_transition_func_ptr state_transition_func_ptr;
\r
83 cal_base_time_state_actions_func_ptr state_actions_func_ptr;
\r
84 cal_base_time_update_func_ptr update_func_ptr;
\r
85 } cal_base_time_operations;
\r
89 Evas_Object *parent;
\r
93 Evas_Object *clip_block;
\r
95 Evas_Object *scroller;
\r
96 Evas_Coord_Rectangle scroller_coord;
\r
99 Evas_Object *event_rectangle;
\r
101 cal_base_time_block_h base_time_block;
\r
102 cal_base_time_block_h left_base_time_block;
\r
103 cal_base_time_block_h right_base_time_block;
\r
105 Eina_Bool is_attached;
\r
106 Eina_Bool scrl_freezed;
\r
108 Evas_Coord_Point single_mouse_down;
\r
109 Evas_Coord_Point single_mouse_move;
\r
110 Evas_Coord_Point multi_mouse_down;
\r
111 Evas_Coord_Point multi_mouse_move;
\r
113 Ecore_Idler *idler_for_scrolling;
\r
117 cal_base_type base_type;
\r
119 enum cal_base_time_state_action_type state_action_type;
\r
121 cal_base_time_operations base_operations;
\r
124 cal_base_time_h cal_base_time_new(cal_base_type type, Evas_Object *parent, int current_hour, Evas_Object **time_obj, void *data, int event_flag);
\r
125 cal_base_time_h cal_base_time_create(cal_base_time_operations *base_operations, void *data);
\r
126 void cal_base_time_state_transition(cal_base_time_h base_time, enum cal_base_time_input_signal_type input);
\r
127 void cal_base_time_state_actions(cal_base_time_h base_time);
\r
128 void cal_base_time_update(cal_base_time_h base_time);
\r
129 void cal_base_time_attach_scroller(cal_base_time_h base_time);
\r
130 void cal_base_time_freeze_scroller(cal_base_time_h base_time);
\r
131 void cal_base_time_thaw_scroller(cal_base_time_h base_time);
\r
133 void cal_base_time_show(cal_base_time_h base_time);
\r
134 void cal_base_time_hide(cal_base_time_h base_time);
\r