tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / tizen / MMPlayer / Manager.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_MANAGER_H_
17 #define WRTDEVICEAPIS_MMPLAYER_MANAGER_H_
18
19 #include <MMPlayer/IManager.h>
20
21 namespace WrtDeviceApis {
22 namespace MMPlayer {
23
24 class Manager : public Api::IManager
25 {
26   public:
27     Manager();
28     virtual ~Manager();
29
30     /**
31      * Opens a file
32      * @param event @see WrtDeviceApis::Api::EventOpen.
33      * @exception Commons::PlatformException when platform error occurs
34      */
35     virtual void openFile(const Api::EventOpenPtr& event);
36     /**
37      * Plays current file. If file is already playing player starts from the beginning
38      * @param event @see WrtDeviceApis::Api::EventPlay.
39      * @exception Commons::PlatformException when platform error occurs
40      */
41     virtual void play(const Api::EventPlayPtr& event);
42     /**
43      * Pauses current playing file. If no file is currently playing noting happens
44      * @param event @see WrtDeviceApis::Api::EventPause.
45      * @exception Commons::PlatformException when platform error occurs
46      * @exception Commons::InvalidArgumentException when fileName is empty
47      */
48     virtual void pause(const Api::EventPausePtr& event);
49     /**
50      * Resumes after pause. If file is not paused nothing happens
51      * @param event @see WrtDeviceApis::Api::EventResume.
52      * @exception Commons::PlatformException when platform error occurs
53      */
54     virtual void resume(const Api::EventResumePtr& event);
55     /**
56      * Stops current playing file. If file is not playing nothing happens
57      * @param event @see WrtDeviceApis::Api::EventStop.
58      * @exception Commons::PlatformException when platform error occurs
59      */
60     virtual void stop(const Api::EventStopPtr& event);
61     /**
62      * Sets window for video files
63      * @param event @see WrtDeviceApis::Api::EventSetWindow.
64      * @exception Commons::PlatformException when platform error occurs
65      */
66     virtual void setWindow(const Api::EventSetWindowPtr& event);
67     /**
68      * Returns current playing state
69      * @param event @see WrtDeviceApis::Api::EventIsPlaying.
70      * @return True if player is in playing state
71      * @exception Commons::PlatformException when platform error occurs
72      */
73     virtual void isPlaying(const Api::EventIsPlayingPtr& event);
74     /**
75      * Returns current playing state
76      * @param [out] event @see WrtDeviceApis::Api::EventIsPlaying.
77      * @exception Commons::PlatformException when platform error occurs
78      */
79     virtual void getVolume(const Api::EventGetVolumePtr& event);
80
81   protected:
82     virtual void OnRequestReceived(const Api::EventOpenPtr& event);
83     virtual void OnRequestReceived(const Api::EventPlayPtr& event);
84     virtual void OnRequestReceived(const Api::EventPausePtr& event);
85     virtual void OnRequestReceived(const Api::EventResumePtr& event);
86     virtual void OnRequestReceived(const Api::EventStopPtr& event);
87     virtual void OnRequestReceived(const Api::EventSetWindowPtr& event);
88     virtual void OnRequestReceived(const Api::EventIsPlayingPtr& event);
89     virtual void OnRequestReceived(const Api::EventGetVolumePtr& event);
90 };
91
92 }
93 }
94
95 #endif // WRTDEVICEAPIS_MMPLAYER_MANAGER_H_