tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / MMPlayer / EventOnStateChange.h
1 /*
2  * Copyright (c) 2011 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 #ifndef WRTDEVICEAPIS_MMPLAYER_EVENT_ON_STATE_CHANGE_H_
17 #define WRTDEVICEAPIS_MMPLAYER_EVENT_ON_STATE_CHANGE_H_
18
19 #include <dpl/shared_ptr.h>
20 #include <Commons/ListenerEvent.h>
21 #include <Commons/ListenerEventEmitter.h>
22
23 namespace WrtDeviceApis {
24 namespace MMPlayer {
25 namespace Api {
26
27 class EventOnStateChange : public Commons::ListenerEvent<EventOnStateChange>
28 {
29   public:
30     typedef enum
31     {
32         BEGIN,
33         OPENED,
34         STOPPED,
35         PLAYING,
36         COMPLETED,
37         PAUSED,
38         RESUMED
39     } PlayerStates;
40   private:
41     PlayerStates m_playerState;
42
43   public:
44     EventOnStateChange() : m_playerState(BEGIN)
45     {
46     }
47     explicit EventOnStateChange(const PlayerStates state) : m_playerState(state)
48     {
49     }
50     virtual ~EventOnStateChange()
51     {
52     }
53
54     /**
55      * Getters and setters
56      */
57     void setPlayerState(const PlayerStates state)
58     {
59         m_playerState = state;
60     }
61     PlayerStates getPlayerState() const
62     {
63         return m_playerState;
64     }
65 };
66
67 typedef DPL::SharedPtr<EventOnStateChange> EventOnStateChangePtr;
68 typedef Commons::ListenerEventEmitter<EventOnStateChange>
69             EventOnStateChangeEmitter;
70 typedef DPL::SharedPtr<EventOnStateChangeEmitter> EventOnStateChangeEmitterPtr;
71 } //MMPlayer
72 } //Api
73 } //WrtDeviceApis
74
75 #endif // WRTDEVICEAPIS_MMPLAYER_EVENT_ON_STATE_CHANGE_H_