EMEmoticonGroup.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // Emoticon.h
  3. // ChatDemo-UI3.0
  4. //
  5. // Created by XieYajie on 2019/1/31.
  6. // Copyright © 2019 XieYajie. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NS_ENUM(NSUInteger, EMEmotionType) {
  11. EMEmotionTypeEmoji = 0,
  12. EMEmotionTypePng,
  13. EMEmotionTypeGif,
  14. };
  15. @interface EMEmoticonModel : NSObject
  16. @property (nonatomic, strong) NSString *eId;
  17. @property (nonatomic, strong) NSString *name;
  18. @property (nonatomic, strong) NSString *imgName;
  19. //local name or remote url
  20. @property (nonatomic, strong) NSString *original;
  21. @property (nonatomic, readonly) EMEmotionType type;
  22. - (instancetype)initWithType:(EMEmotionType)aType;
  23. @end
  24. @interface EMEmoticonGroup : NSObject
  25. @property (nonatomic, readonly) EMEmotionType type;
  26. @property (nonatomic, strong) id icon;
  27. @property (nonatomic, strong, readonly) NSArray<EMEmoticonModel *> *dataArray;
  28. @property (nonatomic) NSInteger rowCount;
  29. @property (nonatomic) NSInteger colCount;
  30. - (instancetype)initWithType:(EMEmotionType)aType
  31. dataArray:(NSArray<EMEmoticonModel *> *)aDataArray
  32. icon:(id)aIcon
  33. rowCount:(NSInteger)aRowCount
  34. colCount:(NSInteger)aColCount;
  35. + (instancetype)getGifGroup;
  36. @end
  37. @interface EMEmoticonCell : UICollectionViewCell
  38. @property (nonatomic, strong) UIImageView *imgView;
  39. @property (nonatomic, strong) UILabel *label;
  40. @property (nonatomic, strong) EMEmoticonModel *model;
  41. @end
  42. @protocol EMEmoticonViewDelegate;
  43. @interface EMEmoticonView : UIView
  44. @property (nonatomic, weak) id<EMEmoticonViewDelegate> delegate;
  45. @property (nonatomic) CGFloat viewHeight;
  46. - (instancetype)initWithEmotionGroup:(EMEmoticonGroup *)aEmotionGroup;
  47. @end
  48. @protocol EMEmoticonViewDelegate <NSObject>
  49. @optional
  50. - (void)emoticonViewDidSelectedModel:(EMEmoticonModel *)aModel;
  51. @end
  52. NS_ASSUME_NONNULL_END