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 INCLUDED_AVMEDIA_SOURCE_MACAVF_MACAVFCOMMON_HXX
21 #define INCLUDED_AVMEDIA_SOURCE_MACAVF_MACAVFCOMMON_HXX
24 #import <Cocoa/Cocoa.h>
25 #import <AVFoundation/AVFoundation.h>
28 #include <unordered_map>
30 #include <osl/mutex.hxx>
31 #include <rtl/ustring.hxx>
32 #include <tools/stream.hxx>
33 #include <tools/urlobj.hxx>
34 #include <cppuhelper/implbase1.hxx>
35 #include <cppuhelper/implbase2.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <cppuhelper/factory.hxx>
39 #include <com/sun/star/uno/Reference.h>
40 #include <com/sun/star/uno/RuntimeException.hpp>
41 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
42 #include <com/sun/star/lang/XComponent.hpp>
43 #include <com/sun/star/registry/XRegistryKey.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/awt/Rectangle.hpp>
46 #include <com/sun/star/awt/KeyModifier.hpp>
47 #include <com/sun/star/awt/MouseButton.hpp>
48 #include <com/sun/star/media/XManager.hpp>
51 #define AVMEDIA_MACAVF_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_MacAVF"
52 #define AVMEDIA_MACAVF_MANAGER_SERVICENAME "com.sun.star.media.Manager_MacAVF"
54 #define AVMEDIA_MACAVF_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_MacAVF"
55 #define AVMEDIA_MACAVF_PLAYER_SERVICENAME "com.sun.star.media.Player_MacAVF"
57 #define AVMEDIA_MACAVF_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_MacAVF"
58 #define AVMEDIA_MACAVF_WINDOW_SERVICENAME "com.sun.star.media.Window_MacAVF"
60 #define AVMEDIA_MACAVF_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_MacAVF"
61 #define AVMEDIA_MACAVF_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_MacAVF"
64 // MacAVObserver handles the notifications used in the AVFoundation framework
66 namespace avmedia
{ namespace macavf
{
67 class MacAVObserverHandler
;
70 typedef std::unordered_map
<NSObject
*,avmedia::macavf::MacAVObserverHandler
*> HandlersForObject
;
72 @interface MacAVObserverObject
: NSObject
74 HandlersForObject maHandlersForObject
;
76 - (void)observeValueForKeyPath
:(NSString
*)pKeyPath ofObject
:(id
)pObject change
:(NSDictionary
*)pChangeDict context
:(void*)pContext
;
77 - (void)onNotification
:(NSNotification
*)pNotification
;
80 namespace avmedia
{ namespace macavf
{
82 class MacAVObserverHandler
85 static MacAVObserverObject
* mpMacAVObserverObject
;
87 virtual ~MacAVObserverHandler() {}
88 static MacAVObserverObject
* getObserver();
89 virtual bool handleObservation( NSString
* pKeyPath
) = 0;
94 #endif // INCLUDED_AVMEDIA_SOURCE_MACAVF_MACAVFCOMMON_HXX
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */