1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Bonjour/MYBonjourBrowser.h Sun Apr 26 18:12:44 2009 -0700
1.3 @@ -0,0 +1,52 @@
1.4 +//
1.5 +// MYBonjourBrowser.h
1.6 +// MYNetwork
1.7 +//
1.8 +// Created by Jens Alfke on 1/22/08.
1.9 +// Copyright 2008 Jens Alfke. All rights reserved.
1.10 +//
1.11 +
1.12 +#import <Foundation/Foundation.h>
1.13 +
1.14 +
1.15 +/** Searches for Bonjour services of a specific type. */
1.16 +@interface MYBonjourBrowser : NSObject
1.17 +{
1.18 + @private
1.19 + NSString *_serviceType;
1.20 + NSNetServiceBrowser *_browser;
1.21 + BOOL _browsing;
1.22 + NSError *_error;
1.23 + Class _serviceClass;
1.24 + NSMutableSet *_services, *_addServices, *_rmvServices;
1.25 +}
1.26 +
1.27 +/** Initializes a new BonjourBrowser.
1.28 + Call -start to begin browsing.
1.29 + @param serviceType The name of the service type to look for, e.g. "_http._tcp". */
1.30 +- (id) initWithServiceType: (NSString*)serviceType;
1.31 +
1.32 +/** Starts browsing. This is asynchronous, so nothing will happen immediately. */
1.33 +- (void) start;
1.34 +
1.35 +/** Stops browsing. */
1.36 +- (void) stop;
1.37 +
1.38 +/** Is the browser currently browsing? */
1.39 +@property (readonly) BOOL browsing;
1.40 +
1.41 +/** The current error status, if any.
1.42 + This is KV-observable. */
1.43 +@property (readonly,retain) NSError* error;
1.44 +
1.45 +/** The set of currently found services. These are instances of the serviceClass,
1.46 + which is BonjourService by default.
1.47 + This is KV-observable. */
1.48 +@property (readonly) NSSet *services;
1.49 +
1.50 +/** The class of objects to create to represent services.
1.51 + The default value is [BonjourService class]; you can change this, but only
1.52 + to a subclass of that. */
1.53 +@property Class serviceClass;
1.54 +
1.55 +@end