NCPoll.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: GPL-3.0-or-later
  4. */
  5. #import <Foundation/Foundation.h>
  6. typedef NS_ENUM(NSInteger, NCPollStatus) {
  7. NCPollStatusOpen = 0,
  8. NCPollStatusClosed
  9. };
  10. typedef NS_ENUM(NSInteger, NCPollResultMode) {
  11. NCPollResultModePublic = 0,
  12. NCPollResultModeHidden
  13. };
  14. @interface NCPoll : NSObject
  15. @property (nonatomic, assign) NSInteger pollId;
  16. @property (nonatomic, strong) NSString *question;
  17. @property (nonatomic, strong) NSArray *options;
  18. @property (nonatomic, strong) NSDictionary *votes;
  19. @property (nonatomic, strong) NSString *actorType;
  20. @property (nonatomic, strong) NSString *actorId;
  21. @property (nonatomic, strong) NSString *actorDisplayName;
  22. @property (nonatomic, assign) NCPollStatus status;
  23. @property (nonatomic, assign) NCPollResultMode resultMode;
  24. @property (nonatomic, assign) NSInteger maxVotes;
  25. @property (nonatomic, strong) NSArray *votedSelf;
  26. @property (nonatomic, assign) NSInteger numVoters;
  27. @property (nonatomic, strong) NSArray *details;
  28. + (instancetype)initWithPollDictionary:(NSDictionary *)pollDict;
  29. @end