LSStatusBarItem.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. enum StatusBarAlignment
  2. {
  3. StatusBarAlignmentLeft = 1,
  4. StatusBarAlignmentRight = 2,
  5. StatusBarAlignmentCenter = 4
  6. };
  7. // only LSStatusBarItem (API) methods are considered public.
  8. @interface LSStatusBarItem : NSObject
  9. {
  10. @private
  11. NSString* _identifier;
  12. NSMutableDictionary* _properties;
  13. NSMutableSet* _delegates;
  14. BOOL _manualUpdate;
  15. }
  16. @end
  17. // Supported API
  18. @interface LSStatusBarItem (API)
  19. - (id) initWithIdentifier: (NSString*) identifier alignment: (StatusBarAlignment) alignment;
  20. // bitmasks (e.g. left or right) are not supported yet
  21. @property (nonatomic, readonly) StatusBarAlignment alignment;
  22. @property (nonatomic, getter=isVisible) BOOL visible;
  23. // useful only with left/right alignment - will throw error for center alignment
  24. @property (nonatomic, assign) NSString* imageName;
  25. // useful only with center alignment - will throw error otherwise
  26. // will not be visible on the lockscreen
  27. @property (nonatomic, assign) NSString* titleString;
  28. // useful if you want to override the UIStatusBarCustomItemView drawing. Your class must exist in EVERY UIKit process.
  29. @property (nonatomic, assign) NSString* customViewClass;
  30. // set to NO and manually call update if you need to make multiple changes
  31. @property (nonatomic, getter=isManualUpdate) BOOL manualUpdate;
  32. // manually call if manualUpdate = YES
  33. - (void) update;
  34. @end
  35. @interface LSStatusBarItem (Unimplemented)
  36. // leave alone unless you want to limit which apps your icon shows up in
  37. @property (nonatomic, assign) NSString* exclusiveToApp;
  38. // convenience methods?
  39. //@property (nonatomic, getter=isSpringBoardOnly) BOOL springBoardOnly;
  40. //@property (getter=isCurrentAppOnly) BOOL currentAppOnly;
  41. // delegate must respond to @selector(statusBarAction:); only valid from inside of SpringBoard
  42. - (void) addTouchDelegate: (id) delegate;
  43. - (void) removeTouchDelegate: (id) delegate;
  44. @end
  45. @interface LSStatusBarItem (Private)
  46. + (void) _updateProperties: (NSMutableDictionary*) properties forIdentifier: (NSString*) identifier;
  47. - (void) _setProperties: (NSDictionary*) dict;
  48. @end