LookinAttribute.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifdef SHOULD_COMPILE_LOOKIN_SERVER
  2. //
  3. // LookinAttribute.h
  4. // qmuidemo
  5. //
  6. // Created by Li Kai on 2018/11/17.
  7. // Copyright © 2018 QMUI Team. All rights reserved.
  8. //
  9. #import "LookinAttrIdentifiers.h"
  10. #import "LookinCodingValueType.h"
  11. #import "LookinAttrType.h"
  12. @class LookinDisplayItem;
  13. @interface LookinAttribute : NSObject <NSSecureCoding, NSCopying>
  14. @property(nonatomic, copy) LookinAttrIdentifier identifier;
  15. /// 只有 Custom Attr 才有该属性
  16. @property(nonatomic, copy) NSString *displayTitle;
  17. /// 标识 value 的具体类型(如 double / NSString /...)
  18. @property(nonatomic, assign) LookinAttrType attrType;
  19. /// 具体的值,需配合 attrType 属性来解析它
  20. /// 对于 String、Color 等 attyType,该属性可能为 nil
  21. @property(nonatomic, strong) id value;
  22. /// 额外信息,大部分情况下它是 nil
  23. /// 当 attyType 为 LookinAttrTypeEnumString 时,extraValue 是一个 [String] 且保存了 allEnumCases
  24. @property(nonatomic, strong) id extraValue;
  25. /// 仅 Custom Attr 可能有该属性
  26. /// 对于有 retainedSetter 的 Custom Attr,它的 setter 会以 customSetterID 作为 key 被保存到 LKS_CustomAttrSetterManager 里,后续可以通过这个 uniqueID 重新把 setter 从 LKS_CustomAttrSetterManager 里取出来并调用
  27. @property(nonatomic, copy) NSString *customSetterID;
  28. #pragma mark - 以下属性不会参与 encode/decode
  29. /// 标识该 LookinAttribute 对象隶属于哪一个 LookinDisplayItem
  30. @property(nonatomic, weak) LookinDisplayItem *targetDisplayItem;
  31. - (BOOL)isUserCustom;
  32. @end
  33. #endif /* SHOULD_COMPILE_LOOKIN_SERVER */