Bump version to 6.4-15
[LibreOffice.git] / include / avmedia / mediawindow.hxx
blob78e0b1a299a385794e1f75ba78aff35e5b408909
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_MEDIAWINDOW_HXX
21 #define INCLUDED_AVMEDIA_MEDIAWINDOW_HXX
23 #include <vector>
24 #include <tools/gen.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <vcl/vclptr.hxx>
27 #include <avmedia/avmediadllapi.h>
29 #define AVMEDIA_FRAMEGRABBER_DEFAULTFRAME -1.0
31 namespace com::sun::star::graphic { class XGraphic; }
32 namespace com::sun::star::media { class XPlayer; }
34 namespace vcl { class Window; }
35 namespace weld { class Window; }
36 class KeyEvent;
37 class MouseEvent;
38 class CommandEvent;
39 struct AcceptDropEvent;
40 struct ExecuteDropEvent;
41 enum class PointerStyle;
44 namespace avmedia
46 typedef ::std::vector< ::std::pair< OUString, OUString > > FilterNameVector;
48 class MediaItem;
50 namespace priv { class MediaWindowImpl; }
52 class AVMEDIA_DLLPUBLIC MediaWindow
54 public:
55 MediaWindow( vcl::Window* parent, bool bInternalMediaControl );
56 virtual ~MediaWindow();
58 void setURL( const OUString& rURL, const OUString& rReferer );
59 const OUString& getURL() const;
61 bool isValid() const;
62 Size getPreferredSize() const;
64 vcl::Window* getWindow() const;
66 void setPosSize( const tools::Rectangle& rNewRect );
68 void setPointer( PointerStyle aPointer );
70 bool start();
72 void updateMediaItem( MediaItem& rItem ) const;
73 void executeMediaItem( const MediaItem& rItem );
75 void show();
76 void hide();
78 public:
80 virtual void MouseMove( const MouseEvent& rMEvt );
81 virtual void MouseButtonDown( const MouseEvent& rMEvt );
82 virtual void MouseButtonUp( const MouseEvent& rMEvt );
84 virtual void KeyInput( const KeyEvent& rKEvt );
85 virtual void KeyUp( const KeyEvent& rKEvt );
87 virtual void Command( const CommandEvent& rCEvt );
89 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
90 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
92 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
94 public:
96 static FilterNameVector getMediaFilters();
97 /// @param o_pbLink if not 0, this is an "insert" dialog: display link
98 /// checkbox and store its state in *o_pbLink
99 static bool executeMediaURLDialog(weld::Window* pParent, OUString& rURL, bool *const o_pbLink);
100 static void executeFormatErrorBox(weld::Window* pParent);
101 static bool isMediaURL( const OUString& rURL, const OUString& rReferer, bool bDeep = false, Size* pPreferredSizePixel = nullptr );
103 static css::uno::Reference< css::media::XPlayer > createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = nullptr );
105 static css::uno::Reference< css::graphic::XGraphic > grabFrame( const OUString& rURL, const OUString& rReferer,
106 const OUString& sMimeType );
108 private:
109 MediaWindow(const MediaWindow&) = delete;
110 MediaWindow& operator =( const MediaWindow& ) = delete;
112 VclPtr<priv::MediaWindowImpl> mpImpl;
116 #endif // INCLUDED_AVMEDIA_MEDIAWINDOW_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */