Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / avmedia / source / macavf / window.hxx
blob54c9038ced3a9c6a31df872250b719c577445a62
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_MACAVF_WINDOW_HXX
21 #define INCLUDED_AVMEDIA_SOURCE_MACAVF_WINDOW_HXX
23 #include "macavfcommon.hxx"
24 #include <cppuhelper/implbase.hxx>
25 #include <cppuhelper/interfacecontainer.h>
27 #include "com/sun/star/media/XPlayerWindow.hpp"
30 @interface MyMediaView : NSView
31 @property (nonatomic, readonly, strong) AVPlayer* player;
32 @property (nonatomic, readonly, strong) AVPlayerLayer* playerLayer;
33 @property (nonatomic, retain) NSURL* videoURL;
34 - (void) play;
35 @end
37 namespace avmedia { namespace macavf {
39 class Player;
41 class Window
42 : public MacAVObserverHandler
43 , public ::cppu::WeakImplHelper< css::media::XPlayerWindow,
44 css::lang::XServiceInfo >
46 public:
48 Window( const css::uno::Reference< css::lang::XMultiServiceFactory >& i_rxMgr,
49 Player& i_rPlayer,
50 NSView* i_pParentView
52 virtual ~Window() override;
54 void processGraphEvent();
55 void updatePointer();
57 // XPlayerWindow
58 virtual void SAL_CALL update( ) override;
59 virtual sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel ) override;
60 virtual css::media::ZoomLevel SAL_CALL getZoomLevel( ) override;
61 virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) override;
63 // XWindow
64 virtual void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) override;
65 virtual css::awt::Rectangle SAL_CALL getPosSize( ) override;
66 virtual void SAL_CALL setVisible( sal_Bool Visible ) override;
67 virtual void SAL_CALL setEnable( sal_Bool Enable ) override;
68 virtual void SAL_CALL setFocus( ) override;
69 virtual void SAL_CALL addWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) override;
70 virtual void SAL_CALL removeWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) override;
71 virtual void SAL_CALL addFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) override;
72 virtual void SAL_CALL removeFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) override;
73 virtual void SAL_CALL addKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) override;
74 virtual void SAL_CALL removeKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) override;
75 virtual void SAL_CALL addMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
76 virtual void SAL_CALL removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
77 virtual void SAL_CALL addMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
78 virtual void SAL_CALL removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
79 virtual void SAL_CALL addPaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
80 virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
82 // XComponent
83 virtual void SAL_CALL dispose( ) override;
84 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
85 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
87 // XServiceInfo
88 virtual ::rtl::OUString SAL_CALL getImplementationName( ) override;
89 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) override;
90 virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) override;
92 virtual bool handleObservation( NSString* pKeyPath ) override;
94 private:
96 css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
98 ::osl::Mutex maMutex;
99 ::cppu::OMultiTypeInterfaceContainerHelper maListeners;
100 css::media::ZoomLevel meZoomLevel;
101 Player& mrPlayer;
102 int mnPointerType;
104 NSView* mpView; // parent-view == movie-view
105 AVPlayerLayer* mpPlayerLayer;
107 void ImplLayoutVideoWindow();
110 } // namespace macavf
111 } // namespace avmedia
113 #endif // INCLUDED_AVMEDIA_SOURCE_MACAVF_WINDOW_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */