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