FLEXObjectExplorer.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // FLEXObjectExplorer.h
  3. // FLEX
  4. //
  5. // Created by Tanner Bennett on 8/28/19.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FLEXRuntime+UIKitHelpers.h"
  9. /// Carries state about the current user defaults settings
  10. @interface FLEXObjectExplorerDefaults : NSObject
  11. + (instancetype)canEdit:(BOOL)editable wantsPreviews:(BOOL)showPreviews;
  12. /// Only \c YES for properties and ivars
  13. @property (nonatomic, readonly) BOOL isEditable;
  14. /// Only affects properties and ivars
  15. @property (nonatomic, readonly) BOOL wantsDynamicPreviews;
  16. @end
  17. @interface FLEXObjectExplorer : NSObject
  18. + (instancetype)forObject:(id)objectOrClass;
  19. + (void)configureDefaultsForItems:(NSArray<id<FLEXObjectExplorerItem>> *)items;
  20. @property (nonatomic, readonly) id object;
  21. /// Subclasses can override to provide a more useful description
  22. @property (nonatomic, readonly) NSString *objectDescription;
  23. /// @return \c YES if \c object is an instance of a class,
  24. /// or \c NO if \c object is a class itself.
  25. @property (nonatomic, readonly) BOOL objectIsInstance;
  26. /// An index into the `classHierarchy` array.
  27. ///
  28. /// This property determines which set of data comes out of the metadata arrays below
  29. /// For example, \c properties contains the properties of the selected class scope,
  30. /// while \c allProperties is an array of arrays where each array is a set of
  31. /// properties for a class in the class hierarchy of the current object.
  32. @property (nonatomic) NSInteger classScope;
  33. @property (nonatomic, readonly) NSArray<NSArray<FLEXProperty *> *> *allProperties;
  34. @property (nonatomic, readonly) NSArray<FLEXProperty *> *properties;
  35. @property (nonatomic, readonly) NSArray<NSArray<FLEXProperty *> *> *allClassProperties;
  36. @property (nonatomic, readonly) NSArray<FLEXProperty *> *classProperties;
  37. @property (nonatomic, readonly) NSArray<NSArray<FLEXIvar *> *> *allIvars;
  38. @property (nonatomic, readonly) NSArray<FLEXIvar *> *ivars;
  39. @property (nonatomic, readonly) NSArray<NSArray<FLEXMethod *> *> *allMethods;
  40. @property (nonatomic, readonly) NSArray<FLEXMethod *> *methods;
  41. @property (nonatomic, readonly) NSArray<NSArray<FLEXMethod *> *> *allClassMethods;
  42. @property (nonatomic, readonly) NSArray<FLEXMethod *> *classMethods;
  43. @property (nonatomic, readonly) NSArray<Class> *classHierarchyClasses;
  44. @property (nonatomic, readonly) NSArray<FLEXStaticMetadata *> *classHierarchy;
  45. @property (nonatomic, readonly) NSArray<NSArray<FLEXProtocol *> *> *allConformedProtocols;
  46. @property (nonatomic, readonly) NSArray<FLEXProtocol *> *conformedProtocols;
  47. @property (nonatomic, readonly) NSArray<FLEXStaticMetadata *> *allInstanceSizes;
  48. @property (nonatomic, readonly) FLEXStaticMetadata *instanceSize;
  49. @property (nonatomic, readonly) NSArray<FLEXStaticMetadata *> *allImageNames;
  50. @property (nonatomic, readonly) FLEXStaticMetadata *imageName;
  51. - (void)reloadMetadata;
  52. - (void)reloadClassHierarchy;
  53. @end