TUICommonModel.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //
  2. // TCommonCell.h
  3. // TXIMSDK_TUIKit_iOS
  4. //
  5. // Created by annidyfeng on 2019/5/6.
  6. // Copyright © 2023 Tencent. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "TUIDarkModel.h"
  10. @import ImSDK_Plus;
  11. NS_ASSUME_NONNULL_BEGIN
  12. /////////////////////////////////////////////////////////////////////////////////
  13. //
  14. // TUIUserFullInfo
  15. //
  16. /////////////////////////////////////////////////////////////////////////////////
  17. @interface V2TIMUserFullInfo (TUIUserFullInfo)
  18. - (NSString *)showName;
  19. - (NSString *)showGender;
  20. - (NSString *)showSignature;
  21. - (NSString *)showAllowType;
  22. @end
  23. /////////////////////////////////////////////////////////////////////////////////
  24. //
  25. // TUIUserModel
  26. //
  27. /////////////////////////////////////////////////////////////////////////////////
  28. @interface TUIUserModel : NSObject <NSCopying>
  29. @property(nonatomic, copy) NSString *userId;
  30. @property(nonatomic, copy) NSString *name;
  31. @property(nonatomic, copy) NSString *avatar;
  32. @end
  33. /////////////////////////////////////////////////////////////////////////////////
  34. //
  35. // TUIScrollView
  36. //
  37. /////////////////////////////////////////////////////////////////////////////////
  38. @interface TUIScrollView : UIScrollView
  39. @property(strong, nonatomic) UIImageView *imageView;
  40. @end
  41. /////////////////////////////////////////////////////////////////////////////////
  42. //
  43. // TUIGroupAvatar
  44. //
  45. /////////////////////////////////////////////////////////////////////////////////
  46. @interface TUIGroupAvatar : NSObject
  47. /**
  48. *
  49. * Obtain the latest group avatar in real time according to the group id. After the avatar is updated, it will be cached locally. This interface will request
  50. * the network This interface will not use the cache. If you need to read the cache, please use getCacheGroupAvatar:imageCallback or getCacheAvatarForGroup:
  51. * number:
  52. */
  53. + (void)fetchGroupAvatars:(NSString *)groupID placeholder:(UIImage *)placeholder callback:(void (^)(BOOL success, UIImage *image, NSString *groupID))callback;
  54. /**
  55. * Create a group avatar based on the given url array
  56. */
  57. + (void)createGroupAvatar:(NSArray *)group finished:(void (^)(UIImage *groupAvatar))finished;
  58. /**
  59. * Cache avatars based on group ID and number of group members
  60. */
  61. + (void)cacheGroupAvatar:(UIImage *)avatar number:(UInt32)memberNum groupID:(NSString *)groupID;
  62. /**
  63. * Get the cached avatar asynchronously, this interface will request the interface to get the current number of group members, and return the avatar
  64. * corresponding to the local cache
  65. */
  66. + (void)getCacheGroupAvatar:(NSString *)groupID callback:(void (^)(UIImage *, NSString *groupID))imageCallBack;
  67. /**
  68. * Get the cached avatar synchronously, this interface does not request the network
  69. */
  70. + (UIImage *)getCacheAvatarForGroup:(NSString *)groupId number:(UInt32)memberNum;
  71. /**
  72. *
  73. * Clear the avatar cache of the specified group
  74. */
  75. + (void)asyncClearCacheAvatarForGroup:(NSString *)groupID;
  76. @end
  77. /////////////////////////////////////////////////////////////////////////////////
  78. //
  79. // TUIImageCache
  80. //
  81. /////////////////////////////////////////////////////////////////////////////////
  82. @interface TUIImageCache : NSObject
  83. + (instancetype)sharedInstance;
  84. - (void)addResourceToCache:(NSString *)path;
  85. - (UIImage *)getResourceFromCache:(NSString *)path;
  86. - (void)addFaceToCache:(NSString *)path;
  87. - (UIImage *)getFaceFromCache:(NSString *)path;
  88. @end
  89. /////////////////////////////////////////////////////////////////////////////////
  90. //
  91. // TUINavigationController
  92. //
  93. /////////////////////////////////////////////////////////////////////////////////
  94. @class TUINavigationController;
  95. @protocol TUINavigationControllerDelegate <NSObject>
  96. @optional
  97. - (void)navigationControllerDidClickLeftButton:(TUINavigationController *)controller;
  98. - (void)navigationControllerDidSideSlideReturn:(TUINavigationController *)controller fromViewController:(UIViewController *)fromViewController;
  99. @end
  100. @interface TUINavigationController : UINavigationController <UINavigationControllerDelegate, UIGestureRecognizerDelegate>
  101. @property(nonatomic, weak) UIViewController *currentShowVC;
  102. @property(nonatomic, weak) id<TUINavigationControllerDelegate> uiNaviDelegate;
  103. @property(nonatomic, strong) UIImage *navigationItemBackArrowImage;
  104. @property(nonatomic, strong) UIColor *navigationBackColor;
  105. @end
  106. @interface UIAlertController (TUITheme)
  107. - (void)tuitheme_addAction:(UIAlertAction *)action;
  108. @end
  109. typedef void (^TUIValueCallbck)(NSDictionary *param);
  110. typedef void (^TUINonValueCallbck)(void);
  111. typedef NSString *TUIExtVauleType;
  112. @interface NSObject (TUIExtValue)
  113. @property(nonatomic, copy) TUIValueCallbck tui_valueCallback;
  114. @property(nonatomic, copy) TUINonValueCallbck tui_nonValueCallback;
  115. @property(nonatomic, strong) id tui_extValueObj;
  116. @end
  117. NS_ASSUME_NONNULL_END