1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_AVMEDIA_SOURCE_VIEWER_MEDIAWINDOW_IMPL_HXX
21 #define INCLUDED_AVMEDIA_SOURCE_VIEWER_MEDIAWINDOW_IMPL_HXX
23 #include <svtools/transfer.hxx>
24 #include <vcl/syschild.hxx>
26 #include "mediacontrol.hxx"
28 namespace com
{ namespace sun
{ namespace star
{ namespace media
{
33 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
34 class XComponentContext
;
47 class MediaWindowControl
: public MediaControl
51 explicit MediaWindowControl( vcl::Window
* pParent
);
55 void update() SAL_OVERRIDE
;
56 void execute( const MediaItem
& rItem
) SAL_OVERRIDE
;
59 class MediaChildWindow
: public SystemChildWindow
63 explicit MediaChildWindow( vcl::Window
* pParent
);
64 MediaChildWindow( vcl::Window
* pParent
, SystemWindowData
* pData
);
68 virtual void MouseMove( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
69 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
70 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
71 virtual void KeyInput( const KeyEvent
& rKEvt
) SAL_OVERRIDE
;
72 virtual void KeyUp( const KeyEvent
& rKEvt
) SAL_OVERRIDE
;
73 virtual void Command( const CommandEvent
& rCEvt
) SAL_OVERRIDE
;
76 class MediaEventListenersImpl
;
78 class MediaWindowImpl
: public Control
, public DropTargetHelper
, public DragSourceHelper
81 MediaWindowImpl(vcl::Window
* parent
, MediaWindow
* pMediaWindow
, bool bInternalMediaControl
);
82 virtual ~MediaWindowImpl();
84 virtual void dispose() SAL_OVERRIDE
;
86 static css::uno::Reference
<css::media::XPlayer
> createPlayer(const OUString
& rURL
, const OUString
& rReferer
, const OUString
* pMimeType
= 0);
88 void setURL(const OUString
& rURL
, OUString
const& rTempURL
, OUString
const& rReferer
);
90 const OUString
& getURL() const;
94 Size
getPreferredSize() const;
98 void updateMediaItem( MediaItem
& rItem
) const;
99 void executeMediaItem( const MediaItem
& rItem
);
101 void setPosSize( const Rectangle
& rRect
);
103 void setPointer( const Pointer
& rPointer
);
108 virtual void MouseMove( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
109 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
110 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
111 virtual void KeyInput( const KeyEvent
& rKEvt
) SAL_OVERRIDE
;
112 virtual void KeyUp( const KeyEvent
& rKEvt
) SAL_OVERRIDE
;
113 virtual void Command( const CommandEvent
& rCEvt
) SAL_OVERRIDE
;
114 virtual void Resize() SAL_OVERRIDE
;
115 virtual void StateChanged( StateChangedType
) SAL_OVERRIDE
;
116 virtual void Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
&) SAL_OVERRIDE
; // const
117 virtual void GetFocus() SAL_OVERRIDE
;
120 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
) SAL_OVERRIDE
;
121 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
) SAL_OVERRIDE
;
124 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
) SAL_OVERRIDE
;
126 bool setZoom(css::media::ZoomLevel eLevel
);
127 css::media::ZoomLevel
getZoom() const;
131 bool isPlaying() const;
133 double getDuration() const;
135 void setMediaTime( double fTime
);
136 double getMediaTime() const;
138 void setPlaybackLoop( bool bSet
);
139 bool isPlaybackLoop() const;
141 void setMute( bool bSet
);
144 void setVolumeDB( sal_Int16 nVolumeDB
);
145 sal_Int16
getVolumeDB() const;
147 void stopPlayingInternal( bool );
151 static css::uno::Reference
<css::media::XPlayer
> createPlayer(const OUString
& rURL
, const OUString
& rManagerServName
,
152 css::uno::Reference
<css::uno::XComponentContext
> xContext
);
155 OUString mTempFileURL
;
157 OUString m_sMimeType
;
158 css::uno::Reference
<css::media::XPlayer
> mxPlayer
;
159 css::uno::Reference
<css::media::XPlayerWindow
> mxPlayerWindow
;
160 MediaWindow
* mpMediaWindow
;
162 css::uno::Reference
<css::uno::XInterface
> mxEventsIf
;
163 MediaEventListenersImpl
* mpEvents
;
164 bool mbEventTransparent
;
165 VclPtr
<MediaChildWindow
> mpChildWindow
;
166 VclPtr
<MediaWindowControl
> mpMediaWindowControl
;
167 BitmapEx
* mpEmptyBmpEx
;
168 BitmapEx
* mpAudioBmpEx
;
171 }} // end namespace avmedia::priv
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */