session-ios/Session/Signal/ConversationView/Cells/OWSBubbleView.h

61 lines
1.6 KiB
C
Raw Normal View History

2018-03-28 16:01:01 +02:00
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
2018-07-02 18:57:07 +02:00
extern const CGFloat kOWSMessageCellCornerRadius_Large;
extern const CGFloat kOWSMessageCellCornerRadius_Small;
2018-03-28 16:01:01 +02:00
2018-07-07 00:32:46 +02:00
typedef NS_OPTIONS(NSUInteger, OWSDirectionalRectCorner) {
OWSDirectionalRectCornerTopLeading = 1 << 0,
OWSDirectionalRectCornerTopTrailing = 1 << 1,
OWSDirectionalRectCornerBottomLeading = 1 << 2,
OWSDirectionalRectCornerBottomTrailing = 1 << 3,
OWSDirectionalRectCornerAllCorners = ~0UL
};
@class OWSBubbleView;
2018-03-29 16:59:16 +02:00
@protocol OWSBubbleViewPartner <NSObject>
- (void)updateLayers;
- (void)setBubbleView:(nullable OWSBubbleView *)bubbleView;
@end
2018-03-28 16:01:01 +02:00
#pragma mark -
@interface OWSBubbleView : UIView
2018-03-29 16:59:16 +02:00
2018-07-07 00:13:25 +02:00
+ (UIBezierPath *)roundedBezierRectWithBubbleTop:(CGFloat)bubbleTop
bubbleLeft:(CGFloat)bubbleLeft
bubbleBottom:(CGFloat)bubbleBottom
bubbleRight:(CGFloat)bubbleRight
sharpCornerRadius:(CGFloat)sharpCornerRadius
wideCornerRadius:(CGFloat)wideCornerRadius
2018-07-07 00:32:46 +02:00
sharpCorners:(OWSDirectionalRectCorner)sharpCorners;
2018-07-07 00:13:25 +02:00
2018-03-28 16:01:01 +02:00
@property (nonatomic, nullable) UIColor *bubbleColor;
2018-07-07 00:32:46 +02:00
@property (nonatomic) OWSDirectionalRectCorner sharpCorners;
2018-07-02 18:57:07 +02:00
2018-03-29 16:59:16 +02:00
- (UIBezierPath *)maskPath;
#pragma mark - Coordination
- (void)addPartnerView:(id<OWSBubbleViewPartner>)view;
- (void)clearPartnerViews;
- (void)updatePartnerViews;
2018-07-02 18:57:07 +02:00
- (CGFloat)minWidth;
2018-11-01 17:47:08 +01:00
- (CGFloat)minHeight;
2018-03-28 16:01:01 +02:00
@end
NS_ASSUME_NONNULL_END