Apply Modified Listeners
[profile/tv/apps/native/musicplayer.git] / include / base-view.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 __MUSIC_BASE_VIEW_H__
18 #define __MUSIC_BASE_VIEW_H__
19
20
21 struct SArgList {
22         char *album_id;
23         char *uri;
24         char *source;
25 };
26
27
28 class CMusicBaseView : public CBaseView, public CListenerMgr,
29         public IKeyDownListener, public IKeyUpListener,
30         public IMouseMoveListener, public IMouseClickedListener,
31         public IMusicControllerListener
32 {
33 private:
34         struct SMusicBaseView* m;
35
36 private:
37         static void sm_CbHandleEmptyStatus(void *cookie, bool emptyStatus);
38         void m_OnHandleEmptyStatus(bool emptyStatus);
39
40         static void sm_CbCtxPopupBtnClicked(void *dt, Evas_Object *obj, void *ev);
41         void m_CbCtxPopupBtnClicked(Evas_Object *obj, void *ev);
42
43         static void sm_CbCtxPopupBtnKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei);
44         void m_OnCtxPopupBtnKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
45
46 private:
47         void m_UpdateFocusSequence(void);
48         void m_UpdateEmptyFocusSequence(void);
49
50         void m_ShowCurrentLayout(void);
51         void m_GotoPlayback(void);
52
53         static bool sm_FindIndex(const char **arr, int arrsize, const char *text, int *index);
54
55         void m_CreateCtxPopup(int btnType);
56         void m_DestroyCtxPopup(void);
57
58         Evas_Object *m_CreateLoadingPopup(void);
59         void m_DestroyPopup(void);
60
61         void m_UpdatePlaysongLabel(void);
62         void m_AddPlaysongLabel(void);
63         void m_CreateTopSection(void);
64         void m_CreateLeftSection(void);
65         void m_CreateFullView(void);
66
67         void m_SetSourceType(void);
68         void m_UpdateCurrentLayout(bool focusFlag);
69
70 protected:
71         virtual void t_OnShow(void);
72         virtual void t_OnHide(void);
73         virtual void t_OnUpdate(void* data);
74
75 public:
76         CMusicBaseView(const char *pViewId) :
77                 CBaseView(pViewId),
78                 IKeyDownListener(this),
79                 IKeyUpListener(this),
80                 IMouseMoveListener(this),
81                 IMouseClickedListener(this),
82                 m(0) {}
83         virtual ~CMusicBaseView() {}
84
85         virtual bool Create(void *data);
86         virtual void Destroy(void);
87
88         virtual Evas_Object* Base(void);
89
90 public:
91         virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
92         virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
93         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
94         virtual void OnMouseClicked(int id, Evas_Object *obj);
95
96
97 protected:
98         virtual void t_OnComplete(void);
99         virtual void t_OnError(void);
100         virtual void t_OnUsbConnected(void);
101         virtual void t_OnUpdateContent(void);
102 };
103
104
105 #endif /*__MUSIC_BASE_VIEW_H__*/
106