1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 17:38:07 +01:00
Telegram/Telegraph/TGMediaPickerAssetsLibrary.h

32 lines
1.7 KiB
C
Raw Normal View History

2015-10-01 18:19:52 +02:00
#import "TGMediaPickerAsset.h"
#import "TGMediaPickerAssetsGroup.h"
typedef enum {
TGMediaPickerAuthorizationStatusNotDetermined,
TGMediaPickerAuthorizationStatusRestricted,
TGMediaPickerAuthorizationStatusDenied,
TGMediaPickerAuthorizationStatusAuthorized
} TGMediaPickerAuthorizationStatus;
@interface TGMediaPickerAssetsLibrary : NSObject
@property (nonatomic, readonly) TGMediaPickerAuthorizationStatus authorizationStatus;
@property (nonatomic, readonly) TGMediaPickerAssetType assetType;
@property (nonatomic, copy) void (^libraryChanged)(void);
- (instancetype)initForAssetType:(TGMediaPickerAssetType)assetType;
- (void)fetchAssetsGroupsWithCompletionBlock:(void(^)(NSArray *groups, TGMediaPickerAuthorizationStatus status, NSError *error))completionBlock;
- (void)fetchAssetsOfAssetsGroup:(TGMediaPickerAssetsGroup *)assetsGroup withCompletionBlock:(void (^)(NSArray *assets, TGMediaPickerAuthorizationStatus status, NSError *error))completionBlock;
- (void)fetchAssetsOfAssetsGroup:(TGMediaPickerAssetsGroup *)assetsGroup reversed:(bool)reversed withEnumerationBlock:(void (^)(TGMediaPickerAsset *, TGMediaPickerAuthorizationStatus, NSError *))enumerationBlock;
- (void)saveAssetWithImage:(UIImage *)image completionBlock:(void(^)(bool success, NSString *uniqueId, NSError *error))completionBlock;
- (void)saveAssetWithImageData:(NSData *)data completionBlock:(void(^)(bool success, NSString *uniqueId, NSError *error))completionBlock;
- (void)saveAssetWithImageAtURL:(NSURL *)url completionBlock:(void(^)(bool success, NSString *uniqueId, NSError *error))completionBlock;
- (void)saveAssetWithVideoAtURL:(NSURL *)url completionBlock:(void(^)(bool success, NSString *uniqueId, NSError *error))completionBlock;
+ (instancetype)sharedLibrary;
@end