2017-03-09 10:18:18 +00:00
|
|
|
/*
|
|
|
|
Copyright 2015 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-11-30 15:09:53 +00:00
|
|
|
#import "MatrixKit.h"
|
2017-03-09 10:18:18 +00:00
|
|
|
|
2021-02-25 10:07:21 +00:00
|
|
|
@class CircleProgressView;
|
|
|
|
|
2017-03-09 10:18:18 +00:00
|
|
|
/**
|
|
|
|
Action identifier used when the user pressed edit button displayed in front of a selected event.
|
|
|
|
|
|
|
|
The `userInfo` dictionary contains an `MXEvent` object under the `kMXKRoomBubbleCellEventKey` key, representing the selected event.
|
|
|
|
*/
|
2017-03-09 10:25:36 +00:00
|
|
|
extern NSString *const kMXKRoomBubbleCellRiotEditButtonPressed;
|
2017-03-09 10:18:18 +00:00
|
|
|
|
2017-06-26 18:22:32 +00:00
|
|
|
/**
|
|
|
|
Action identifier used when the user tapped on receipts area.
|
|
|
|
|
2019-07-30 13:44:51 +00:00
|
|
|
The 'userInfo' dictionary contains an 'MXKReceiptSendersContainer' object under the 'kMXKRoomBubbleCellReceiptsContainerKey' key, representing the receipts container which was tapped on.
|
2017-06-26 18:22:32 +00:00
|
|
|
*/
|
|
|
|
extern NSString *const kMXKRoomBubbleCellTapOnReceiptsContainer;
|
|
|
|
|
2019-07-30 13:44:51 +00:00
|
|
|
/**
|
|
|
|
Action identifier used when the user perform a long press on reactions view.
|
|
|
|
|
|
|
|
The 'userInfo' dictionary contains a 'NSString' object under the 'kMXKRoomBubbleCellEventIdKey' key, representing the event id of the event associated with the reactions.
|
|
|
|
*/
|
|
|
|
extern NSString *const kMXKRoomBubbleCellLongPressOnReactionView;
|
|
|
|
|
2020-01-14 18:55:49 +00:00
|
|
|
/**
|
|
|
|
Action identifier used when the user pressed accept button for an incoming key verification request.
|
|
|
|
|
|
|
|
The `userInfo` dictionary contains an `NSString` object under the `kMXKRoomBubbleCellEventIdKey` key, representing the event id associated to the key verification request.
|
|
|
|
*/
|
|
|
|
extern NSString *const kMXKRoomBubbleCellKeyVerificationIncomingRequestAcceptPressed;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Action identifier used when the user pressed decline button for an incoming key verification request.
|
|
|
|
|
|
|
|
The `userInfo` dictionary contains an `NSString` object under the `kMXKRoomBubbleCellEventIdKey` key, representing the event id associated to the key verification request.
|
|
|
|
*/
|
|
|
|
extern NSString *const kMXKRoomBubbleCellKeyVerificationIncomingRequestDeclinePressed;
|
|
|
|
|
2017-03-09 10:18:18 +00:00
|
|
|
/**
|
2017-03-09 10:25:36 +00:00
|
|
|
Define a `MXKRoomBubbleTableViewCell` category at Riot level to handle bubble customisation.
|
2017-03-09 10:18:18 +00:00
|
|
|
*/
|
2017-03-09 10:25:36 +00:00
|
|
|
@interface MXKRoomBubbleTableViewCell (Riot)
|
2017-03-09 10:18:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Add timestamp label for a component in receiver.
|
|
|
|
|
|
|
|
Note: The label added here is automatically removed when [didEndDisplay] is called.
|
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
|
|
|
*/
|
|
|
|
- (void)addTimestampLabelForComponent:(NSUInteger)componentIndex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Highlight a component in receiver.
|
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
|
|
|
*/
|
|
|
|
- (void)selectComponent:(NSUInteger)componentIndex;
|
|
|
|
|
2019-05-07 14:49:12 +00:00
|
|
|
/**
|
|
|
|
Highlight a component in receiver and show or not edit button.
|
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
|
|
|
@param showEditButton true to show edit button
|
2019-05-15 19:15:50 +00:00
|
|
|
@param showTimestamp true to show timestamp label
|
2019-05-07 14:49:12 +00:00
|
|
|
*/
|
2019-05-15 19:15:50 +00:00
|
|
|
- (void)selectComponent:(NSUInteger)componentIndex showEditButton:(BOOL)showEditButton showTimestamp:(BOOL)showTimestamp;
|
2019-05-07 14:49:12 +00:00
|
|
|
|
2017-03-09 10:18:18 +00:00
|
|
|
/**
|
|
|
|
Mark a component in receiver.
|
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
|
|
|
*/
|
|
|
|
- (void)markComponent:(NSUInteger)componentIndex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Add a label to display the date of the cell.
|
|
|
|
*/
|
|
|
|
- (void)addDateLabel;
|
|
|
|
|
2017-06-26 18:22:32 +00:00
|
|
|
/**
|
|
|
|
Called when the user taps on the Receipt Container.
|
|
|
|
*/
|
|
|
|
- (IBAction)onReceiptContainerTap:(UITapGestureRecognizer *)sender;
|
|
|
|
|
2019-03-07 16:44:15 +00:00
|
|
|
/**
|
|
|
|
Update username label color based on bubble data sender ID.
|
|
|
|
*/
|
|
|
|
- (void)updateUserNameColor;
|
|
|
|
|
2019-05-22 16:46:22 +00:00
|
|
|
/**
|
|
|
|
Calculate component frame in table view.
|
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
2019-05-29 10:18:56 +00:00
|
|
|
@return component frame in table view if component exist or CGRectNull.
|
2019-05-22 16:46:22 +00:00
|
|
|
*/
|
2019-05-29 10:18:56 +00:00
|
|
|
- (CGRect)componentFrameInTableViewForIndex:(NSInteger)componentIndex;
|
|
|
|
|
2019-07-08 16:42:32 +00:00
|
|
|
/**
|
|
|
|
Calculate surrounding component frame in table view. This frame goes over user name for first visible component for example.
|
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
|
|
|
@return Component surrounding frame in table view if component exist or CGRectNull.
|
|
|
|
*/
|
|
|
|
- (CGRect)surroundingFrameInTableViewForComponentIndex:(NSInteger)componentIndex;
|
|
|
|
|
2019-05-29 10:18:56 +00:00
|
|
|
/**
|
2019-05-29 13:17:20 +00:00
|
|
|
Calculate the component frame in the contentView of the tableview cell.
|
2019-05-29 10:18:56 +00:00
|
|
|
|
|
|
|
@param componentIndex index of the component in bubble message data
|
2019-05-29 13:16:38 +00:00
|
|
|
@return component frame in the contentView if the component exists or CGRectNull.
|
2019-05-29 10:18:56 +00:00
|
|
|
*/
|
|
|
|
- (CGRect)componentFrameInContentViewForIndex:(NSInteger)componentIndex;
|
2019-05-22 16:46:22 +00:00
|
|
|
|
2019-06-18 16:29:12 +00:00
|
|
|
/**
|
|
|
|
Give the correct cell height for a bubble cell with an attachment view. Handle reactions and read receipts views.
|
|
|
|
|
|
|
|
@param cellData The data object to render.
|
|
|
|
@param maxWidth The maximum available width.
|
|
|
|
@return The cell height.
|
|
|
|
*/
|
|
|
|
+ (CGFloat)attachmentBubbleCellHeightForCellData:(MXKCellData *)cellData withMaximumWidth:(CGFloat)maxWidth;
|
|
|
|
|
2021-02-22 12:51:25 +00:00
|
|
|
- (IBAction)onProgressLongPressGesture:(UILongPressGestureRecognizer*)recognizer;
|
|
|
|
|
2021-03-09 10:59:54 +00:00
|
|
|
/**
|
|
|
|
update tick view(s) according to the current sent state.
|
|
|
|
*/
|
2021-03-09 12:22:13 +00:00
|
|
|
- (void)updateTickViewWithFailedEventIds:(NSSet *)failedEventIds;
|
2021-03-09 10:59:54 +00:00
|
|
|
|
2017-03-09 10:18:18 +00:00
|
|
|
/**
|
|
|
|
Blur the view by adding a transparent overlay. Default is NO.
|
|
|
|
*/
|
|
|
|
@property(nonatomic) BOOL blurred;
|
|
|
|
|
|
|
|
/**
|
|
|
|
The 'edit' button displayed at in the top-right corner of the selected component (if any). Default is nil.
|
|
|
|
*/
|
|
|
|
@property(nonatomic) UIButton *editButton;
|
|
|
|
|
|
|
|
/**
|
|
|
|
The marker view displayed in front of the marked component (if any).
|
|
|
|
*/
|
|
|
|
@property (nonatomic) UIView *markerView;
|
|
|
|
|
2021-02-22 12:51:25 +00:00
|
|
|
/**
|
|
|
|
Message tick views (sending, sent) displayed alongside the related component.
|
|
|
|
*/
|
|
|
|
@property (nonatomic) NSArray *messageStatusViews;
|
|
|
|
|
2017-03-09 10:18:18 +00:00
|
|
|
@end
|