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_IOS_APP_HOST_COLLECTION_VIEW_CONTOLLER_H_ | 5 #ifndef REMOTING_IOS_APP_HOST_COLLECTION_VIEW_CONTOLLER_H_ |
6 #define REMOTING_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" | |
12 #import "remoting/ios/app/host_collection_view_cell.h" | 11 #import "remoting/ios/app/host_collection_view_cell.h" |
13 #import "remoting/ios/domain/host_info.h" | 12 #import "remoting/ios/domain/host_info.h" |
14 | 13 |
15 // The host collection view controller delegate provides the data for available | 14 // The host collection view controller delegate provides the data for available |
16 // hosts and receives selection events from the collection view controller. | 15 // hosts and receives selection events from the collection view controller. |
17 @protocol HostCollectionViewControllerDelegate<NSObject> | 16 @protocol HostCollectionViewControllerDelegate<NSObject> |
18 | 17 |
19 // Notifies the delegate if a selection happens for the provided cell. | 18 // Notifies the delegate if a selection happens for the provided cell. |
20 // The delegate should run the completionBlock when processing for this event | 19 // The delegate should run the completionBlock when processing for this event |
21 // has finished. | 20 // has finished. |
22 @optional | 21 @optional |
23 - (void)didSelectCell:(HostCollectionViewCell*)cell | 22 - (void)didSelectCell:(HostCollectionViewCell*)cell |
24 completion:(void (^)())completionBlock; | 23 completion:(void (^)())completionBlock; |
25 | 24 |
26 // The delegate should provide the HostInfo object for the given path if | 25 // The delegate should provide the HostInfo object for the given path if |
27 // available from the cache. | 26 // available from the cache. |
28 - (HostInfo*)getHostAtIndexPath:(NSIndexPath*)path; | 27 - (HostInfo*)getHostAtIndexPath:(NSIndexPath*)path; |
29 | 28 |
30 // The delegate must provide the total number of hosts currently cached. | 29 // The delegate must provide the total number of hosts currently cached. |
31 - (NSInteger)getHostCount; | 30 - (NSInteger)getHostCount; |
32 | 31 |
33 @end | 32 @end |
34 | 33 |
35 @interface HostCollectionViewController : MDCCollectionViewController | 34 @interface HostCollectionViewController : MDCCollectionViewController |
36 | 35 |
37 @property(weak, nonatomic) id<HostCollectionViewControllerDelegate> delegate; | 36 @property(weak, nonatomic) id<HostCollectionViewControllerDelegate> delegate; |
38 @property(nonatomic) | 37 @property(weak, nonatomic) id<UIScrollViewDelegate> scrollViewDelegate; |
39 MDCFlexibleHeaderContainerViewController* flexHeaderContainerViewController; | |
40 | 38 |
41 @end | 39 @end |
42 | 40 |
43 #endif // REMOTING_IOS_APP_HOST_LIST_VIEW_CONTOLLER_H_ | 41 #endif // REMOTING_IOS_APP_HOST_LIST_VIEW_CONTOLLER_H_ |
OLD | NEW |