FileMessage.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2015-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. #import <Foundation/Foundation.h>
  21. #import <CoreData/CoreData.h>
  22. #import "BaseMessage.h"
  23. #import "FileData.h"
  24. #import "BlobData.h"
  25. #import "ExternalStorageInfo.h"
  26. @class ImageData;
  27. @interface FileMessage : BaseMessage <BlobData, ExternalStorageInfo>
  28. @property (nonatomic, retain) NSData * encryptionKey;
  29. @property (nonatomic, retain) NSData * blobId;
  30. @property (nonatomic, retain) NSData * blobThumbnailId;
  31. @property (nonatomic, retain) NSString * fileName;
  32. @property (nonatomic, retain) NSNumber * fileSize;
  33. @property (nonatomic, retain) NSNumber * progress;
  34. @property (nonatomic, retain) NSNumber * type;
  35. @property (nonatomic, retain) NSString * mimeType;
  36. @property (nonatomic, retain) FileData *data;
  37. @property (nonatomic, retain) ImageData *thumbnail;
  38. @property (nonatomic, retain) NSString * json;
  39. // not stored in core data
  40. @property (nonatomic, retain) NSString *caption;
  41. @property (nonatomic, retain) NSString *correlationId;
  42. @property (nonatomic, retain) NSString *mimeTypeThumbnail;
  43. @property (nonatomic, retain) NSNumber *duration;
  44. @property (nonatomic, retain) NSNumber *height;
  45. @property (nonatomic, retain) NSNumber *width;
  46. - (NSString *)getCaption;
  47. - (NSURL *)tmpURL:(NSString *)tmpFileName;
  48. - (void)exportDataToURL:(NSURL *)url;
  49. - (BOOL)renderMediaFileMessage;
  50. - (BOOL)renderStickerFileMessage;
  51. - (BOOL)renderFileImageMessage;
  52. - (BOOL)renderFileVideoMessage;
  53. - (BOOL)renderFileAudioMessage;
  54. - (BOOL)renderFileGifMessage;
  55. - (BOOL)sendAsFileImageMessage;
  56. - (BOOL)sendAsFileVideoMessage;
  57. - (BOOL)sendAsFileAudioMessage;
  58. - (BOOL)sendAsFileGifMessage;
  59. - (BOOL)shouldShowCaption;
  60. - (NSNumber *)getDuration;
  61. - (NSNumber *)getHeight;
  62. - (NSNumber *)getWidth;
  63. @end