fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / avmedia / source / viewer / mediawindow_impl.hxx
blobb73413d8e36ed396657f2645afad2c51bdb13ef2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 {
29 class XPlayer;
30 class XPlayerWindow;
31 }}}}
33 namespace com { namespace sun { namespace star { namespace uno {
34 class XComponentContext;
35 }}}}
37 class BitmapEx;
39 namespace avmedia
42 class MediaWindow;
44 namespace priv
47 class MediaWindowControl : public MediaControl
49 public:
51 explicit MediaWindowControl( vcl::Window* pParent );
53 protected:
55 void update() SAL_OVERRIDE;
56 void execute( const MediaItem& rItem ) SAL_OVERRIDE;
59 class MediaChildWindow : public SystemChildWindow
61 public:
63 explicit MediaChildWindow( vcl::Window* pParent );
64 MediaChildWindow( vcl::Window* pParent, SystemWindowData* pData );
66 protected:
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
80 public:
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;
92 bool isValid() const;
94 Size getPreferredSize() const;
96 bool start();
98 void updateMediaItem( MediaItem& rItem ) const;
99 void executeMediaItem( const MediaItem& rItem );
101 void setPosSize( const Rectangle& rRect );
103 void setPointer( const Pointer& rPointer );
105 private:
107 // Window
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;
119 // DropTargetHelper
120 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
121 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
123 // DragSourceHelper
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;
129 void stop();
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 );
142 bool isMute() const;
144 void setVolumeDB( sal_Int16 nVolumeDB );
145 sal_Int16 getVolumeDB() const;
147 void stopPlayingInternal( bool );
149 void onURLChanged();
151 static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rManagerServName,
152 css::uno::Reference<css::uno::XComponentContext> xContext);
154 OUString maFileURL;
155 OUString mTempFileURL;
156 OUString maReferer;
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
173 #endif
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */