OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CLIENT_IOS_APP_HOST_COLLECTION_VIEW_CONTOLLER_H_ | 5 #ifndef REMOTING_IOS_APP_HOST_COLLECTION_VIEW_CONTOLLER_H_ |
6 #define REMOTING_CLIENT_IOS_APP_HOST_COLLECTION_VIEW_CONTOLLER_H_ | 6 #define REMOTING_IOS_APP_HOST_COLLECTION_VIEW_CONTOLLER_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #import "ios/third_party/material_components_ios/src/components/Collections/src/
MaterialCollections.h" | 10 #import "ios/third_party/material_components_ios/src/components/Collections/src/
MaterialCollections.h" |
11 #import "ios/third_party/material_components_ios/src/components/FlexibleHeader/s
rc/MaterialFlexibleHeader.h" | 11 #import "ios/third_party/material_components_ios/src/components/FlexibleHeader/s
rc/MaterialFlexibleHeader.h" |
12 #import "remoting/client/ios/app/host_collection_view_cell.h" | 12 #import "remoting/ios/app/host_collection_view_cell.h" |
13 #import "remoting/client/ios/domain/host_info.h" | 13 #import "remoting/ios/domain/host_info.h" |
14 | 14 |
15 // The host collection view controller delegate provides the data for available | 15 // The host collection view controller delegate provides the data for available |
16 // hosts and receives selection events from the collection view controller. | 16 // hosts and receives selection events from the collection view controller. |
17 @protocol HostCollectionViewControllerDelegate<NSObject> | 17 @protocol HostCollectionViewControllerDelegate<NSObject> |
18 | 18 |
19 // Notifies the delegate if a selection happens for the provided cell. | 19 // Notifies the delegate if a selection happens for the provided cell. |
20 // The delegate should run the completionBlock when processing for this event | 20 // The delegate should run the completionBlock when processing for this event |
21 // has finished. | 21 // has finished. |
22 @optional | 22 @optional |
23 - (void)didSelectCell:(HostCollectionViewCell*)cell | 23 - (void)didSelectCell:(HostCollectionViewCell*)cell |
24 completion:(void (^)())completionBlock; | 24 completion:(void (^)())completionBlock; |
25 | 25 |
26 // The delegate should provide the HostInfo object for the given path if | 26 // The delegate should provide the HostInfo object for the given path if |
27 // available from the cache. | 27 // available from the cache. |
28 - (HostInfo*)getHostAtIndexPath:(NSIndexPath*)path; | 28 - (HostInfo*)getHostAtIndexPath:(NSIndexPath*)path; |
29 | 29 |
30 // The delegate must provide the total number of hosts currently cached. | 30 // The delegate must provide the total number of hosts currently cached. |
31 - (NSInteger)getHostCount; | 31 - (NSInteger)getHostCount; |
32 | 32 |
33 @end | 33 @end |
34 | 34 |
35 @interface HostCollectionViewController : MDCCollectionViewController | 35 @interface HostCollectionViewController : MDCCollectionViewController |
36 | 36 |
37 @property(weak, nonatomic) id<HostCollectionViewControllerDelegate> delegate; | 37 @property(weak, nonatomic) id<HostCollectionViewControllerDelegate> delegate; |
38 @property(nonatomic) | 38 @property(nonatomic) |
39 MDCFlexibleHeaderContainerViewController* flexHeaderContainerViewController; | 39 MDCFlexibleHeaderContainerViewController* flexHeaderContainerViewController; |
40 | 40 |
41 @end | 41 @end |
42 | 42 |
43 #endif // REMOTING_CLIENT_IOS_APP_HOST_LIST_VIEW_CONTOLLER_H_ | 43 #endif // REMOTING_IOS_APP_HOST_LIST_VIEW_CONTOLLER_H_ |
OLD | NEW |