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 _AVMEDIA_MEDIAWINDOW_HXX
21 #define _AVMEDIA_MEDIAWINDOW_HXX
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
40 struct AcceptDropEvent
;
41 struct ExecuteDropEvent
;
46 typedef ::std::vector
< ::std::pair
< OUString
, OUString
> > FilterNameVector
;
50 namespace priv
{ class MediaWindowImpl
; }
52 class AVMEDIA_DLLPUBLIC MediaWindow
55 MediaWindow( Window
* parent
, bool bInternalMediaControl
);
56 virtual ~MediaWindow();
58 void setURL( const OUString
& rURL
);
59 const OUString
& getURL() const;
62 Size
getPreferredSize() const;
64 Window
* getWindow() const;
66 void setPosSize( const Rectangle
& rNewRect
);
68 void setPointer( const Pointer
& rPointer
);
72 void updateMediaItem( MediaItem
& rItem
) const;
73 void executeMediaItem( const MediaItem
& rItem
);
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
);
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
);
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: */