ALApplicationList.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #import <UIKit/UIKit.h>
  2. #import <CoreGraphics/CoreGraphics.h>
  3. #import <libkern/OSAtomic.h>
  4. enum {
  5. ALApplicationIconSizeSmall = 29,
  6. ALApplicationIconSizeLarge = 59
  7. };
  8. typedef NSUInteger ALApplicationIconSize;
  9. @interface ALApplicationList : NSObject {
  10. @private
  11. NSMutableDictionary *cachedIcons;
  12. OSSpinLock spinLock;
  13. }
  14. + (ALApplicationList *)sharedApplicationList;
  15. @property (nonatomic, readonly) NSDictionary *applications;
  16. - (NSDictionary *)applicationsFilteredUsingPredicate:(NSPredicate *)predicate;
  17. - (id)valueForKeyPath:(NSString *)keyPath forDisplayIdentifier:(NSString *)displayIdentifier;
  18. - (id)valueForKey:(NSString *)keyPath forDisplayIdentifier:(NSString *)displayIdentifier;
  19. - (CGImageRef)copyIconOfSize:(ALApplicationIconSize)iconSize forDisplayIdentifier:(NSString *)displayIdentifier;
  20. - (UIImage *)iconOfSize:(ALApplicationIconSize)iconSize forDisplayIdentifier:(NSString *)displayIdentifier;
  21. - (BOOL)hasCachedIconOfSize:(ALApplicationIconSize)iconSize forDisplayIdentifier:(NSString *)displayIdentifier;
  22. @end
  23. extern NSString *const ALIconLoadedNotification;
  24. extern NSString *const ALDisplayIdentifierKey;
  25. extern NSString *const ALIconSizeKey;