-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSSYNetServicesSearcher.h
83 lines (67 loc) · 2.49 KB
/
SSYNetServicesSearcher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#import <Cocoa/Cocoa.h>
extern NSString* const SSYNetServicesSearcherDidFindDomainNotification ;
extern NSString* const SSYNetServicesSearcherDidFindServiceNotification ;
extern NSString* const SSYNetServicesSearcherDidFinishNotification ;
extern NSString* const SSYNetServicesSearcherDidFailNotification ;
enum SSYNetServicesSearcherState_enum {
SSYNetServicesSearcherStateNotEvenStarted,
SSYNetServicesSearcherStateSearchingForDomains,
SSYNetServicesSearcherStateSearchingForServices,
SSYNetServicesSearcherStateDone,
SSYNetServicesSearcherStateStopped,
SSYNetServicesSearcherStateFailed
} ;
typedef enum SSYNetServicesSearcherState_enum SSYNetServicesSearcherState ;
@interface SSYNetServicesSearcher : NSObject
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
<NSNetServiceBrowserDelegate>
#endif
{
NSDictionary* targets ;
SSYNetServicesSearcherState state ;
NSMutableArray* domains ;
NSMutableArray* services ;
NSMutableArray* targetTypesForCurrentDomain ;
NSNetServiceBrowser* browser ;
NSError* error ;
}
/*!
@brief Accessor for the receiver's 'targets' property
@details Just in case you have some need to read it back.
*/
@property (readonly, retain) NSDictionary* targets ;
/*!
@brief The current state of the receiver.
*/
@property (readonly) SSYNetServicesSearcherState state ;
/*!
@brief The array of (NSString*) domains found by the receiver.
@details This array will grow as more domains are found.
*/
@property (readonly, retain) NSMutableArray* domains ;
/*!
@brief The array of (NSNetService*) services found by the receiver.
@details This array will grow as more services are found.
Services in all target domains and all types are combined into this
single array. If you specified multiple domains or targets,
you can distinguish them by sending -domain and/or -type
messages to each element in the array.
*/
@property (readonly, retain) NSMutableArray* services ;
/*!
@brief Any error encountered by the receiver.
@details If the receiver's state is SSYNetServicesSearcherStateFailed,
the value of this property will be an NSError indicating what went
wrong.
*/
@property (readonly, retain) NSError* error ;
/*!
@brief Designated initializer for its class.
@details
@param targets A dictionary indicating what domains and
service types are to be searched for. Each key in the
dictionary should be a target domain, and its value should
be an array of target types for that domain.
*/
- (id) initWithTargets:(NSDictionary*)targets ;
@end