00001
00032 #ifndef LLMEDIAIMPLLLMOZLIB_H
00033 #define LLMEDIAIMPLLLMOZLIB_H
00034
00035 #include "llmediaimplcommon.h"
00036 #include "llmediaimplfactory.h"
00037
00038 #if LL_LLMOZLIB_ENABLED
00039
00040 #include "llmozlib2.h"
00041
00042 class LLMediaManagerData;
00043
00044 class LLMediaImplLLMozLib :
00045 public LLMediaImplCommon,
00046 public LLEmbeddedBrowserWindowObserver
00047 {
00048 public:
00049 LLMediaImplLLMozLib();
00050
00051 static bool startup( LLMediaManagerData* init_data );
00052 static bool closedown();
00053
00054 bool init();
00055 std::string getVersion();
00056 bool set404RedirectUrl( std::string redirect_url );
00057 bool clr404RedirectUrl();
00058 bool setBackgroundColor( unsigned int red, unsigned int green, unsigned int blue ) const;
00059 bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue ) const;
00060 bool navigateTo( const std::string url );
00061 bool updateMedia();
00062 unsigned char* getMediaData();
00063 int getMediaDataWidth() const;
00064 int getMediaDataHeight() const;
00065 bool setRequestedMediaSize(int width, int height);
00066 bool setAutoScaled( bool auto_scaled );
00067 int getTextureFormatPrimary() const;
00068 int getTextureFormatType() const;
00069 bool mouseDown( int x_pos, int y_pos );
00070 bool mouseUp( int x_pos, int y_pos );
00071 bool mouseMove( int x_pos, int y_pos );
00072 bool keyPress( int key_code );
00073 bool scrollByLines( int lines );
00074 bool focus( bool focus );
00075 bool unicodeInput( unsigned long uni_char );
00076 bool mouseLeftDoubleClick( int x_pos, int y_pos );
00077 bool navigateForward();
00078 bool navigateBack();
00079 bool canNavigateForward();
00080 bool canNavigateBack();
00081 bool enableCookies(bool enable);
00082 bool enableProxy(bool enable, std::string proxy_host_name, int proxy_port);
00083 bool clearCache();
00084 bool clearCookies();
00085 bool reset();
00086
00087
00088 virtual void onNavigateBegin( const EventType& eventIn );
00089 virtual void onNavigateComplete( const EventType& eventIn );
00090 virtual void onUpdateProgress( const EventType& eventIn );
00091 virtual void onPageChanged( const EventType& eventIn );
00092 virtual void onStatusTextChange( const EventType& eventIn );
00093 virtual void onLocationChange( const EventType& eventIn );
00094 virtual void onClickLinkHref( const EventType& eventIn );
00095 virtual void onClickLinkNoFollow( const EventType& eventIn );
00096
00097 private:
00098 bool recomputeSizes();
00099 int mWindowId;
00100 int mBrowserWindowWidth;
00101 int mBrowserWindowHeight;
00102 int mMediaDataWidth;
00103 int mMediaDataHeight;
00104 bool mNeedsUpdate;
00105 bool updateState();
00106 };
00107
00108
00109 class LLMediaImplLLMozLibMaker : public LLMediaImplMaker
00110 {
00111 public:
00112 LLMediaImplLLMozLibMaker();
00113 LLMediaImplLLMozLib* create()
00114 {
00115 return new LLMediaImplLLMozLib();
00116 }
00117 };
00118 #endif // LL_LLMOZLIB_ENABLED
00119
00120 #endif // LLMEDIAIMPLLLMOZLIB_H