tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / avmedia / source / macavf / window.hxx
blob14fdaf389811d7acc3ee39b0feda00692646ec70
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 #pragma once
22 #include "macavfcommon.hxx"
23 #include <cppuhelper/implbase.hxx>
24 #include <comphelper/multicontainer2.hxx>
26 #include <com/sun/star/media/XPlayerWindow.hpp>
29 @interface MyMediaView : NSView
30 @property (nonatomic, readonly, strong) AVPlayer* player;
31 @property (nonatomic, readonly, strong) AVPlayerLayer* playerLayer;
32 @property (nonatomic, retain) NSURL* videoURL;
33 - (void) play;
34 @end
36 namespace avmedia::macavf {
38 class Player;
40 class Window
41 : public MacAVObserverHandler
42 , public ::cppu::WeakImplHelper< css::media::XPlayerWindow,
43 css::lang::XServiceInfo >
45 public:
47 Window( Player& i_rPlayer,
48 NSView* i_pParentView
50 virtual ~Window() override;
52 void processGraphEvent();
53 void updatePointer();
55 // XPlayerWindow
56 virtual void SAL_CALL update( ) override;
57 virtual sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel ) override;
58 virtual css::media::ZoomLevel SAL_CALL getZoomLevel( ) override;
59 virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) override;
61 // XWindow
62 virtual void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) override;
63 virtual css::awt::Rectangle SAL_CALL getPosSize( ) override;
64 virtual void SAL_CALL setVisible( sal_Bool Visible ) override;
65 virtual void SAL_CALL setEnable( sal_Bool Enable ) override;
66 virtual void SAL_CALL setFocus( ) override;
67 virtual void SAL_CALL addWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) override;
68 virtual void SAL_CALL removeWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) override;
69 virtual void SAL_CALL addFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) override;
70 virtual void SAL_CALL removeFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) override;
71 virtual void SAL_CALL addKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) override;
72 virtual void SAL_CALL removeKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) override;
73 virtual void SAL_CALL addMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
74 virtual void SAL_CALL removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
75 virtual void SAL_CALL addMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
76 virtual void SAL_CALL removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
77 virtual void SAL_CALL addPaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
78 virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
80 // XComponent
81 virtual void SAL_CALL dispose( ) override;
82 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
83 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
85 // XServiceInfo
86 virtual OUString SAL_CALL getImplementationName( ) override;
87 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
88 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
90 virtual bool handleObservation( NSString* pKeyPath ) override;
92 private:
94 ::osl::Mutex maMutex;
95 comphelper::OMultiTypeInterfaceContainerHelper2 maListeners;
96 css::media::ZoomLevel meZoomLevel;
97 Player& mrPlayer;
98 int mnPointerType;
100 NSView* mpView; // parent-view == movie-view
101 AVPlayerLayer* mpPlayerLayer;
103 void ImplLayoutVideoWindow();
106 } // namespace avmedia::macavf
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */