OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_TAB_SWITCHER_TAB_SWITCHER_VIEW_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_VIEW_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" |
| 11 |
| 12 @class TabSwitcherHeaderView; |
| 13 @class TabSwitcherView; |
| 14 |
| 15 namespace ios_internal { |
| 16 enum NewTabButtonStyle { UNINITIALIZED, BLUE, GRAY, HIDDEN }; |
| 17 } // namespace ios_internal |
| 18 |
| 19 @protocol TabSwitcherViewDelegate<NSObject> |
| 20 |
| 21 - (void)openNewTabInPanelAtIndex:(NSInteger)panelIndex; |
| 22 - (ios_internal::NewTabButtonStyle)buttonStyleForPanelAtIndex: |
| 23 (NSInteger)panelIndex; |
| 24 - (BOOL)shouldShowDismissButtonForPanelAtIndex:(NSInteger)panelIndex; |
| 25 - (void)tabSwitcherViewDelegateDismissTabSwitcher:(TabSwitcherView*)delegate; |
| 26 |
| 27 @end |
| 28 |
| 29 @interface TabSwitcherView : UIView<UIScrollViewDelegate> |
| 30 |
| 31 @property(nonatomic, readonly) TabSwitcherHeaderView* headerView; |
| 32 @property(nonatomic, readonly) UIScrollView* scrollView; |
| 33 |
| 34 @property(nonatomic, assign) id<TabSwitcherViewDelegate> delegate; |
| 35 |
| 36 // Select the panel at the given index, updating both the header and content. |
| 37 // The panel selection will be animated if VoiceOver is disabled. |
| 38 - (void)selectPanelAtIndex:(NSInteger)index; |
| 39 // Adds the view |view| at index |index|. |
| 40 - (void)addPanelView:(UIView*)view atIndex:(NSUInteger)index; |
| 41 // Removes the view at index |index| and update scrollview. |
| 42 - (void)removePanelViewAtIndex:(NSUInteger)index; |
| 43 // Removes the view at index |index| and update scrollview if |update| is true. |
| 44 - (void)removePanelViewAtIndex:(NSUInteger)index updateScrollView:(BOOL)update; |
| 45 // Returns the index of the currently selected panel. |
| 46 - (NSInteger)currentPanelIndex; |
| 47 // Updates the state of the tab switcher overlay buttons. |
| 48 // Overlay buttons are the top right dismiss button and the bottom right new tab |
| 49 // button. |
| 50 - (void)updateOverlayButtonState; |
| 51 |
| 52 @end |
| 53 |
| 54 #endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_VIEW_H_ |
OLD | NEW |