Apply CCtxPopup to CMusicBaseView.
[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 #include <CtxPopup.h>
22
23
24 struct SArgList {
25         char *album_id;
26         char *uri;
27         char *source;
28 };
29
30
31 class CMusicBaseView : public CBaseView, public CListenerMgr,
32         public IKeyDownListener, public IKeyUpListener,
33         public IMouseMoveListener, public IMouseClickedListener,
34         public IMusicControllerListener
35 {
36 private:
37         struct SMusicBaseView* m;
38
39 private:
40         static void sm_CbHandleEmptyStatus(void *cookie, bool emptyStatus);
41         void m_OnHandleEmptyStatus(bool emptyStatus);
42
43         static void sm_CbCtxPopupBtnSelected(void* cookie, CCtxPopup* instance, const char* text);
44         void m_CbCtxPopupBtnSelected(CCtxPopup* instance, const char* text);
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         void m_CreateCtxPopup(int btnType);
54         void m_DestroyCtxPopup(void);
55
56         Evas_Object *m_CreateLoadingPopup(void);
57         void m_DestroyPopup(void);
58
59         void m_UpdatePlaysongLabel(void);
60         void m_AddPlaysongLabel(void);
61         void m_CreateTopSection(void);
62         void m_CreateLeftSection(void);
63         void m_CreateFullView(void);
64
65         void m_SetSourceType(void);
66         void m_UpdateCurrentLayout(bool focusFlag);
67
68 protected:
69         virtual void t_OnShow(void);
70         virtual void t_OnHide(void);
71         virtual void t_OnUpdate(void* data);
72
73 public:
74         CMusicBaseView(const char *pViewId) :
75                 CBaseView(pViewId),
76                 IKeyDownListener(this),
77                 IKeyUpListener(this),
78                 IMouseMoveListener(this),
79                 IMouseClickedListener(this),
80                 m(0) {}
81         virtual ~CMusicBaseView() {}
82
83         virtual bool Create(void *data);
84         virtual void Destroy(void);
85
86         virtual Evas_Object* Base(void);
87
88 public:
89         virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
90         virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
91         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
92         virtual void OnMouseClicked(int id, Evas_Object *obj);
93
94
95 protected:
96         virtual void t_OnComplete(void);
97         virtual void t_OnError(void);
98         virtual void t_OnUsbConnected(void);
99         virtual void t_OnUpdateContent(void);
100 };
101
102
103 #endif /*__MUSIC_BASE_VIEW_H__*/
104