Modification due to the change of CBaseView
[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 :
29         public CBaseView,
30         public IMouseMoveListener,
31         public IMouseClickedListener,
32         public IMusicControllerListener {
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_CbCtxPopupBtnSelected(void* cookie, CContextPopup* instance, const char* text);
41         void m_CbCtxPopupBtnSelected(CContextPopup* instance, const char* text);
42
43         static Eina_Bool sm_CbShowLayoutIdler(void *cookie);
44         void m_OnShowLayoutIdler(void);
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         char *m_Argument(void *data);
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                 IMouseMoveListener(this),
79                 IMouseClickedListener(this),
80                 m(0) {}
81         virtual ~CMusicBaseView() {}
82
83         virtual bool Create(void *data, Evas_Object *eoBase);
84         virtual void Destroy(void);
85
86 public:
87         virtual void OnSKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Down *ev);
88         virtual void OnSKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Up *ev);
89         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
90         virtual void OnMouseClicked(int id, Evas_Object *obj);
91
92         virtual void OnComplete(void);
93         virtual void OnError(void);
94         virtual void OnUsbStatusChanged(SUsbStorageStatus status);
95         virtual void OnUpdateContent(void);
96 };
97
98
99 #endif /*__MUSIC_BASE_VIEW_H__*/
100