Fix build error due to changing app-common
[profile/tv/apps/native/filebrowser.git] / include / FileGrid.h
1 /*
2 * Copyright (c) 2014 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 __FILE_GRID_H__
18 #define __FILE_GRID_H__
19
20
21 class CFileGrid : public CListenerMgr, IMouseMoveListener, IKeyUpListener {
22 private:
23         struct SFileGrid* m;
24
25 public:
26         struct SCallback {
27                 void(*cbUpdateEmptyFocusSequence)(void* cookie);
28                 void(*cbUpdatedGrid)(void* cookie);
29                 void(*cbUnsetFocus)(void* cookie);
30                 void(*cbLinkApp)(void* cookie, int type, int source_type, char *path);
31                 void* cookie;
32         };
33
34 private:
35         static void sm_CbRealized(void *data, Evas_Object *obj, void *event_info);
36         static void sm_CbUnrealized(void *data, Evas_Object *obj, void *event_info);
37
38         void m_DeleteContextView(void);
39         static void sm_CbSelectItem(void *data, Elm_Object_Item *it, const char *emission, const char *source);
40
41         void m_HandleSelection(void);
42         void m_GetMediaList(char *pFolderId);
43         void m_GetFolderList(void);
44
45 protected:
46         void t_CreateFileGrid(void);
47
48         void t_Empty(bool sort_flag);
49         void t_Update(char *fid, bool sort_flag);
50         void t_Fill(void);
51
52 public:
53         CFileGrid() : IMouseMoveListener(this), IKeyUpListener(this), m(0) { }
54         virtual ~CFileGrid() { if (m) Destroy(); }
55
56         bool Create(Evas_Object* win, Evas_Object* base, const SCallback* cb);
57         virtual void Destroy(void);
58         void Update(bool sort_flag);
59
60         void SetFocus(Eina_Bool flag);
61         Evas_Object* Grid(void);
62         void Action(void);
63
64         //!
65         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
66         //!
67         virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
68 };
69
70
71 #endif /* __FILE_GRID_H__ */