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