Conversation.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2012-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. @class Ballot, BaseMessage, Contact, ImageData, Tag;
  23. @interface Conversation : NSManagedObject
  24. @property (nonatomic, retain) NSData * groupId;
  25. @property (nonatomic, retain) NSDate * groupImageSetDate; // used to keep proper order when processing multiple set photo images
  26. @property (nonatomic, retain) NSString * groupMyIdentity; //this users id when group was created (the user might have created a new one in the mean time)
  27. @property (nonatomic, retain) NSString * groupName;
  28. @property (nonatomic, retain) NSDate * lastTypingStart;
  29. @property (nonatomic, retain) NSNumber * typing;
  30. @property (nonatomic, retain) NSNumber * unreadMessageCount;
  31. @property (nonatomic, retain) NSNumber *marked;
  32. @property (nonatomic, retain) NSOrderedSet *ballots;
  33. @property (nonatomic, retain) Contact *contact;
  34. @property (nonatomic, retain) ImageData *groupImage;
  35. @property (nonatomic, retain) BaseMessage *lastMessage;
  36. @property (nonatomic, retain) NSSet *members;
  37. @property (nonatomic, retain) NSSet *messages;
  38. @property (nonatomic, retain) NSSet *tags;
  39. @property (readonly) NSString* displayName;
  40. @property (readonly) NSArray* sortedMembers;
  41. @end
  42. @interface Conversation (CoreDataGeneratedAccessors)
  43. - (void)insertObject:(Ballot *)value inBallotsAtIndex:(NSUInteger)idx;
  44. - (void)removeObjectFromBallotsAtIndex:(NSUInteger)idx;
  45. - (void)insertBallots:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
  46. - (void)removeBallotsAtIndexes:(NSIndexSet *)indexes;
  47. - (void)replaceObjectInBallotsAtIndex:(NSUInteger)idx withObject:(Ballot *)value;
  48. - (void)replaceBallotsAtIndexes:(NSIndexSet *)indexes withBallots:(NSArray *)values;
  49. - (void)addBallotsObject:(Ballot *)value;
  50. - (void)removeBallotsObject:(Ballot *)value;
  51. - (void)addBallots:(NSOrderedSet *)values;
  52. - (void)removeBallots:(NSOrderedSet *)values;
  53. - (void)addMembersObject:(Contact *)value;
  54. - (void)removeMembersObject:(Contact *)value;
  55. - (void)addMembers:(NSSet *)values;
  56. - (void)removeMembers:(NSSet *)values;
  57. - (void)addMessagesObject:(BaseMessage *)value;
  58. - (void)removeMessagesObject:(BaseMessage *)value;
  59. - (void)addMessages:(NSSet *)values;
  60. - (void)removeMessages:(NSSet *)values;
  61. - (void)addTagsObject:(Tag *)value;
  62. - (void)removeTagsObject:(Tag *)value;
  63. - (void)addTags:(NSSet *)values;
  64. - (void)removeTags:(NSSet *)values;
  65. #pragma mark - own methods
  66. - (BOOL)wasDeleted;
  67. - (BOOL)isGroup;
  68. - (NSString *)sortedMemberNames;
  69. - (NSSet *)participants;
  70. @end