RSS

(root)/iphone/tappity : 46 : tappity/source/BonjourSupport/BrowserViewController.h

To get this branch, use:
bzr branch /browse/iphone/tappity

« back to all changes in this revision

Viewing changes to tappity/source/BonjourSupport/BrowserViewController.h

Dömötör Gulyás
2009-10-27 01:03:19
Revision ID: dognotdog@gmail.com-20091027000319-1vrkixkgf9lkud6g
adds tappity project

Show diffs side-by-side

added added

removed removed

 
1
/*
 
2
 
 
3
    File: BrowserViewController.h 
 
4
Abstract:  View controller for the service instance list.
 
5
 This object manages a NSNetServiceBrowser configured to look for Bonjour
 
6
services.
 
7
 It has an array of NSNetService objects that are displayed in a table view.
 
8
 When the service browser reports that it has discovered a service, the
 
9
corresponding NSNetService is added to the array.
 
10
 When a service goes away, the corresponding NSNetService is removed from the
 
11
array.
 
12
 Selecting an item in the table view asynchronously resolves the corresponding
 
13
net service.
 
14
 When that resolution completes, the delegate is called with the corresponding
 
15
NSNetService.
 
16
 
 
17
 Version: 2.8 
 
18
 
 
19
Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple 
 
20
Inc. ("Apple") in consideration of your agreement to the following 
 
21
terms, and your use, installation, modification or redistribution of 
 
22
this Apple software constitutes acceptance of these terms.  If you do 
 
23
not agree with these terms, please do not use, install, modify or 
 
24
redistribute this Apple software. 
 
25
 
 
26
In consideration of your agreement to abide by the following terms, and 
 
27
subject to these terms, Apple grants you a personal, non-exclusive 
 
28
license, under Apple's copyrights in this original Apple software (the 
 
29
"Apple Software"), to use, reproduce, modify and redistribute the Apple 
 
30
Software, with or without modifications, in source and/or binary forms; 
 
31
provided that if you redistribute the Apple Software in its entirety and 
 
32
without modifications, you must retain this notice and the following 
 
33
text and disclaimers in all such redistributions of the Apple Software. 
 
34
Neither the name, trademarks, service marks or logos of Apple Inc. may 
 
35
be used to endorse or promote products derived from the Apple Software 
 
36
without specific prior written permission from Apple.  Except as 
 
37
expressly stated in this notice, no other rights or licenses, express or 
 
38
implied, are granted by Apple herein, including but not limited to any 
 
39
patent rights that may be infringed by your derivative works or by other 
 
40
works in which the Apple Software may be incorporated. 
 
41
 
 
42
The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
 
43
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
 
44
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
 
45
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
 
46
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
 
47
 
 
48
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
 
49
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 
50
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 
51
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
 
52
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
 
53
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
 
54
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
 
55
POSSIBILITY OF SUCH DAMAGE. 
 
56
 
 
57
Copyright (C) 2009 Apple Inc. All Rights Reserved. 
 
58
 
 
59
 
 
60
*/
 
61
 
 
62
#import <UIKit/UIKit.h>
 
63
#import <Foundation/NSNetServices.h>
 
64
 
 
65
@class BrowserViewController;
 
66
 
 
67
@protocol BrowserViewControllerDelegate <NSObject>
 
68
@required
 
69
// This method will be invoked when the user selects one of the service instances from the list.
 
70
// The ref parameter will be the selected (already resolved) instance or nil if the user taps the 'Cancel' button (if shown).
 
71
- (void) browserViewController:(BrowserViewController*)bvc didResolveInstance:(NSNetService*)ref;
 
72
@end
 
73
 
 
74
@interface BrowserViewController : UITableViewController {
 
75
 
 
76
@private
 
77
        id<BrowserViewControllerDelegate> _delegate;
 
78
        NSString* _searchingForServicesString;
 
79
        BOOL _showDisclosureIndicators;
 
80
        NSMutableArray* _services;
 
81
        NSNetServiceBrowser* _netServiceBrowser;
 
82
        NSNetService* _currentResolve;
 
83
        NSTimer* _timer;
 
84
        BOOL _needsActivityIndicator;
 
85
        BOOL _initialWaitOver;
 
86
}
 
87
 
 
88
@property (nonatomic, assign) id<BrowserViewControllerDelegate> delegate;
 
89
@property (nonatomic, copy) NSString* searchingForServicesString;
 
90
 
 
91
- (id)initWithTitle:(NSString *)title showDisclosureIndicators:(BOOL)showDisclosureIndicators showCancelButton:(BOOL)showCancelButton;
 
92
- (BOOL)searchForServicesOfType:(NSString *)type inDomain:(NSString *)domain;
 
93
 
 
94
@end

Loggerhead 1.17 is a web-based interface for Bazaar branches