EntityCreator.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2014-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 "TextMessage.h"
  22. #import "BoxTextMessage.h"
  23. #import "GroupTextMessage.h"
  24. #import "ImageMessage.h"
  25. #import "BoxImageMessage.h"
  26. #import "GroupImageMessage.h"
  27. #import "VideoMessage.h"
  28. #import "BoxVideoMessage.h"
  29. #import "GroupVideoMessage.h"
  30. #import "AudioMessage.h"
  31. #import "BoxAudioMessage.h"
  32. #import "GroupAudioMessage.h"
  33. #import "LocationMessage.h"
  34. #import "BoxLocationMessage.h"
  35. #import "GroupLocationMessage.h"
  36. #import "SystemMessage.h"
  37. #import "LastGroupSyncRequest.h"
  38. #import "Group.h"
  39. #import "BallotMessage.h"
  40. #import "BoxBallotCreateMessage.h"
  41. #import "GroupBallotCreateMessage.h"
  42. #import "BallotChoice.h"
  43. #import "BallotResult.h"
  44. #import "FileMessage.h"
  45. #import "Nonce.h"
  46. #import "Tag.h"
  47. #import "WebClientSession.h"
  48. #import "RequestedConversation.h"
  49. #import "LastLoadedMessageIndex.h"
  50. #import "RequestedThumbnail.h"
  51. @interface EntityCreator : NSObject
  52. - (instancetype)init NS_UNAVAILABLE;
  53. - (instancetype)initWith:(NSManagedObjectContext *) managedObjectContext;
  54. - (TextMessage *)textMessageFromBox:(AbstractMessage *)boxMsg;
  55. - (TextMessage *)textMessageFromGroupBox:(GroupTextMessage *)boxMsg;
  56. - (ImageMessage *)imageMessageFromBox:(BoxImageMessage *)boxMsg;
  57. - (ImageMessage *)imageMessageFromGroupBox:(GroupImageMessage *)boxMsg;
  58. - (VideoMessage *)videoMessageFromBox:(BoxVideoMessage *)boxMsg;
  59. - (VideoMessage *)videoMessageFromGroupBox:(GroupVideoMessage *)boxMsg;
  60. - (AudioMessage *)audioMessageFromBox:(BoxAudioMessage *)boxMsg;
  61. - (AudioMessage *)audioMessageFromGroupBox:(GroupAudioMessage *)boxMsg;
  62. - (LocationMessage *)locationMessageFromBox:(BoxLocationMessage *)boxMsg;
  63. - (LocationMessage *)locationMessageFromGroupBox:(GroupLocationMessage *)boxMsg;
  64. - (BallotMessage *)ballotMessageFromBox:(AbstractMessage *)boxMsg;
  65. - (FileMessage *)fileMessageFromBox:(AbstractMessage *)boxMsg;
  66. - (ImageData *)imageData;
  67. - (AudioData *)audioData;
  68. - (VideoData *)videoData;
  69. - (FileData *)fileData;
  70. - (TextMessage *)textMessageForConversation:(Conversation *)conversation;
  71. - (ImageMessage *)imageMessageForConversation:(Conversation *)conversation;
  72. - (VideoMessage *)videoMessageForConversation:(Conversation *)conversation;
  73. - (FileMessage *)fileMessageForConversation:(Conversation *)conversation;
  74. - (AudioMessage *)audioMessageForConversation:(Conversation *)conversation;
  75. - (LocationMessage *)locationMessageForConversation:(Conversation *)conversation;
  76. - (SystemMessage *)systemMessageForConversation:(Conversation *)conversation;
  77. - (BallotMessage *)ballotMessageForConversation:(Conversation *)conversation;
  78. - (Contact *)contact;
  79. - (LastGroupSyncRequest *)lastGroupSyncRequest;
  80. - (Conversation *)conversation;
  81. - (Group *)group;
  82. - (Ballot *)ballot;
  83. - (BallotChoice *)ballotChoice;
  84. - (BallotResult *)ballotResult;
  85. - (Nonce *)nonceWithData:(NSData*)nonce;
  86. - (Tag *)tagWithName:(NSString *)name;
  87. - (WebClientSession *)webClientSession;
  88. - (RequestedConversation *)requestedConversationWithId:(NSString *)conversationId webClientSession:(WebClientSession*)webClientSession;
  89. - (LastLoadedMessageIndex *)lastLoadedMessageIndexWithBaseMessageId:(NSData *)baseMessageId index:(NSInteger)index webClientSession:(WebClientSession*)webClientSession;
  90. - (RequestedThumbnail *)requestedThumbnailWithMessageId:(NSData *)messageId webClientSession:(WebClientSession*)webClientSession;
  91. @end