Fix focus sequence between group buttons and layouts
[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,
32         public IMouseMoveListener, public IMouseClickedListener,
33         public IMusicControllerListener, public IFocusedListener {
34 private:
35         struct SMusicBaseView* m;
36
37 private:
38         static void sm_CbHandleEmptyStatus(void *cookie, bool emptyStatus);
39         void m_OnHandleEmptyStatus(bool emptyStatus);
40
41         static void sm_CbCtxPopupBtnSelected(void* cookie, CCtxPopup* instance, const char* text);
42         void m_CbCtxPopupBtnSelected(CCtxPopup* instance, const char* text);
43
44 private:
45         void m_UpdateFocusSequence(void);
46         void m_UpdateEmptyFocusSequence(void);
47
48         void m_ShowCurrentLayout(void);
49         void m_GotoPlayback(void);
50
51         void m_CreateCtxPopup(int btnType);
52         void m_DestroyCtxPopup(void);
53
54         Evas_Object *m_CreateLoadingPopup(void);
55         void m_DestroyPopup(void);
56
57         void m_UpdatePlaysongLabel(void);
58         void m_AddPlaysongLabel(void);
59         void m_CreateTopSection(void);
60         void m_CreateLeftSection(void);
61         void m_CreateFullView(void);
62
63         void m_SetSourceType(void);
64         void m_UpdateCurrentLayout(bool focusFlag);
65
66         char *m_Argument(void *data);
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                 IMouseMoveListener(this),
77                 IMouseClickedListener(this),
78                 IFocusedListener(this),
79                 m(0) {}
80         virtual ~CMusicBaseView() {}
81
82         virtual bool Create(void *data);
83         virtual void Destroy(void);
84
85         virtual Evas_Object* Base(void);
86
87 public:
88         virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
89         virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
90         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
91         virtual void OnMouseClicked(int id, Evas_Object *obj);
92         virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item);
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