NCMessageParameter.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: GPL-3.0-or-later
  4. */
  5. #import <Foundation/Foundation.h>
  6. #import <UIKit/UIKit.h>
  7. @interface NCMessageParameter : NSObject
  8. @property (nonatomic, strong) NSString *parameterId;
  9. @property (nonatomic, strong) NSString *name;
  10. @property (nonatomic, strong) NSString * _Nullable link;
  11. @property (nonatomic, strong) NSString *type;
  12. @property (nonatomic, assign) NSRange range;
  13. @property (nonatomic, strong) NSString *contactName;
  14. @property (nonatomic, strong) NSString *contactPhoto;
  15. // Helper property for mentions created using the app
  16. @property (nonatomic, strong) NSString *mentionId;
  17. @property (nonatomic, strong) NSString *mentionDisplayName;
  18. - (instancetype)initWithDictionary:(NSDictionary *)parameterDict;
  19. - (BOOL)shouldBeHighlighted;
  20. - (UIImage * _Nullable)contactPhotoImage;
  21. // parametersDict as [NSString:NCMessageParameter]
  22. + (NSString *)messageParametersJSONStringFromDictionary:(NSDictionary *)parametersDict;
  23. + (NSDictionary<NSString *, NCMessageParameter *> *)messageParametersDictFromJSONString:(NSString *)parametersJSONString;
  24. @end