OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_IOS_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_IOS_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @class FindInPageModel; |
| 11 |
| 12 // The a11y ID of the find-in-page bar. |
| 13 extern NSString* const kFindInPageContainerViewId; |
| 14 |
| 15 @interface FindBarControllerIOS : NSObject |
| 16 |
| 17 // The main view, for both iPhone or iPad. |
| 18 @property(nonatomic, readonly) IBOutlet UIView* view; |
| 19 |
| 20 // Init with incognito style. |
| 21 - (instancetype)initWithIncognito:(BOOL)isIncognito; |
| 22 // Current input search term. |
| 23 - (NSString*)searchTerm; |
| 24 // Update view based on model. If |focusTextfield| is YES, focus the |
| 25 // textfield. Updates the results count and, if |initialUpdate| is true, fills |
| 26 // the text field with search term from the model. |
| 27 - (void)updateView:(FindInPageModel*)model |
| 28 initialUpdate:(BOOL)initialUpdate |
| 29 focusTextfield:(BOOL)focusTextfield; |
| 30 |
| 31 // Updates the results count in Find Bar. |
| 32 - (void)updateResultsCount:(FindInPageModel*)model; |
| 33 |
| 34 // Display find bar view. On iPad, it makes best effort to horizontally align |
| 35 // find bar with alignment frame, unless alignment frame is too wide or too |
| 36 // narrow. When too wide, the find bar is shorter and right-aligned. When |
| 37 // |alignmentFrame| is too narrow, the find bar will horizontally fill |view|. |
| 38 // If |selectText| flag is YES, the text in the text input field will be |
| 39 // selected. |
| 40 - (void)addFindBarView:(BOOL)animate |
| 41 intoView:(UIView*)view |
| 42 withFrame:(CGRect)frame |
| 43 alignWithFrame:(CGRect)alignmentFrame |
| 44 selectText:(BOOL)selectText; |
| 45 // Hide find bar view. |
| 46 - (void)hideFindBarView:(BOOL)animate; |
| 47 // Hide the keyboard when the find next/previous buttons are pressed. |
| 48 - (IBAction)hideKeyboard:(id)sender; |
| 49 // Indicates that Find in Page is shown. When true, |view| is guaranteed not to |
| 50 // be nil. |
| 51 - (BOOL)isFindInPageShown; |
| 52 // Indicates that the Find in Page text field is first responder. |
| 53 - (BOOL)isFocused; |
| 54 |
| 55 @end |
| 56 |
| 57 #endif // IOS_CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_IOS_H_ |
OLD | NEW |