bump product version to 6.3.0.0.beta1
[LibreOffice.git] / avmedia / source / viewer / mediawindow_impl.hxx
blobe188c88760040871358444f1f995793841f0cb7c
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 <vcl/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() override;
56 void execute( const MediaItem& rItem ) override;
59 class MediaChildWindow : public SystemChildWindow
61 public:
63 explicit MediaChildWindow( vcl::Window* pParent );
65 protected:
67 virtual void MouseMove( const MouseEvent& rMEvt ) override;
68 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
69 virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
70 virtual void KeyInput( const KeyEvent& rKEvt ) override;
71 virtual void KeyUp( const KeyEvent& rKEvt ) override;
72 virtual void Command( const CommandEvent& rCEvt ) override;
75 class MediaEventListenersImpl;
77 class MediaWindowImpl : public Control, public DropTargetHelper, public DragSourceHelper
79 public:
80 MediaWindowImpl(vcl::Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl);
81 virtual ~MediaWindowImpl() override;
83 virtual void dispose() override;
85 static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rReferer, const OUString* pMimeType);
87 void setURL(const OUString& rURL, OUString const& rTempURL, OUString const& rReferer);
89 const OUString& getURL() const;
91 bool isValid() const;
93 Size getPreferredSize() const;
95 bool start();
97 void updateMediaItem( MediaItem& rItem ) const;
98 void executeMediaItem( const MediaItem& rItem );
100 void setPosSize( const tools::Rectangle& rRect );
102 void setPointer( PointerStyle nPointer );
104 private:
106 // Window
107 virtual void MouseMove( const MouseEvent& rMEvt ) override;
108 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
109 virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
110 virtual void KeyInput( const KeyEvent& rKEvt ) override;
111 virtual void KeyUp( const KeyEvent& rKEvt ) override;
112 virtual void Command( const CommandEvent& rCEvt ) override;
113 virtual void Resize() override;
114 virtual void StateChanged( StateChangedType ) override;
115 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; // const
116 virtual void GetFocus() override;
118 // DropTargetHelper
119 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
120 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
122 // DragSourceHelper
123 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
125 void stop();
127 bool isPlaying() const;
129 double getDuration() const;
131 void setMediaTime( double fTime );
132 double getMediaTime() const;
134 void stopPlayingInternal( bool );
136 void onURLChanged();
138 static css::uno::Reference<css::media::XPlayer> createPlayer(const OUString& rURL, const OUString& rManagerServName,
139 const css::uno::Reference<css::uno::XComponentContext>& xContext);
141 OUString maFileURL;
142 OUString mTempFileURL;
143 OUString maReferer;
144 OUString m_sMimeType;
145 css::uno::Reference<css::media::XPlayer> mxPlayer;
146 css::uno::Reference<css::media::XPlayerWindow> mxPlayerWindow;
147 MediaWindow* mpMediaWindow;
149 rtl::Reference<MediaEventListenersImpl> mxEvents;
150 VclPtr<MediaChildWindow> mpChildWindow;
151 VclPtr<MediaWindowControl> mpMediaWindowControl;
152 std::unique_ptr<BitmapEx> mpEmptyBmpEx;
153 std::unique_ptr<BitmapEx> mpAudioBmpEx;
156 }} // end namespace avmedia::priv
158 #endif
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */