1/*
2 * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
3 *
4 *  This library is free software; you can redistribute it and/or
5 *  modify it under the terms of the GNU Library General Public
6 *  License as published by the Free Software Foundation; either
7 *  version 2 of the License, or (at your option) any later version.
8 *
9 *  This library is distributed in the hope that it will be useful,
10 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 *  Library General Public License for more details.
13 *
14 *  You should have received a copy of the GNU Library General Public License
15 *  along with this library; see the file COPYING.LIB.  If not, write to
16 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 *  Boston, MA 02110-1301, USA.
18 */
19
20
21#ifndef MediaPlayerProxy_h
22#define MediaPlayerProxy_h
23
24#if ENABLE(VIDEO)
25
26#include <wtf/Forward.h>
27
28namespace WebCore {
29
30    class IntRect;
31    class IntSize;
32    class MediaPlayer;
33    class PluginView;
34    class HTMLMediaElement;
35
36    enum MediaPlayerProxyNotificationType {
37        MediaPlayerNotificationPlayPauseButtonPressed,
38        Idle,
39        Loading,
40        Loaded,
41        FormatError,
42        NetworkError,
43        DecodeError
44    };
45
46    class WebMediaPlayerProxy {
47    public:
48        WebMediaPlayerProxy(MediaPlayer* player);
49        ~WebMediaPlayerProxy();
50
51        MediaPlayer* mediaPlayer() {return m_mediaPlayer;}
52        void initEngine();
53        void load(const String& url);
54        HTMLMediaElement* element();
55        void invokeMethod(const String& methodName);
56        RefPtr<JSC::Bindings::Instance> pluginInstance();
57
58    private:
59        MediaPlayer* m_mediaPlayer;
60        bool m_init;
61        WebCore::PluginView* m_pluginView;
62        bool m_hasSentResponseToPlugin;
63        ScriptInstance m_instance;
64    };
65
66}
67#endif // ENABLE(VIDEO)
68
69#endif
70