// // Copyright (c) 2017 Open Whisper Systems. All rights reserved. // extern NSString *const OWSMimeTypeApplicationOctetStream; extern NSString *const OWSMimeTypeImagePng; extern NSString *const OWSMimeTypeOversizeTextMessage; extern NSString *const OWSMimeTypeUnknownForTests; @interface MIMETypeUtil : NSObject + (BOOL)isSupportedVideoMIMEType:(NSString *)contentType; + (BOOL)isSupportedAudioMIMEType:(NSString *)contentType; + (BOOL)isSupportedImageMIMEType:(NSString *)contentType; + (BOOL)isSupportedAnimatedMIMEType:(NSString *)contentType; + (BOOL)isSupportedVideoFile:(NSString *)filePath; + (BOOL)isSupportedAudioFile:(NSString *)filePath; + (BOOL)isSupportedImageFile:(NSString *)filePath; + (BOOL)isSupportedAnimatedFile:(NSString *)filePath; + (NSString *)getSupportedExtensionFromVideoMIMEType:(NSString *)supportedMIMEType; + (NSString *)getSupportedExtensionFromAudioMIMEType:(NSString *)supportedMIMEType; + (NSString *)getSupportedExtensionFromImageMIMEType:(NSString *)supportedMIMEType; + (NSString *)getSupportedExtensionFromAnimatedMIMEType:(NSString *)supportedMIMEType; + (BOOL)isAnimated:(NSString *)contentType; + (BOOL)isImage:(NSString *)contentType; + (BOOL)isVideo:(NSString *)contentType; + (BOOL)isAudio:(NSString *)contentType; + (NSString *)filePathForAttachment:(NSString *)uniqueId ofMIMEType:(NSString *)contentType inFolder:(NSString *)folder; + (NSString *)filePathForImage:(NSString *)uniqueId ofMIMEType:(NSString *)contentType inFolder:(NSString *)folder; + (NSString *)filePathForVideo:(NSString *)uniqueId ofMIMEType:(NSString *)contentType inFolder:(NSString *)folder; + (NSString *)filePathForAudio:(NSString *)uniqueId ofMIMEType:(NSString *)contentType inFolder:(NSString *)folder; + (NSString *)filePathForAnimated:(NSString *)uniqueId ofMIMEType:(NSString *)contentType inFolder:(NSString *)folder; + (NSURL *)simLinkCorrectExtensionOfFile:(NSURL *)mediaURL ofMIMEType:(NSString *)contentType; + (NSSet *)supportedVideoUTITypes; + (NSSet *)supportedAudioUTITypes; + (NSSet *)supportedImageUTITypes; + (NSSet *)supportedAnimatedImageUTITypes; + (NSString *)utiTypeForMIMEType:(NSString *)mimeType; + (NSString *)fileExtensionForUTIType:(NSString *)utiType; + (NSString *)fileExtensionForMIMEType:(NSString *)mimeType; @end