ATMHudView.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * ATMHudView.h
  3. * ATMHud
  4. *
  5. * Created by Marcel Müller on 2011-03-01.
  6. * Copyright (c) 2010-2011, Marcel Müller (atomcraft)
  7. * All rights reserved.
  8. *
  9. * https://github.com/atomton/ATMHud
  10. */
  11. @class ATMTextLayer, ATMProgressLayer, ATMHud, ATMHudQueueItem;
  12. typedef enum {
  13. ATMHudApplyModeShow = 0,
  14. ATMHudApplyModeUpdate,
  15. ATMHudApplyModeHide
  16. } ATMHudApplyMode;
  17. @interface ATMHudView : UIView<CAAnimationDelegate> {
  18. NSString *caption;
  19. UIImage *image;
  20. UIActivityIndicatorView *activity;
  21. UIActivityIndicatorViewStyle activityStyle;
  22. ATMHud *p;
  23. BOOL showActivity;
  24. CGFloat progress;
  25. CGRect targetBounds;
  26. CGRect captionRect;
  27. CGRect progressRect;
  28. CGRect activityRect;
  29. CGRect imageRect;
  30. CGSize fixedSize;
  31. CGSize activitySize;
  32. CALayer *backgroundLayer;
  33. CALayer *imageLayer;
  34. ATMTextLayer *captionLayer;
  35. ATMProgressLayer *progressLayer;
  36. }
  37. @property (nonatomic, strong) NSString *caption;
  38. @property (nonatomic, strong) UIImage *image;
  39. @property (nonatomic, strong) UIActivityIndicatorView *activity;
  40. @property (nonatomic, assign) UIActivityIndicatorViewStyle activityStyle;
  41. @property (nonatomic, strong) ATMHud *p;
  42. @property (nonatomic, assign) BOOL showActivity;
  43. @property (nonatomic, assign) CGFloat progress;
  44. @property (nonatomic, assign) CGRect targetBounds;
  45. @property (nonatomic, assign) CGRect captionRect;
  46. @property (nonatomic, assign) CGRect progressRect;
  47. @property (nonatomic, assign) CGRect activityRect;
  48. @property (nonatomic, assign) CGRect imageRect;
  49. @property (nonatomic, assign) CGSize fixedSize;
  50. @property (nonatomic, assign) CGSize activitySize;
  51. @property (nonatomic, strong) CALayer *backgroundLayer;
  52. @property (nonatomic, strong) CALayer *imageLayer;
  53. @property (nonatomic, strong) ATMTextLayer *captionLayer;
  54. @property (nonatomic, strong) ATMProgressLayer *progressLayer;
  55. - (id)initWithFrame:(CGRect)frame andController:(ATMHud *)c;
  56. - (CGRect)sharpRect:(CGRect)rect;
  57. - (CGPoint)sharpPoint:(CGPoint)point;
  58. - (void)calculate;
  59. - (CGSize)calculateSizeForQueueItem:(ATMHudQueueItem *)item;
  60. - (CGSize)sizeForActivityStyle:(UIActivityIndicatorViewStyle)style;
  61. - (void)applyWithMode:(ATMHudApplyMode)mode;
  62. - (void)show;
  63. - (void)reset;
  64. - (void)update;
  65. - (void)hide;
  66. @end