1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // MWPhotoBrowser.h
- // MWPhotoBrowser
- //
- // Created by Michael Waterfall on 14/10/2010.
- // Copyright 2010 d3i. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #import <MediaPlayer/MediaPlayer.h>
- #import <AVKit/AVKit.h>
- #import "MWPhoto.h"
- #import "MWPhotoProtocol.h"
- #import "MWCaptionView.h"
- // Debug Logging
- #if 0 // Set to 1 to enable debug logging
- #define MWLog(x, ...) NSLog(x, ## __VA_ARGS__);
- #else
- #define MWLog(x, ...)
- #endif
- @class MWPhotoBrowser;
- @protocol MWPhotoBrowserDelegate <NSObject>
- - (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser;
- - (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index;
- @optional
- - (MWCaptionView *)photoBrowser:(MWPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index;
- - (NSString *)photoBrowser:(MWPhotoBrowser *)photoBrowser titleForPhotoAtIndex:(NSUInteger)index;
- - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index;
- - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser actionButtonPressedForPhotoAtIndex:(NSUInteger)index;
- - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser shareButtonPressedForPhotoAtIndex:(NSUInteger)index;
- - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser deleteButtonPressedForPhotoAtIndex:(NSUInteger)index deleteButton:(UIBarButtonItem *)deleteButton;
- - (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUInteger)index;
- - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected;
- - (void)photoBrowserDidFinishPresentation:(MWPhotoBrowser *)photoBrowser;
- - (void)setControlsHidden:(BOOL)hidden animated:(BOOL)animated permanent:(BOOL)permanent;
- @end
- @interface MWPhotoBrowser : UIViewController <UIScrollViewDelegate, UIActionSheetDelegate>
- @property (nonatomic, weak) IBOutlet id<MWPhotoBrowserDelegate> delegate;
- @property (nonatomic) BOOL zoomPhotosToFill;
- @property (nonatomic) BOOL displayNavArrows;
- @property (nonatomic) BOOL displayActionButton;
- @property (nonatomic) BOOL displayShareButton; //TWS
- @property (nonatomic) BOOL displayDeleteButton; //TWS
- @property (nonatomic) BOOL displaySelectionButtons;
- @property (nonatomic) BOOL displayPopoverButton; //TWS
- @property (nonatomic) BOOL alwaysShowControls;
- @property (nonatomic) BOOL enableSwipeToDismiss;
- @property (nonatomic) BOOL autoPlayOnAppear;
- @property (nonatomic) NSUInteger delayToHideElements;
- @property (nonatomic, readonly) NSUInteger currentIndex;
- // Customise image selection icons as they are the only icons with a colour tint
- // Icon should be located in the app's main bundle
- @property (nonatomic, strong) NSString *customImageSelectedIconName;
- @property (nonatomic, strong) NSString *customImageSelectedSmallIconName;
- @property (nonatomic, strong) UIBarButtonItem *previousButton, *nextButton, *actionButton, *doneButton, *popoverButton, *deleteButton, *shareButton; //TWS
- //TWS Navigation & controls
- @property (nonatomic, strong) UIToolbar *toolbar;
- // Video
- @property (nonatomic, strong) AVPlayer *currentVideoPlayer;
- // Init
- - (id)initWithPhotos:(NSArray *)photosArray;
- - (id)initWithDelegate:(id <MWPhotoBrowserDelegate>)delegate;
- // Reloads the photo browser and refetches data
- - (void)reloadData;
- // Set page that photo browser starts on
- - (void)setCurrentPhotoIndex:(NSUInteger)index;
- // Navigation
- - (void)showNextPhotoAnimated:(BOOL)animated;
- - (void)showPreviousPhotoAnimated:(BOOL)animated;
- - (void)hideControls;
- - (void)showControls;
- @end
|