IDMPhotoBrowser.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // IDMPhotoBrowser.h
  3. // IDMPhotoBrowser
  4. //
  5. // Created by Michael Waterfall on 14/10/2010.
  6. // Copyright 2010 d3i. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <MessageUI/MessageUI.h>
  10. #import "IDMPhoto.h"
  11. #import "IDMPhotoProtocol.h"
  12. #import "IDMCaptionView.h"
  13. // Delgate
  14. @class IDMPhotoBrowser;
  15. @protocol IDMPhotoBrowserDelegate <NSObject>
  16. @optional
  17. - (void)willAppearPhotoBrowser:(IDMPhotoBrowser *)photoBrowser;
  18. - (void)willDisappearPhotoBrowser:(IDMPhotoBrowser *)photoBrowser;
  19. - (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didShowPhotoAtIndex:(NSUInteger)index;
  20. - (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissAtPageIndex:(NSUInteger)index;
  21. - (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser willDismissAtPageIndex:(NSUInteger)index;
  22. - (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissActionSheetWithButtonIndex:(NSUInteger)buttonIndex photoIndex:(NSUInteger)photoIndex;
  23. - (IDMCaptionView *)photoBrowser:(IDMPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index;
  24. @end
  25. // IDMPhotoBrowser
  26. @interface IDMPhotoBrowser : UIViewController <UIScrollViewDelegate, UIActionSheetDelegate>
  27. // Properties
  28. @property (nonatomic, strong) id <IDMPhotoBrowserDelegate> delegate;
  29. // Toolbar customization
  30. @property (nonatomic) BOOL displayToolbar;
  31. @property (nonatomic) BOOL displayCounterLabel;
  32. @property (nonatomic) BOOL displayArrowButton;
  33. @property (nonatomic) BOOL displayActionButton;
  34. @property (nonatomic, strong) NSArray *actionButtonTitles;
  35. @property (nonatomic, weak) UIImage *leftArrowImage, *leftArrowSelectedImage;
  36. @property (nonatomic, weak) UIImage *rightArrowImage, *rightArrowSelectedImage;
  37. // View customization
  38. @property (nonatomic) BOOL displayDoneButton;
  39. @property (nonatomic) BOOL useWhiteBackgroundColor;
  40. @property (nonatomic, weak) UIImage *doneButtonImage;
  41. @property (nonatomic, weak) UIColor *trackTintColor, *progressTintColor;
  42. @property (nonatomic, weak) UIImage *scaleImage;
  43. @property (nonatomic) BOOL arrowButtonsChangePhotosAnimated;
  44. @property (nonatomic) BOOL forceHideStatusBar;
  45. @property (nonatomic) BOOL usePopAnimation;
  46. @property (nonatomic) BOOL disableVerticalSwipe;
  47. @property (nonatomic) BOOL dismissOnTouch;
  48. // Default value: true
  49. // Set to false to tell the photo viewer not to hide the interface when scrolling
  50. @property (nonatomic) BOOL autoHideInterface;
  51. // Defines zooming of the background (default 1.0)
  52. @property (nonatomic) float backgroundScaleFactor;
  53. // Animation time (default .28)
  54. @property (nonatomic) float animationDuration;
  55. // Init
  56. - (id)initWithPhotos:(NSArray *)photosArray;
  57. // Init (animated from view)
  58. - (id)initWithPhotos:(NSArray *)photosArray animatedFromView:(UIView*)view;
  59. // Init with NSURL objects
  60. - (id)initWithPhotoURLs:(NSArray *)photoURLsArray;
  61. // Init with NSURL objects (animated from view)
  62. - (id)initWithPhotoURLs:(NSArray *)photoURLsArray animatedFromView:(UIView*)view;
  63. // Reloads the photo browser and refetches data
  64. - (void)reloadData;
  65. // Set page that photo browser starts on
  66. - (void)setInitialPageIndex:(NSUInteger)index;
  67. // Get IDMPhoto at index
  68. - (id<IDMPhoto>)photoAtIndex:(NSUInteger)index;
  69. @end