OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_BOOKMARKS_BOOKMARK_PANEL_VIEW_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_PANEL_VIEW_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @class BookmarkPanelView; |
| 11 |
| 12 @protocol BookmarkPanelViewDelegate |
| 13 // The menu is going to be programmatically shown or hidden. |
| 14 - (void)bookmarkPanelView:(BookmarkPanelView*)view |
| 15 willShowMenu:(BOOL)showMenu |
| 16 withAnimationDuration:(CGFloat)duration; |
| 17 // |visibility| is 1 when the menu is fully visible, and 0 when the menu is |
| 18 // fully hidden. |
| 19 // This callback is invoked frequently during a user-driven animation. |
| 20 // This callback is not invoked for programmatic animations. |
| 21 // Every user-driven animation is guaranteed to be followed by a programmatic |
| 22 // animation. |
| 23 - (void)bookmarkPanelView:(BookmarkPanelView*)view |
| 24 updatedMenuVisibility:(CGFloat)visibility; |
| 25 @end |
| 26 |
| 27 // This view holds a content view, and a menu view. The menu sits off the |
| 28 // screen to the left. The user can pan right on the screen to drag the menu |
| 29 // view onto the content view. |
| 30 @interface BookmarkPanelView : UIView |
| 31 |
| 32 // Designated initializer. |
| 33 // The menu has the same height as the frame. |
| 34 - (id)initWithFrame:(CGRect)frame menuViewWidth:(CGFloat)width; |
| 35 |
| 36 // If a user-driven animation is in progress, these methods have no effect. |
| 37 // Calling these methods will invoke delegate callbacks. |
| 38 - (void)showMenuAnimated:(BOOL)animated; |
| 39 - (void)hideMenuAnimated:(BOOL)animated; |
| 40 |
| 41 // Even if this method returns NO, the menu can still be in the process of a |
| 42 // programmatic animation. |
| 43 - (BOOL)userDrivenAnimationInProgress; |
| 44 |
| 45 @property(nonatomic, assign) id<BookmarkPanelViewDelegate> delegate; |
| 46 |
| 47 // These views should not be modified directly. Instead, subviews should be |
| 48 // added to each to create the desired UI. |
| 49 @property(nonatomic, retain, readonly) UIView* contentView; |
| 50 @property(nonatomic, retain, readonly) UIView* menuView; |
| 51 |
| 52 // Whether the menu is being shown. If a user-driven animation is in progress, |
| 53 // this property reflects the state of the menu at the beginning of the |
| 54 // animation. |
| 55 @property(nonatomic, assign, readonly) BOOL showingMenu; |
| 56 |
| 57 // This method is used to enable or disable swiping in the menu from the left. |
| 58 - (void)enableSideSwiping:(BOOL)enable; |
| 59 |
| 60 @end |
| 61 |
| 62 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_PANEL_VIEW_H_ |
OLD | NEW |