2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __FOLDER_LAYOUT_H__
18 #define __FOLDER_LAYOUT_H__
21 struct SFolderItemInfo;
23 class CFolderLayout : public CExtBaseLayout, public CListenerMgr,
24 public IMouseMoveListener, public IMouseClickedListener,
25 public IRealizedListener, public IUnrealizedListener,
26 public IKeyDownListener, public IActivatedListener {
28 struct SFolderLayout *m;
31 static char *sm_CbGetGridItemText(void *data, Evas_Object *obj, const char *part);
32 static char *sm_CbGetGridSongItemText(void *data, Evas_Object *obj, const char *part);
33 static Evas_Object *sm_CbGetGridItemContent(void *data, Evas_Object *obj, const char *part);
34 static Evas_Object *sm_CbGetGridSongItemContent(void *data, Evas_Object *obj, const char *part);
35 static void sm_CbRemoveGridItem(void *data, Evas_Object *obj);
37 static Eina_Bool sm_CbFocusIdler(void *dt);
38 void m_OnFocusIdler(void);
40 static void sm_CbCtxtUpdate(void *dt, enum EActionType type, int lid);
41 void m_OnCtxtUpdate(EActionType type, int lid);
43 static void sm_CbCtxtClose(void *dt);
44 void m_OnCtxtClose(void);
46 static void sm_CbItemSelect(void *data, Elm_Object_Item *it, const char *emission, const char *source);
47 void m_OnItemSelect(Elm_Object_Item *it, const char *emission, const char *source);
50 SFolderItemInfo *m_FindItemInfo(Eina_List *list, Elm_Object_Item *item);
51 inline int m_ConvertToMin(int milsec);
52 void m_RemoveFocusIdler(void);
53 void m_GotoPlayback(int mode, char *id);
54 Elm_Object_Item *m_FindItemByInfo(Eina_List *list, CFolderInfo *finfo);
55 void m_SortFolderGrid(void);
56 void m_CreateFolderGrid(void);
57 void m_EmptyFolderGrid(bool sort_flag);
58 void m_UpdateFolderGrid(bool sort_flag);
59 void m_CreateTopsection(void);
62 virtual void t_OnShow(void);
65 CFolderLayout(const char *pLayoutId) :
66 CExtBaseLayout(pLayoutId),
67 IMouseMoveListener(this),
68 IMouseClickedListener(this),
69 IRealizedListener(this),
70 IUnrealizedListener(this),
71 IKeyDownListener(this),
72 IActivatedListener(this),
74 virtual ~CFolderLayout() {}
76 bool Create(CLayoutMgr *mgr);
77 virtual void Destroy(void);
79 virtual void Update(bool focusFlag);
82 virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
83 virtual void OnMouseClicked(int id, Evas_Object *obj);
84 virtual void OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item);
85 virtual void OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item);
86 virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
87 virtual void OnActivated(int id, Evas_Object *obj, Elm_Object_Item *item);
91 #endif /*__FOLDER_LAYOUT_H__*/