1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef MACAVF_COMMON_HXX
23 #define MACAVF_COMMON_HXX
24 
25 #ifdef MACOSX
26 #include <premac.h>
27 #import <Cocoa/Cocoa.h>
28 #import <AVFoundation/AVFoundation.h>
29 #include <postmac.h>
30 #endif
31 #include <osl/mutex.hxx>
32 #include <rtl/ustring.hxx>
33 #include <tools/debug.hxx>
34 #include <tools/stream.hxx>
35 #include <tools/string.hxx>
36 #include <tools/urlobj.hxx>
37 #include <cppuhelper/implbase1.hxx>
38 #include <cppuhelper/implbase2.hxx>
39 #include <cppuhelper/weak.hxx>
40 #include <cppuhelper/factory.hxx>
41 
42 #include <com/sun/star/uno/Reference.h>
43 #include <com/sun/star/uno/RuntimeException.hpp>
44 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
45 #include <com/sun/star/lang/XComponent.hpp>
46 #include <com/sun/star/registry/XRegistryKey.hpp>
47 #include <com/sun/star/lang/XComponent.hpp>
48 #include <com/sun/star/lang/XServiceInfo.hpp>
49 #include <com/sun/star/awt/Rectangle.hpp>
50 #include <com/sun/star/awt/KeyModifier.hpp>
51 #include <com/sun/star/awt/MouseButton.hpp>
52 #include <com/sun/star/media/XManager.hpp>
53 
54 
55 #define AVMEDIA_MACAVF_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_MacAVF"
56 #define AVMEDIA_MACAVF_MANAGER_SERVICENAME "com.sun.star.media.Manager_MacAVF"
57 
58 #define AVMEDIA_MACAVF_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_MacAVF"
59 #define AVMEDIA_MACAVF_PLAYER_SERVICENAME "com.sun.star.media.Player_MacAVF"
60 
61 #define AVMEDIA_MACAVF_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_MacAVF"
62 #define AVMEDIA_MACAVF_WINDOW_SERVICENAME "com.sun.star.media.Window_MacAVF"
63 
64 #define AVMEDIA_MACAVF_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_MacAVF"
65 #define AVMEDIA_MACAVF_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_MacAVF"
66 
67 
68 // MacAVObserver handles the notifications used in the AVFoundation framework
69 
70 @interface MacAVObserverObject : NSObject
71 - (void)observeValueForKeyPath:(NSString*)pKeyPath ofObject:(id)pObject change:(NSDictionary*)pChangeDict context:(void*)pContext;
72 - (void)onNotification:(NSNotification*)pNotification;
73 @end
74 
75 namespace avmedia { namespace macavf {
76 
77 class MacAVObserverHandler
78 {
79 private:
80     static MacAVObserverObject* mpMacAVObserverObject;
81 public:
82     MacAVObserverObject* getObserver( void ) const;
83     virtual bool handleObservation( NSString* pKeyPath ) = 0;
84 };
85 
86 }}
87 
88 #endif // MACAVF_COMMON_HXX
89 
90