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.
|
|
|
|
*/
|
|
|
|
|
2021-11-30 15:09:53 +00:00
|
|
|
#import "MatrixKit.h"
|
2015-08-18 08:04:30 +00:00
|
|
|
|
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>
|
|
|
|
|
|
|
|
/**
|
2015-09-02 07:43:52 +00:00
|
|
|
Tells the delegate that the user select an image.
|
2015-08-18 08:04:30 +00:00
|
|
|
|
|
|
|
@param mediaPickerController the `MediaPickerViewController` instance.
|
2017-11-17 13:33:24 +00:00
|
|
|
@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
|
|
|
*/
|
2017-11-17 13:33:24 +00:00
|
|
|
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectImage:(NSData*)imageData withMimeType:(NSString *)mimetype isPhotoLibraryAsset:(BOOL)isPhotoLibraryAsset;
|
2015-09-02 07:43:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user select a video.
|
|
|
|
|
|
|
|
@param mediaPickerController the `MediaPickerViewController` instance.
|
2021-07-08 15:26:19 +00:00
|
|
|
@param videoAsset an `AVAsset` that represents the video to send.
|
2015-09-02 07:43:52 +00:00
|
|
|
*/
|
2021-07-08 15:26:19 +00:00
|
|
|
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectVideo:(AVAsset*)videoAsset;
|
2015-08-18 08:04:30 +00:00
|
|
|
|
2019-08-02 15:04:14 +00:00
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to cancel media picking.
|
|
|
|
|
|
|
|
@param mediaPickerController the `MediaPickerViewController` instance.
|
|
|
|
*/
|
|
|
|
- (void)mediaPickerControllerDidCancel:(MediaPickerViewController *)mediaPickerController;
|
|
|
|
|
2016-08-04 15:59:26 +00:00
|
|
|
@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
|
|
|
|
|
|
|
|
/**
|
2019-08-02 15:04:14 +00:00
|
|
|
* MediaPickerViewController displays recent camera captures and photo/video albums from user library.
|
2015-08-18 08:04:30 +00:00
|
|
|
*/
|
2019-08-02 15:04:14 +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.
|
|
|
|
*/
|
2019-08-02 15:04:14 +00:00
|
|
|
+ (instancetype)instantiate;
|
2015-08-18 08:04:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
The delegate for the view controller.
|
|
|
|
*/
|
2019-04-24 15:56:03 +00:00
|
|
|
@property (nonatomic, weak) id<MediaPickerViewControllerDelegate> delegate;
|
2015-08-18 08:04:30 +00:00
|
|
|
|
2015-09-02 07:43:52 +00:00
|
|
|
/**
|
|
|
|
The array of the media types supported by the picker (default value is an array containing kUTTypeImage).
|
|
|
|
*/
|
|
|
|
@property (nonatomic) NSArray *mediaTypes;
|
|
|
|
|
2019-08-02 15:04:14 +00:00
|
|
|
/**
|
|
|
|
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
|
|
|
|
|