base: find the item to be focused using media id
[profile/tv/apps/native/air_mediahub.git] / include / util / listmgr.h
1 /*
2  * Copyright (c) 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 #ifndef __AIR_MEDIAHUB_LISTMGR_H__
18 #define __AIR_MEDIAHUB_LISTMGR_H__
19
20 struct listmgr;
21
22 struct play_info_ops {
23         bool (*draw)(void *data, Evas_Object *base);
24         bool (*update)(void *data, Evas_Object *base);
25
26         void (*selected_cb)(void *data, Evas_Object *obj);
27         void *ops_data;
28 };
29
30 struct grid_ops {
31         struct grid_class *gclass;
32
33         void (*key_down_cb)(void *data, Elm_Object_Item *it,
34                                 Evas_Event_Key_Down *ev);
35         void (*selected_cb)(void *data, Elm_Object_Item *it);
36         void *ops_data;
37 };
38
39 struct listmgr_data {
40         Evas_Object *menu_btn;
41
42         int grid_item_x;
43         int grid_item_y;
44         int grid_num_item;
45
46         int box_padding;
47
48         struct play_info_ops *pops;
49         struct grid_ops *gops;
50 };
51
52 struct listmgr *listmgr_create(Evas_Object *base, void *data);
53 void listmgr_destroy(struct listmgr *listmgr);
54
55 bool listmgr_draw_list_area(struct listmgr *lmgr);
56 bool listmgr_update_content_item(struct listmgr *lmgr);
57 bool listmgr_update_content_list(struct listmgr *lmgr, Eina_List *list);
58 bool listmgr_update_play_info(struct listmgr *lmgr, app_media_info *info);
59
60 bool listmgr_focus_content_list(struct listmgr *lmgr, const char *id);
61 bool listmgr_focus_play_info(struct listmgr *lmgr);
62
63 void listmgr_set_focus_state(struct listmgr *lmgr, Eina_Bool state);
64
65 #endif /* __AIR_MEDIAHUB_LISTMGR_H__ */