llmediaimplcommon.h

Go to the documentation of this file.
00001 
00032 #ifndef LLMEDIAIMPLCOMMON_H
00033 #define LLMEDIAIMPLCOMMON_H
00034 
00035 #include "llmediabase.h"
00036 #include "llmediaemitter.h"
00037 #include "llmediaobserver.h"
00038 
00039 #include <string>
00040 
00041 class LLMediaImplMakerBase;
00042 
00043 class LLMediaImplCommon :
00044         public LLMediaBase
00045 {
00046         public:
00047                 LLMediaImplCommon();
00048                 virtual ~LLMediaImplCommon();
00049 
00051                 // begin: default implementation of the abstract interface
00052                 // see llmediabase.h for documentation
00053 
00054                 // housekeeping
00055                 virtual bool init();
00056                 virtual bool reset();
00057                 virtual bool setMimeType( const std::string url );
00058                 virtual std::string getMimeType() const;
00059                 virtual std::string getMediaURL() const;
00060                 virtual std::string getVersion();
00061                 virtual bool set404RedirectUrl( std::string redirect_url );
00062                 virtual bool clr404RedirectUrl();
00063                 virtual bool setBackgroundColor( unsigned int red, unsigned int green, unsigned int blue ) const;
00064                 virtual bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue ) const;
00065 
00066                 // media management
00067                 virtual bool updateMedia();
00068                 virtual bool setRequestedMediaSize( int width, int height );
00069                 virtual int getMediaWidth() const;
00070                 virtual int getMediaHeight() const;
00071                 virtual int getMediaDepth() const;
00072                 virtual int getMediaBufferSize() const;
00073                 virtual unsigned char* getMediaData();
00074                 virtual int getMediaDataWidth() const;
00075                 virtual int getMediaDataHeight() const;
00076 
00077                 // texture management
00078                 virtual int getTextureFormatInternal() const;
00079                 virtual int getTextureFormatPrimary() const;
00080                 virtual int getTextureFormatType() const;
00081 
00082                 // audio
00083                 virtual bool setVolume( float volume );
00084                 virtual float getVolume() const;
00085 
00086                 // transport control
00087                 virtual bool addCommand( ECommand cmd );
00088                 virtual bool clearCommand();
00089                 virtual bool updateCommand();
00090                 LLMediaBase::ECommand nextCommand();
00091                 virtual LLMediaBase::EStatus getStatus();
00092                 bool setStatus( LLMediaBase::EStatus status );
00093 
00094                 virtual bool seek( double time );
00095                 virtual bool setLooping(bool enable) { mLooping = enable; return true; }
00096                 virtual bool isLooping() { return mLooping; }
00097                 virtual bool navigateTo( const std::string url );
00098 
00099                 // scaling
00100                 virtual bool setAutoScaled( bool auto_scaled );
00101                 virtual bool isAutoScaled() const;
00102 
00103                 // mouse and keyboard interaction
00104                 virtual bool mouseDown( int x_pos, int y_pos );
00105                 virtual bool mouseUp( int x_pos, int y_pos );
00106                 virtual bool mouseMove( int x_pos, int y_pos );
00107                 virtual bool keyPress( int key_code );
00108         virtual bool scrollByLines( int lines );
00109                 virtual bool focus( bool focus );
00110                 virtual bool unicodeInput( unsigned long uni_char );
00111                 virtual bool mouseLeftDoubleClick( int x_pos, int y_pos );
00112 
00113                 // navigation
00114                 virtual bool navigateForward();
00115                 virtual bool navigateBack();
00116                 virtual bool canNavigateForward();
00117                 virtual bool canNavigateBack();
00118 
00119                 // caching/cookies
00120                 virtual bool enableCookies( bool enable );
00121                 virtual bool clearCache();
00122                 virtual bool clearCookies();
00123 
00124                 virtual bool enableProxy(bool enable, std::string proxy_host_name, int proxy_port);
00125 
00126                 // observer interface
00127                 bool addObserver( LLMediaObserver* subject );
00128                 bool remObserver( LLMediaObserver* subject );
00129 
00130                 // type registry interface
00131                 void setImplMaker(LLMediaImplMakerBase* impl_maker);
00132                 bool supportsMediaType(std::string scheme, std::string type);
00133 
00134         protected:
00135                 virtual bool setMediaSize( int width, int height );
00136                 virtual bool setMediaDepth( int media_depth );
00137 
00138                 LLMediaEmitter< LLMediaObserver > mEventEmitter;
00139 
00140                 // Back pointer to the construction object, which is used to discover types handled
00141                 // by the Impl, and meta data associated with the Impl.
00142                 LLMediaImplMakerBase* mImplMaker;
00143                 std::string mMimeType;
00144                 std::string mInitialURL;
00145                 bool mAutoScaled;
00146                 int mMediaWidth;
00147                 int mMediaPrevWidth;
00148                 int mMediaHeight;
00149                 int mMediaPrevHeight;
00150                 int mMediaDepth;
00151                 int mMediaPrevDepth;
00152                 int mMediaRowSpan;
00153                 int mMediaRequestedWidth;
00154                 int mMediaRequestedHeight;
00155                 float mVolume;
00156                 LLMediaBase::ECommand mCommand;
00157                 LLMediaBase::EStatus mStatus;
00158                 bool mLooping;
00159 };
00160 
00161 #endif  // LLMEDIAIMPLCOMMON_H

Generated on Fri May 16 08:32:20 2008 for SecondLife by  doxygen 1.5.5