ChatMessageCell.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2012-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. #import <UIKit/UIKit.h>
  21. #import "ChatViewController.h"
  22. #import "MGSwipeTableCell.h"
  23. @class BaseMessage;
  24. @interface ChatMessageCell : UITableViewCell
  25. @property (nonatomic, strong) BaseMessage* message;
  26. @property (nonatomic) BOOL typing;
  27. @property (nonatomic, weak) ChatViewController *chatVc;
  28. @property (nonatomic, readonly) UIImageView *statusImage;
  29. @property (nonatomic, readonly) UIImageView *msgBackground;
  30. @property (nonatomic, readonly) UITapGestureRecognizer *dtgr;
  31. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier transparent:(BOOL)transparent;
  32. - (void)setupColors;
  33. - (void)setBubbleContentSize:(CGSize)size;
  34. - (void)setBubbleSize:(CGSize)size;
  35. + (CGFloat)heightForMessage:(BaseMessage*)message forTableWidth:(CGFloat)tableWidth;
  36. - (void)updateStatusImage;
  37. - (CGFloat)contentLeftOffset;
  38. - (void)copyMessage:(UIMenuController *)menuController;
  39. - (void)deleteMessage:(UIMenuController*)menuController;
  40. - (void)shareMessage:(UIMenuController *)menuController;
  41. - (void)forwardMessage:(UIMenuController *)menuController;
  42. - (void)quoteMessage:(UIMenuController *)menuController;
  43. - (NSString*)textForQuote;
  44. + (CGFloat)maxContentWidthForTableWidth:(CGFloat)tableWidth;
  45. - (void)handleLongPress:(UIGestureRecognizer *)gestureRecognizer;
  46. - (NSString*)accessibilityLabelForContent;
  47. - (BOOL)performPlayActionForAccessibility;
  48. - (BOOL)shouldHideBubbleBackground;
  49. - (void)setBubbleHighlighted:(BOOL)bubbleHighlighted;
  50. - (void)showCallMenu;
  51. + (UIFont *)textFont;
  52. + (CGFloat)textFontSize;
  53. + (UIFont *)quoteFont;
  54. + (CGFloat)quoteFontSize;
  55. + (UIFont *)quoteIdentityFont;
  56. + (CGFloat)quoteIdentityFontSize;
  57. + (UIFont *)emojiFont;
  58. + (CGFloat)emojiFontSize;
  59. - (BOOL)highlightOccurencesOf:(NSString *)pattern;
  60. + (NSAttributedString *)highlightedOccurencesOf:(NSString *)pattern inString:(NSString *)text;
  61. - (UIViewController *)previewViewController;
  62. - (UIViewController *)previewViewControllerFor:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location;
  63. - (void)willDisplay;
  64. - (void)didEndDisplaying;
  65. - (UIContextMenuConfiguration *)getContextMenu:(NSIndexPath *)indexPath point:(CGPoint)point API_AVAILABLE(ios(13.0));
  66. - (NSArray *)contextMenuItems API_AVAILABLE(ios(13.0));
  67. @end