BallotChoice.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 <CoreData/CoreData.h>
  22. @class Ballot, BallotResult;
  23. @interface BallotChoice : NSManagedObject
  24. @property (nonatomic, retain) NSDate * createDate;
  25. @property (nonatomic, retain) NSNumber * id;
  26. @property (nonatomic, retain) NSDate * modifyDate;
  27. @property (nonatomic, retain) NSString * name;
  28. @property (nonatomic, retain) NSNumber * orderPosition;
  29. @property (nonatomic, retain) Ballot *ballot;
  30. @property (nonatomic, retain) NSSet *result;
  31. @end
  32. @interface BallotChoice (CoreDataGeneratedAccessors)
  33. - (void)addResultObject:(BallotResult *)value;
  34. - (void)removeResultObject:(BallotResult *)value;
  35. - (void)addResult:(NSSet *)values;
  36. - (void)removeResult:(NSSet *)values;
  37. #pragma mark - own methods
  38. - (BallotResult *)getOwnResult;
  39. - (BallotResult *)getResultForId:(NSString *)contactId;
  40. - (void)removeResultForContact:(NSString *)contactId;
  41. - (NSInteger)totalCountOfResultsTrue;
  42. - (NSSet*)participantIdsForResultsTrue;
  43. - (NSSet *)getAllParticipantIds;
  44. @end