fa87d966d8c52980b2590757522940a4502e2083
[apps/home/quickpanel.git] / daemon / notifications / noti_list_item.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_NOTI_LIST_ITEM_H__
20 #define __QUICKPANEL_NOTI_LIST_ITEM_H__
21
22 #include <notification.h>
23 #include "noti_node.h"
24 #include "vi_manager.h"
25
26 #define STATE_NORMAL 1
27 #define STATE_DELETING 0
28
29 #define E_DATA_NOTI_LIST_ITEM_H "noti_list_item"
30
31 typedef Evas_Object *(*creater_cb)(notification_h, Evas_Object *);
32 typedef void (*action_cb)(noti_node_item *, notification_ly_type_e, Evas_Object *);
33 typedef void (*response_cb)(noti_node_item *, Evas_Object *);
34
35 typedef enum _qp_notilistitem_state_type {
36         NOTILISTITEM_STATE_NORMAL = 0,
37         NOTILISTITEM_STATE_GETSTURE_WAIT,
38         NOTILISTITEM_STATE_GETSTURE_CANCELED,
39         NOTILISTITEM_STATE_DELETED,
40 } qp_notilistitem_state_type;
41
42 typedef struct _Noti_View_H {
43         char *name;
44
45         /* func */
46         creater_cb create;
47         action_cb update;
48         action_cb remove;
49 } Noti_View_H;
50
51 typedef struct _noti_list_item_h {
52         int status;
53         int priv_id;
54         notification_ly_type_e layout;
55         noti_node_item *noti_node;
56
57         response_cb selected_cb;
58         response_cb button_1_cb;
59         response_cb deleted_cb;
60
61         QP_VI *vi;
62         Ecore_Animator *animator;
63
64         int obj_w;
65         int obj_h;
66         int press_x;
67         int press_y;
68         int distance;
69         int need_to_cancel_press;
70         qp_notilistitem_state_type state;
71 } noti_list_item_h;
72
73 Evas_Object *noti_list_item_create(Evas_Object *parent, notification_h noti);
74 void noti_list_item_update(Evas_Object *item);
75 void noti_list_item_remove(Evas_Object *item);
76
77 void noti_list_item_node_set(Evas_Object *item, noti_node_item *noti_node);
78 void *noti_list_item_node_get(Evas_Object *item);
79 int noti_list_item_get_status(Evas_Object *item);
80 void noti_list_item_set_status(Evas_Object *item, int status);
81
82 void noti_list_item_set_item_selected_cb(Evas_Object *item, response_cb selected_cb);
83 void noti_list_item_set_item_button_1_cb(Evas_Object *item, response_cb callback);
84 void noti_list_item_set_item_deleted_cb(Evas_Object *item, response_cb callback);
85
86 noti_list_item_h *noti_list_item_handler_get(Evas_Object *item);
87 #endif