xref: /AOO42X/main/avmedia/source/macavf/macavf_common.hxx (revision 4fd1f73c4b49c45d0e8de944a2a1800acf7734df)
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/uno/XComponentContext.hpp>
45 #include <com/sun/star/registry/XRegistryKey.hpp>
46 #include <com/sun/star/lang/XComponent.hpp>
47 #include <com/sun/star/lang/XServiceInfo.hpp>
48 #include <com/sun/star/awt/Rectangle.hpp>
49 #include <com/sun/star/awt/KeyModifier.hpp>
50 #include <com/sun/star/awt/MouseButton.hpp>
51 #include <com/sun/star/media/XManager.hpp>
52 
53 #define AVMEDIA_MACAVF_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_MacAVF"
54 #define AVMEDIA_MACAVF_MANAGER_SERVICENAME "com.sun.star.media.Manager_MacAVF"
55 
56 #define AVMEDIA_MACAVF_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_MacAVF"
57 #define AVMEDIA_MACAVF_PLAYER_SERVICENAME "com.sun.star.media.Player_MacAVF"
58 
59 #define AVMEDIA_MACAVF_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_MacAVF"
60 #define AVMEDIA_MACAVF_WINDOW_SERVICENAME "com.sun.star.media.Window_MacAVF"
61 
62 #define AVMEDIA_MACAVF_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_MacAVF"
63 #define AVMEDIA_MACAVF_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_MacAVF"
64 
65 
66 // MacAVObserver handles the notifications used in the AVFoundation framework
67 
68 @interface MacAVObserverObject : NSObject
69 - (void)observeValueForKeyPath:(NSString*)pKeyPath ofObject:(id)pObject change:(NSDictionary*)pChangeDict context:(void*)pContext;
70 - (void)onNotification:(NSNotification*)pNotification;
71 @end
72 
73 namespace avmedia { namespace macavf {
74 
75 class MacAVObserverHandler
76 {
77 private:
78     static MacAVObserverObject* mpMacAVObserverObject;
79 public:
80     MacAVObserverObject* getObserver( void ) const;
81     virtual bool handleObservation( NSString* pKeyPath ) = 0;
82 };
83 
84 }}
85 
86 #endif // MACAVF_COMMON_HXX
87 
88 /* vim: set noet sw=4 ts=4: */
89