jens@26: // jens@26: // MYBonjourBrowser.h jens@26: // MYNetwork jens@26: // jens@26: // Created by Jens Alfke on 1/22/08. jens@26: // Copyright 2008 Jens Alfke. All rights reserved. jens@26: // jens@26: jens@26: #import jens@26: jens@26: jens@26: /** Searches for Bonjour services of a specific type. */ jens@26: @interface MYBonjourBrowser : NSObject jens@26: { jens@26: @private jens@26: NSString *_serviceType; jens@26: NSNetServiceBrowser *_browser; jens@26: BOOL _browsing; jens@26: NSError *_error; jens@26: Class _serviceClass; jens@26: NSMutableSet *_services, *_addServices, *_rmvServices; jens@26: } jens@26: jens@26: /** Initializes a new BonjourBrowser. jens@26: Call -start to begin browsing. jens@26: @param serviceType The name of the service type to look for, e.g. "_http._tcp". */ jens@26: - (id) initWithServiceType: (NSString*)serviceType; jens@26: jens@26: /** Starts browsing. This is asynchronous, so nothing will happen immediately. */ jens@26: - (void) start; jens@26: jens@26: /** Stops browsing. */ jens@26: - (void) stop; jens@26: jens@26: /** Is the browser currently browsing? */ jens@26: @property (readonly) BOOL browsing; jens@26: jens@26: /** The current error status, if any. jens@26: This is KV-observable. */ jens@26: @property (readonly,retain) NSError* error; jens@26: jens@26: /** The set of currently found services. These are instances of the serviceClass, jens@26: which is BonjourService by default. jens@26: This is KV-observable. */ jens@26: @property (readonly) NSSet *services; jens@26: jens@26: /** The class of objects to create to represent services. jens@26: The default value is [BonjourService class]; you can change this, but only jens@26: to a subclass of that. */ jens@26: @property Class serviceClass; jens@26: jens@26: @end