element-ios/Riot/Modules/MediaPicker/MediaPickerViewController.h

96 lines
3 KiB
C
Raw Normal View History

2015-08-18 08:04:30 +00:00
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <MatrixKit/MatrixKit.h>
2016-01-19 17:59:40 +00:00
#import "MediaAlbumContentViewController.h"
2015-08-18 08:04:30 +00:00
@class MediaPickerViewController;
/**
`MediaPickerViewController` delegate.
*/
@protocol MediaPickerViewControllerDelegate <NSObject>
/**
Tells the delegate that the user select an image.
2015-08-18 08:04:30 +00:00
@param mediaPickerController the `MediaPickerViewController` instance.
@param imageData the full-sized image data of the selected image.
@param mimetype the image MIME type (nil if unknown).
@param isPhotoLibraryAsset tell whether the image has been selected from the user's photos library or not.
2015-08-18 08:04:30 +00:00
*/
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectImage:(NSData*)imageData withMimeType:(NSString *)mimetype isPhotoLibraryAsset:(BOOL)isPhotoLibraryAsset;
/**
Tells the delegate that the user select a video.
@param mediaPickerController the `MediaPickerViewController` instance.
@param videoURL the local url of the video to send.
*/
2016-01-19 17:59:40 +00:00
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectVideo:(NSURL*)videoURL;
2015-08-18 08:04:30 +00:00
/**
Tells the delegate that the user wants to cancel media picking.
@param mediaPickerController the `MediaPickerViewController` instance.
*/
- (void)mediaPickerControllerDidCancel:(MediaPickerViewController *)mediaPickerController;
@optional
/**
Tells the delegate that the user select multiple media.
@param mediaPickerController the `MediaPickerViewController` instance.
@param assets the selected media.
*/
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectAssets:(NSArray<PHAsset*>*)assets;
2015-08-18 08:04:30 +00:00
@end
/**
* MediaPickerViewController displays recent camera captures and photo/video albums from user library.
2015-08-18 08:04:30 +00:00
*/
@interface MediaPickerViewController : MXKViewController
2015-08-18 08:04:30 +00:00
/**
* Creates and returns a new `MediaPickerViewController` object.
*
* @discussion This is the designated initializer for programmatic instantiation.
*
* @return An initialized `MediaPickerViewController` object if successful, `nil` otherwise.
*/
+ (instancetype)instantiate;
2015-08-18 08:04:30 +00:00
/**
The delegate for the view controller.
*/
@property (nonatomic, weak) id<MediaPickerViewControllerDelegate> delegate;
2015-08-18 08:04:30 +00:00
/**
The array of the media types supported by the picker (default value is an array containing kUTTypeImage).
*/
@property (nonatomic) NSArray *mediaTypes;
/**
A Boolean value that determines whether users can select more than one item.
Default is NO.
*/
@property (nonatomic) BOOL allowsMultipleSelection;
2015-08-18 08:04:30 +00:00
@end