Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef IOS_CHROME_BROWSER_UI_BUBBLE_BUBBLE_VIEW_H_ | |
| 6 #define IOS_CHROME_BROWSER_UI_BUBBLE_BUBBLE_VIEW_H_ | |
| 7 | |
| 8 #import <UIKit/UIKit.h> | |
| 9 | |
| 10 // Direction for the bubble to point. | |
| 11 typedef NS_ENUM(NSInteger, BubbleArrowDirection) { | |
| 12 // Bubble is below the target UI element and the arrow is pointing up. | |
| 13 BubbleArrowDirectionUp, | |
|
marq (ping after 24h)
2017/07/11 12:21:26
nit: Provide an initial value for enums:
BubbleAr
| |
| 14 // Bubble is above the target UI element and the arrow is pointing down. | |
| 15 BubbleArrowDirectionDown, | |
| 16 }; | |
| 17 | |
| 18 // Alignment of the bubble relative to the arrow. | |
| 19 typedef NS_ENUM(NSInteger, BubbleAlignment) { | |
| 20 BubbleAlignmentLeading, | |
| 21 BubbleAlignmentCenter, | |
| 22 BubbleAlignmentTrailing, | |
| 23 }; | |
| 24 | |
| 25 // Speech bubble shaped view that displays a message. | |
| 26 @interface BubbleView : UIView | |
| 27 | |
| 28 // Initializes with the given text, direction that the bubble should point, and | |
| 29 // alignment of the bubble. | |
| 30 - (instancetype)initWithText:(NSString*)text | |
| 31 direction:(BubbleArrowDirection)arrowDirection | |
| 32 alignment:(BubbleAlignment)alignment | |
| 33 NS_DESIGNATED_INITIALIZER; | |
| 34 | |
| 35 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | |
| 36 | |
| 37 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | |
| 38 | |
| 39 - (instancetype)init NS_UNAVAILABLE; | |
| 40 | |
| 41 @end | |
| 42 | |
| 43 #endif // IOS_CHROME_BROWSER_UI_BUBBLE_BUBBLE_VIEW_H_ | |
| OLD | NEW |