3
File: DomainViewController.h
4
Abstract: View controller for the domain list.
5
This object manages a NSNetServiceBrowser configured to look for Bonjour
7
It has two arrays of NSString objects that are displayed in two sections of a
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
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.
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.
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.
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.
57
Copyright (C) 2009 Apple Inc. All Rights Reserved.
62
#import <UIKit/UIKit.h>
63
#import <Foundation/NSNetServices.h>
64
#import "SimpleEditViewController.h"
66
@class DomainViewController;
68
@protocol DomainViewControllerDelegate <NSObject>
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;
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;
86
@property(nonatomic, assign) id<DomainViewControllerDelegate> delegate;
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;