78637ff703b3adc81cf2c40ff6610fde8f05236c
[profile/tv/apps/native/musicplayer.git] / src / views / SliderWidget.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 __SLIDER_WIDGET_H__
18 #define __SLIDER_WIDGET_H__
19
20 class CSliderWidget :
21         public CListenerMgr,
22         public IMusicControllerListener,
23         public IMouseMoveListener,
24         public IChangedListener {
25 private:
26         struct SSliderWidget *m;
27
28 private:
29         static Eina_Bool sm_CbUpdateSlider(void *dt);
30         Eina_Bool m_OnUpdateSlider(void);
31
32         bool m_AddSlider(void);
33         void m_RemoveTimer(void);
34
35         void m_UpdateSongInfo(void);
36
37 public:
38         CSliderWidget() :
39                 IMouseMoveListener(this),
40                 IChangedListener(this),
41                 m(0) {}
42         virtual ~CSliderWidget() {}
43
44         bool Create(Evas_Object *eoParent);
45         virtual void Destroy(void);
46
47         Evas_Object* Base(void);
48
49         void Init(void);
50
51         //! This function is invoked when playback is complete.
52         virtual void OnComplete(void);
53         //! This function is invoked when new song is played.
54         virtual void OnStartPlayback(void);
55         //!
56         virtual void OnStopPlayback(void);
57         //! This function is invoked when playback is paused.
58         virtual void OnPausePlayback(void);
59         //! This function is invoked when playback is resumed.
60         virtual void OnResumePlayback(void);
61         //!
62         virtual void OnPosition(int milsec);
63
64         virtual void OnChanged(int id, Evas_Object *obj);
65         virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
66 };
67
68 #endif // __PLAYBACK_VIEW_H__