update credits
[LibreOffice.git] / include / avmedia / mediawindow.hxx
bloba5cb5dc8e7a8c6c121f837bd7f7e5cbf4b6c9404
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 _AVMEDIA_MEDIAWINDOW_HXX
21 #define _AVMEDIA_MEDIAWINDOW_HXX
23 #include <memory>
24 #include <vector>
25 #include <tools/gen.hxx>
26 #include <com/sun/star/media/ZoomLevel.hpp>
27 #include <com/sun/star/media/XPlayer.hpp>
28 #include <com/sun/star/graphic/XGraphic.hpp>
29 #include <com/sun/star/uno/XInterface.hpp>
30 #include <avmedia/avmediadllapi.h>
32 #define AVMEDIA_FRAMEGRABBER_DEFAULTFRAME -1.0
34 class Window;
35 class KeyEvent;
36 class MouseEvent;
37 class CommandEvent;
38 class PopupMenu;
39 class Pointer;
40 struct AcceptDropEvent;
41 struct ExecuteDropEvent;
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( Window* parent, bool bInternalMediaControl );
56 virtual ~MediaWindow();
58 void setURL( const OUString& rURL );
59 const OUString& getURL() const;
61 bool isValid() const;
62 Size getPreferredSize() const;
64 Window* getWindow() const;
66 void setPosSize( const Rectangle& rNewRect );
68 void setPointer( const Pointer& rPointer );
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 void getMediaFilters( FilterNameVector& rFilterNameVector );
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( Window* pParent,
100 OUString& rURL, bool *const o_pbLink );
101 static void executeFormatErrorBox( Window* pParent );
102 static bool isMediaURL( const OUString& rURL, bool bDeep = false, Size* pPreferredSizePixel = NULL );
104 static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL );
106 static ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > grabFrame( const OUString& rURL,
107 bool bAllowToCreateReplacementGraphic = false,
108 double fMediaTime = AVMEDIA_FRAMEGRABBER_DEFAULTFRAME );
110 private:
112 // default: disabled copy/assignment
113 AVMEDIA_DLLPRIVATE MediaWindow(const MediaWindow&);
114 AVMEDIA_DLLPRIVATE MediaWindow& operator =( const MediaWindow& );
116 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxIFace;
117 priv::MediaWindowImpl* mpImpl;
121 #endif // _AVMEDIA_MEDIAWINDOW_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */