1/* ============================================================================= 2 FILE: UKFNSubscribeFileWatcher.m 3 PROJECT: Filie 4 5 COPYRIGHT: (c) 2005 M. Uli Kusterer, all rights reserved. 6 7 AUTHORS: M. Uli Kusterer - UK 8 9 LICENSES: MIT License 10 11 REVISIONS: 12 2006-03-13 UK Commented, added singleton. 13 2005-03-02 UK Created. 14 ========================================================================== */ 15 16// ----------------------------------------------------------------------------- 17// Headers: 18// ----------------------------------------------------------------------------- 19 20#import <Cocoa/Cocoa.h> 21#import "UKFileWatcher.h" 22#import <Carbon/Carbon.h> 23 24/* 25 NOTE: FNSubscribe has a built-in delay: If your application is in the 26 background while the changes happen, all notifications will be queued up 27 and sent to your app at once the moment it is brought to front again. If 28 your app really needs to do live updates in the background, use a KQueue 29 instead. 30*/ 31 32// ----------------------------------------------------------------------------- 33// Class declaration: 34// ----------------------------------------------------------------------------- 35 36@interface UKFNSubscribeFileWatcher : NSObject <UKFileWatcher> 37{ 38 id delegate; // Delegate must respond to UKFileWatcherDelegate protocol. 39 NSMutableDictionary* subscriptions; // List of FNSubscription pointers in NSValues, with the pathnames as their keys. 40} 41 42+(id) sharedFileWatcher; 43 44// UKFileWatcher defines the methods: addPath: removePath: and delegate accessors. 45 46// Private: 47-(void) sendDelegateMessage: (FNMessage)message forSubscription: (FNSubscriptionRef)subscription; 48 49@end 50