Home | History | Annotate | Download | only in wince
      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 #include "ScriptInstance.h"
     28 
     29 namespace WebCore {
     30 
     31     class IntRect;
     32     class IntSize;
     33     class MediaPlayer;
     34     class PluginView;
     35     class HTMLMediaElement;
     36 
     37     enum MediaPlayerProxyNotificationType {
     38         MediaPlayerNotificationPlayPauseButtonPressed,
     39         Idle,
     40         Loading,
     41         Loaded,
     42         FormatError,
     43         NetworkError,
     44         DecodeError
     45     };
     46 
     47     class WebMediaPlayerProxy {
     48     public:
     49         WebMediaPlayerProxy(MediaPlayer* player);
     50         ~WebMediaPlayerProxy();
     51 
     52         MediaPlayer* mediaPlayer() {return m_mediaPlayer;}
     53         void initEngine();
     54         void load(const String& url);
     55         HTMLMediaElement* element();
     56         void invokeMethod(const String& methodName);
     57         ScriptInstance pluginInstance();
     58 
     59     private:
     60         MediaPlayer* m_mediaPlayer;
     61         bool m_init;
     62         WebCore::PluginView* m_pluginView;
     63         bool m_hasSentResponseToPlugin;
     64         ScriptInstance m_instance;
     65     };
     66 
     67 }
     68 #endif // ENABLE(VIDEO)
     69 
     70 #endif
     71