1a3b2f33e20ef0fabf57606f64b6ae87138056b6
[profile/tv/apps/native/videoplayer.git] / include / view_player.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 __VIEW_PLAYER_H__
18 #define __VIEW_PLAYER_H__
19
20 struct SPlayerView;
21
22 struct SPlayerParam {
23         const char *id;
24         const char *filepath;
25         const char *playlist;
26 };
27
28 enum update_action {
29         ACTION_HIDE,
30         ACTION_SHOW,
31         ACTION_RESUME,
32         ACTION_PAUSE,
33         ACTION_INIT
34 };
35
36 class CPlayerView : public CBaseView {
37 private:
38         SPlayerView *m;
39
40 private:
41         void m_ControlInit(SPlayerParam *param);
42         bool m_UiInit(void);
43         bool m_AddControls(void);
44         void m_UpdateInfoBar(void);
45         bool m_PlayerInit(void);
46         void m_ShowBar(void);
47         void m_HideBar(void);
48         void m_Fini(void);
49
50 private:
51         static Eina_Bool sm_CbDrawAnimation(void *dt);
52         static void sm_CbPlayComplete(void *dt);
53         static void sm_CbShowViewFinish(void *dt, Evas_Object *obj,
54                 const char *emission, const char *source);
55         static void sm_CbEcoreEvent(void *dt, int type, void *ei);
56         static void sm_CbTimeoutEvent(void *dt, int type, void *ev);
57
58         static void sm_EvtBack(void *dt, Evas_Object *obj, void *ev);
59         static void sm_EvtVolume(SPlayerView *data, int val);
60         static void sm_EvtControlBtn(void *dt, const char *ev);
61
62         static void sm_EvtPrevBtn(void *dt);
63         static void sm_EvtRewindBtn(void *dt);
64         static void sm_EvtPlayBtn(void *dt);
65         static void sm_EvtForwardBtn(void *dt);
66         static void sm_EvtNextBtn(void *dt);
67         static void sm_EvtReapeatBtn(void *dt);
68
69 protected:
70         virtual void t_OnShow(void);
71         virtual void t_OnPause(void);
72         virtual void t_OnUpdate(void *dt);
73
74 public:
75         CPlayerView(const char *szViewId) : CBaseView(szViewId), m(0) {}
76         virtual ~CPlayerView(void) {}
77
78         virtual bool Create(void *data);
79         virtual void Destroy(void);
80
81         virtual Evas_Object *Base(void);
82
83 };
84
85 #endif