Modification due to the change of CUsbConnectionListener
[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 :
32         public CBaseView,
33         public IMouseMoveListener,
34         public IMouseClickedListener,
35         public IMusicControllerListener {
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         static Eina_Bool sm_CbShowLayoutIdler(void *cookie);
47         void m_OnShowLayoutIdler(void);
48
49 private:
50         void m_UpdateFocusSequence(void);
51         void m_UpdateEmptyFocusSequence(void);
52
53         void m_ShowCurrentLayout(void);
54         void m_GotoPlayback(void);
55
56         void m_CreateCtxPopup(int btnType);
57         void m_DestroyCtxPopup(void);
58
59         Evas_Object *m_CreateLoadingPopup(void);
60         void m_DestroyPopup(void);
61
62         void m_UpdatePlaysongLabel(void);
63         void m_AddPlaysongLabel(void);
64         void m_CreateTopSection(void);
65         void m_CreateLeftSection(void);
66         void m_CreateFullView(void);
67
68         void m_SetSourceType(void);
69         void m_UpdateCurrentLayout(bool focusFlag);
70
71         char *m_Argument(void *data);
72
73 protected:
74         virtual void t_OnShow(void);
75         virtual void t_OnHide(void);
76         virtual void t_OnUpdate(void* data);
77
78 public:
79         CMusicBaseView(const char *pViewId) :
80                 CBaseView(pViewId),
81                 IMouseMoveListener(this),
82                 IMouseClickedListener(this),
83                 m(0) {}
84         virtual ~CMusicBaseView() {}
85
86         virtual bool Create(void *data);
87         virtual void Destroy(void);
88
89         virtual Evas_Object* Base(void);
90
91 public:
92         virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
93         virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
94         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
95         virtual void OnMouseClicked(int id, Evas_Object *obj);
96
97         virtual void OnComplete(void);
98         virtual void OnError(void);
99         virtual void OnUsbStatusChanged(SUsbStorageStatus status);
100         virtual void OnUpdateContent(void);
101 };
102
103
104 #endif /*__MUSIC_BASE_VIEW_H__*/
105