tizen 2.4 release
[apps/home/quickpanel.git] / daemon / vi / vi_manager.h
1 /*
2  * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18
19 #ifndef __QUICKPANEL_VI_MANAGER_H__
20 #define __QUICKPANEL_VI_MANAGER_H__
21
22
23 typedef Eina_Bool (*vi_cb)(void *data);
24
25 typedef enum _qp_vim_state_type {
26         VIM_STATE_NOT_READY = 0,
27         VIM_STATE_READY,
28         VIM_STATE_WORKING,
29         VIM_STATE_SUSPENDED,
30 } qp_vim_state_type;
31
32 typedef enum _qp_vi_state_type {
33         VI_STATE_NOT_READY = 0,
34         VI_STATE_READY = 1,
35         VI_STATE_RUNNING,
36         VI_STATE_DONE,
37         VI_STATE_INTERRUPTED,
38 } qp_vi_state_type;
39
40 typedef enum _qp_vi_op_type {
41         VI_OP_NONE = -1,
42         VI_OP_INSERT = 0,
43         VI_OP_UPDATE,
44         VI_OP_DELETE,
45         VI_OP_DELETE_ALL,
46         VI_OP_REORDER,
47         VI_OP_ROTATION,
48         VI_OP_RESIZE,
49 } qp_vi_op_type;
50
51 typedef struct _QP_VI {
52         qp_vi_state_type state;
53         qp_vi_op_type op_type;
54         qp_item_type_e item_type;
55         void *container;
56         void *target;
57         vi_cb init_cb;
58         vi_cb job_cb;
59         vi_cb done_cb;
60         vi_cb interrupt_cb;
61         int disable_interrupt_userevent;
62         int disable_freezing;
63         void *extra_data_1;
64         void *extra_data_2;
65         int extra_flag_1;
66         int extra_flag_2;
67 } QP_VI;
68
69 typedef  struct _qp_vi_op_table {
70         qp_vi_op_type op_type;
71         void (*handler)(void *data);
72 } qp_vi_op_table;
73
74 extern QP_VI *quickpanel_vi_new(void);
75 extern QP_VI *quickpanel_vi_new_with_data(qp_vi_op_type op_type, qp_item_type_e item_type, void *container, void *target, vi_cb init_cb, vi_cb job_cb, vi_cb done_cb, vi_cb interrupt_cb, void *extra_data_1, void *extra_data_2, int extra_flag_1, int extra_flag_2);
76 extern void quickpanel_vi_start(QP_VI *vi);
77 extern void quickpanel_vi_interrupt(QP_VI *vi);
78 extern void quickpanel_vi_done(QP_VI *vi);
79 extern void quickpanel_vim_set_state_ready(void);
80 extern void quickpanel_vim_set_state_suspend(void);
81 extern double quickpanel_vim_get_duration(qp_vi_op_type op_type);
82 extern void quickpanel_vi_done_cb_for_transit(void *data, Elm_Transit *transit);
83 extern Elm_Transit_Tween_Mode quickpanel_vim_get_tweenmode(qp_vi_op_type op_type);
84
85 extern void quickpanel_vi_user_event_add(QP_VI *vi);
86 extern void quickpanel_vi_user_event_del(QP_VI *vi);
87 extern void quickpanel_vi_object_event_freeze_set(Evas_Object *obj, Eina_Bool freeze);
88
89 #endif