summaryrefslogtreecommitdiffstats
path: root/remoting/ios/host_refresh.h
blob: 8cdef3efd59b9aa2d4511955510964f59c703684 (plain)
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
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_IOS_HOST_REFRESH_H_
#define REMOTING_IOS_HOST_REFRESH_H_

#import <Foundation/Foundation.h>

#import "GTMOAuth2Authentication.h"

// HostRefresh encapsulates a fetch of the Chromoting host list from
// the jabber service.

// Contract to handle the host list result of a Chromoting host list fetch.
@protocol HostRefreshDelegate<NSObject>

- (void)hostListRefresh:(NSArray*)hostList errorMessage:(NSString*)errorMessage;

@end

// Fetches the host list from the jabber service async.  Authenticates,
// and parses the results to provide to a HostListViewController
@interface HostRefresh : NSObject<NSURLConnectionDataDelegate>

// Store data read while the connection is active, and can be used after the
// connection has been discarded
@property(nonatomic, copy) NSMutableData* jsonData;
@property(nonatomic, copy) NSString* errorMessage;
@property(nonatomic, assign) id<HostRefreshDelegate> delegate;

- (void)refreshHostList:(GTMOAuth2Authentication*)authReq
               delegate:(id<HostRefreshDelegate>)delegate;

@end

#endif  // REMOTING_IOS_HOST_REFRESH_H_