RSS

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

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

« back to all changes in this revision

Viewing changes to tappity/source/BonjourSupport/DomainViewController.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: DomainViewController.h 
 
4
Abstract:  View controller for the domain list.
 
5
 This object manages a NSNetServiceBrowser configured to look for Bonjour
 
6
domains.
 
7
 It has two arrays of NSString objects that are displayed in two sections of a
 
8
table view.
 
9
 When the service browser reports that it has discovered a domain, that domain
 
10
is added to the first array.
 
11
 When a domain goes away it is removed from the first array.
 
12
 It allows the user to add/remove their own domains from the second array, which
 
13
is displayed in the second section of the table.
 
14
 When an item in the table view is selected, the delegate is called with the
 
15
corresponding domain.
 
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
#import "SimpleEditViewController.h"
 
65
 
 
66
@class DomainViewController;
 
67
 
 
68
@protocol DomainViewControllerDelegate <NSObject>
 
69
@required
 
70
// This method will be invoked when the user selects one of the domains from the list.
 
71
// The domain parameter will be the selected domain or nil if the user taps the 'Cancel' button (if shown)
 
72
- (void) domainViewController:(DomainViewController*)dvc didSelectDomain:(NSString*)domain;
 
73
@end
 
74
 
 
75
@interface DomainViewController : UITableViewController <SimpleEditViewControllerDelegate> {
 
76
        id<DomainViewControllerDelegate> _delegate;
 
77
        BOOL _showDisclosureIndicators;
 
78
        NSMutableArray* _domains;
 
79
        NSMutableArray* _customs;
 
80
        NSString* _customTitle;
 
81
        NSString* _addDomainTitle;
 
82
        NSNetServiceBrowser* _netServiceBrowser;
 
83
        BOOL _showCancelButton;
 
84
}
 
85
 
 
86
@property(nonatomic, assign) id<DomainViewControllerDelegate> delegate;
 
87
 
 
88
- (id)initWithTitle:(NSString *)title showDisclosureIndicators:(BOOL)showDisclosureIndicators customsTitle:(NSString*)customsTitle customs:(NSMutableArray*)customs addDomainTitle:(NSString*)addDomainTitle showCancelButton:(BOOL)showCancelButton;
 
89
- (BOOL)searchForBrowsableDomains;
 
90
- (BOOL)searchForRegistrationDomains;
 
91
 
 
92
@end

Loggerhead 1.17 is a web-based interface for Bazaar branches