summaryrefslogtreecommitdiff
path: root/avmedia/source/viewer/mediawindow_impl.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-13 20:16:22 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 09:58:14 +0900
commit9128ef6850984924c27e6f794d05fc70d3243527 (patch)
treee5d4eacd69e0af940170ba300bbd6e1ef0ca37ac /avmedia/source/viewer/mediawindow_impl.hxx
parentdcaef20266ef3511f71d3c4b8962af5f03860feb (diff)
refactor MediaWindow to use RenderContext
Change-Id: I6488e360ad51478c6305c4647255e61a80c64195
Diffstat (limited to 'avmedia/source/viewer/mediawindow_impl.hxx')
-rw-r--r--avmedia/source/viewer/mediawindow_impl.hxx200
1 files changed, 95 insertions, 105 deletions
diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx
index 11a95d878e89..b73413d8e36e 100644
--- a/avmedia/source/viewer/mediawindow_impl.hxx
+++ b/avmedia/source/viewer/mediawindow_impl.hxx
@@ -28,157 +28,147 @@
namespace com { namespace sun { namespace star { namespace media {
class XPlayer;
class XPlayerWindow;
-} } } }
+}}}}
+
namespace com { namespace sun { namespace star { namespace uno {
class XComponentContext;
-} } } }
+}}}}
+
class BitmapEx;
namespace avmedia
{
- class MediaWindow;
-
- namespace priv
- {
-
- // - MediaWindowControl -
-
-
- class MediaWindowControl : public MediaControl
- {
- public:
- explicit MediaWindowControl( vcl::Window* pParent );
-
- protected:
-
- void update() SAL_OVERRIDE;
- void execute( const MediaItem& rItem ) SAL_OVERRIDE;
- };
+class MediaWindow;
+namespace priv
+{
- // - MediaChildWindow -
+class MediaWindowControl : public MediaControl
+{
+public:
+ explicit MediaWindowControl( vcl::Window* pParent );
- class MediaChildWindow : public SystemChildWindow
- {
- public:
+protected:
- explicit MediaChildWindow( vcl::Window* pParent );
- MediaChildWindow( vcl::Window* pParent, SystemWindowData* pData );
+ void update() SAL_OVERRIDE;
+ void execute( const MediaItem& rItem ) SAL_OVERRIDE;
+};
- protected:
+class MediaChildWindow : public SystemChildWindow
+{
+public:
- virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void KeyUp( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
- };
+ explicit MediaChildWindow( vcl::Window* pParent );
+ MediaChildWindow( vcl::Window* pParent, SystemWindowData* pData );
- // ------------------.
- // - MediaWindowImpl -
+protected:
+ virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
+ virtual void KeyUp( const KeyEvent& rKEvt ) SAL_OVERRIDE;
+ virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
+};
- class MediaEventListenersImpl;
+class MediaEventListenersImpl;
- class MediaWindowImpl : public Control,
- public DropTargetHelper,
- public DragSourceHelper
+class MediaWindowImpl : public Control, public DropTargetHelper, public DragSourceHelper
+{
+public:
+ MediaWindowImpl(vcl::Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl);
+ virtual ~MediaWindowImpl();
- {
- public:
+ virtual void dispose() SAL_OVERRIDE;
- MediaWindowImpl( vcl::Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl );
- virtual ~MediaWindowImpl();
- virtual void dispose() SAL_OVERRIDE;
+ static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = 0);
- static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = 0 );
+ void setURL(const OUString& rURL, OUString const& rTempURL, OUString const& rReferer);
- void setURL( const OUString& rURL, OUString const& rTempURL, OUString const& rReferer );
+ const OUString& getURL() const;
- const OUString& getURL() const;
+ bool isValid() const;
- bool isValid() const;
+ Size getPreferredSize() const;
- Size getPreferredSize() const;
+ bool start();
- bool start();
+ void updateMediaItem( MediaItem& rItem ) const;
+ void executeMediaItem( const MediaItem& rItem );
- void updateMediaItem( MediaItem& rItem ) const;
- void executeMediaItem( const MediaItem& rItem );
+ void setPosSize( const Rectangle& rRect );
- void setPosSize( const Rectangle& rRect );
+ void setPointer( const Pointer& rPointer );
- void setPointer( const Pointer& rPointer );
+private:
- private:
+ // Window
+ virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
+ virtual void KeyUp( const KeyEvent& rKEvt ) SAL_OVERRIDE;
+ virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
+ virtual void Resize() SAL_OVERRIDE;
+ virtual void StateChanged( StateChangedType ) SAL_OVERRIDE;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE; // const
+ virtual void GetFocus() SAL_OVERRIDE;
- // Window
- virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void KeyUp( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
- virtual void Resize() SAL_OVERRIDE;
- virtual void StateChanged( StateChangedType ) SAL_OVERRIDE;
- virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) SAL_OVERRIDE; // const
- virtual void GetFocus() SAL_OVERRIDE;
+ // DropTargetHelper
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
- // DropTargetHelper
- virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
- virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
+ // DragSourceHelper
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
- // DragSourceHelper
- virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
+ bool setZoom(css::media::ZoomLevel eLevel);
+ css::media::ZoomLevel getZoom() const;
- bool setZoom( ::com::sun::star::media::ZoomLevel eLevel );
- ::com::sun::star::media::ZoomLevel getZoom() const;
+ void stop();
- void stop();
+ bool isPlaying() const;
- bool isPlaying() const;
+ double getDuration() const;
- double getDuration() const;
+ void setMediaTime( double fTime );
+ double getMediaTime() const;
- void setMediaTime( double fTime );
- double getMediaTime() const;
+ void setPlaybackLoop( bool bSet );
+ bool isPlaybackLoop() const;
- void setPlaybackLoop( bool bSet );
- bool isPlaybackLoop() const;
+ void setMute( bool bSet );
+ bool isMute() const;
- void setMute( bool bSet );
- bool isMute() const;
+ void setVolumeDB( sal_Int16 nVolumeDB );
+ sal_Int16 getVolumeDB() const;
- void setVolumeDB( sal_Int16 nVolumeDB );
- sal_Int16 getVolumeDB() const;
+ void stopPlayingInternal( bool );
- void stopPlayingInternal( bool );
+ void onURLChanged();
- void onURLChanged();
+ static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rManagerServName,
+ css::uno::Reference<css::uno::XComponentContext> xContext);
- static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL, const OUString& rManagerServName, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext);
+ OUString maFileURL;
+ OUString mTempFileURL;
+ OUString maReferer;
+ OUString m_sMimeType;
+ css::uno::Reference<css::media::XPlayer> mxPlayer;
+ css::uno::Reference<css::media::XPlayerWindow> mxPlayerWindow;
+ MediaWindow* mpMediaWindow;
- OUString maFileURL;
- OUString mTempFileURL;
- OUString maReferer;
- OUString m_sMimeType;
- ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
- ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > mxPlayerWindow;
- MediaWindow* mpMediaWindow;
+ css::uno::Reference<css::uno::XInterface> mxEventsIf;
+ MediaEventListenersImpl* mpEvents;
+ bool mbEventTransparent;
+ VclPtr<MediaChildWindow> mpChildWindow;
+ VclPtr<MediaWindowControl> mpMediaWindowControl;
+ BitmapEx* mpEmptyBmpEx;
+ BitmapEx* mpAudioBmpEx;
+};
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxEventsIf;
- MediaEventListenersImpl* mpEvents;
- bool mbEventTransparent;
- VclPtr<MediaChildWindow> mpChildWindow;
- VclPtr<MediaWindowControl> mpMediaWindowControl;
- BitmapEx* mpEmptyBmpEx;
- BitmapEx* mpAudioBmpEx;
- };
- }
-}
+}} // end namespace avmedia::priv
#endif