LibreOffice Module avmedia (master) 1
macavfcommon.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <premac.h>
23#import <Cocoa/Cocoa.h>
24#import <AVFoundation/AVFoundation.h>
25#include <postmac.h>
26
27#include <unordered_map>
28
29#include <osl/mutex.hxx>
30#include <rtl/ustring.hxx>
31#include <tools/stream.hxx>
32#include <tools/urlobj.hxx>
33#include <cppuhelper/weak.hxx>
35
36#include <com/sun/star/uno/Reference.h>
37#include <com/sun/star/uno/RuntimeException.hpp>
38#include <com/sun/star/lang/XMultiServiceFactory.hpp>
39#include <com/sun/star/lang/XComponent.hpp>
40#include <com/sun/star/registry/XRegistryKey.hpp>
41#include <com/sun/star/lang/XServiceInfo.hpp>
42#include <com/sun/star/awt/Rectangle.hpp>
43#include <com/sun/star/awt/KeyModifier.hpp>
44#include <com/sun/star/awt/MouseButton.hpp>
45#include <com/sun/star/media/XManager.hpp>
46
47
48#define AVMEDIA_MACAVF_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_MacAVF"
49#define AVMEDIA_MACAVF_PLAYER_SERVICENAME "com.sun.star.media.Player_MacAVF"
50
51#define AVMEDIA_MACAVF_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_MacAVF"
52#define AVMEDIA_MACAVF_WINDOW_SERVICENAME "com.sun.star.media.Window_MacAVF"
53
54#define AVMEDIA_MACAVF_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_MacAVF"
55#define AVMEDIA_MACAVF_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_MacAVF"
56
57
58// MacAVObserver handles the notifications used in the AVFoundation framework
59
60namespace avmedia::macavf { class MacAVObserverHandler; }
61
62typedef std::unordered_map<NSObject*,avmedia::macavf::MacAVObserverHandler*> HandlersForObject;
63
64@interface MacAVObserverObject : NSObject
65{
67}
68- (void)observeValueForKeyPath:(NSString*)pKeyPath ofObject:(id)pObject change:(NSDictionary*)pChangeDict context:(void*)pContext;
69- (void)onNotification:(NSNotification*)pNotification;
70@end
71
72namespace avmedia::macavf {
73
75{
76private:
78public:
80 static MacAVObserverObject* getObserver();
81 virtual bool handleObservation( NSString* pKeyPath ) = 0;
82};
83
84}
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool handleObservation(NSString *pKeyPath)=0
static MacAVObserverObject * mpMacAVObserverObject
HandlersForObject maHandlersForObject
std::unordered_map< NSObject *, avmedia::macavf::MacAVObserverHandler * > HandlersForObject