NCSettingsController.h 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #import "ARDSettingsModel.h"
  8. extern NSString * const kUserProfileDisplayName;
  9. extern NSString * const kUserProfileDisplayNameScope;
  10. extern NSString * const kUserProfileEmail;
  11. extern NSString * const kUserProfileEmailScope;
  12. extern NSString * const kUserProfilePhone;
  13. extern NSString * const kUserProfilePhoneScope;
  14. extern NSString * const kUserProfileAddress;
  15. extern NSString * const kUserProfileAddressScope;
  16. extern NSString * const kUserProfileWebsite;
  17. extern NSString * const kUserProfileWebsiteScope;
  18. extern NSString * const kUserProfileTwitter;
  19. extern NSString * const kUserProfileTwitterScope;
  20. extern NSString * const kUserProfileAvatarScope;
  21. extern NSString * const kUserProfileScopePrivate;
  22. extern NSString * const kUserProfileScopeLocal;
  23. extern NSString * const kUserProfileScopeFederated;
  24. extern NSString * const kUserProfileScopePublished;
  25. extern NSString * const NCSettingsControllerDidChangeActiveAccountNotification;
  26. @class NCExternalSignalingController;
  27. @class SignalingSettings;
  28. typedef void (^UpdatedProfileCompletionBlock)(NSError *error);
  29. typedef void (^LogoutCompletionBlock)(NSError *error);
  30. typedef void (^GetCapabilitiesCompletionBlock)(NSError *error);
  31. typedef void (^UpdateSignalingConfigCompletionBlock)(NCExternalSignalingController * _Nullable signalingServer, NSError * _Nullable error);
  32. typedef void (^SubscribeForPushNotificationsCompletionBlock)(BOOL success);
  33. typedef void (^EnsureSignalingConfigCompletionBlock)(NCExternalSignalingController * _Nullable signalingServer);
  34. typedef NS_ENUM(NSInteger, NCPreferredFileSorting) {
  35. NCAlphabeticalSorting = 1,
  36. NCModificationDateSorting
  37. };
  38. @interface NCSettingsController : NSObject
  39. @property (nonatomic, copy) ARDSettingsModel *videoSettingsModel;
  40. @property (nonatomic, strong) UIAlertController *updateAlertController;
  41. @property (nonatomic, strong) NSString *updateAlertControllerAccountId;
  42. @property (nonatomic, strong) NSMutableDictionary *signalingConfigurations; // accountId -> signalingConfigutation
  43. @property (nonatomic, strong) NSMutableDictionary *externalSignalingControllers; // accountId -> externalSignalingController
  44. + (instancetype)sharedInstance;
  45. - (void)addNewAccountForUser:(NSString *)user withToken:(NSString *)token inServer:(NSString *)server;
  46. - (void)setActiveAccountWithAccountId:(NSString *)accountId;
  47. - (void)getUserProfileForAccountId:(NSString *)accountId withCompletionBlock:(UpdatedProfileCompletionBlock)block;
  48. - (void)logoutAccountWithAccountId:(NSString *)accountId withCompletionBlock:(LogoutCompletionBlock)block;
  49. - (void)getCapabilitiesForAccountId:(NSString *)accountId withCompletionBlock:(GetCapabilitiesCompletionBlock)block;
  50. - (void)updateSignalingConfigurationForAccountId:(NSString * _Nonnull)accountId withCompletionBlock:(UpdateSignalingConfigCompletionBlock _Nonnull)block;
  51. - (NCExternalSignalingController * _Nullable)setSignalingConfigurationForAccountId:(NSString * _Nonnull)accountId withSettings:(SignalingSettings * _Nonnull)settings;
  52. - (void)ensureSignalingConfigurationForAccountId:(NSString * _Nonnull)accountId withSettings:(SignalingSettings * _Nullable)settings withCompletionBlock:(EnsureSignalingConfigCompletionBlock _Nonnull)block;
  53. - (NCExternalSignalingController * _Nullable)externalSignalingControllerForAccountId:(NSString * _Nonnull)accountId;
  54. - (void)connectDisconnectedExternalSignalingControllers;
  55. - (void)disconnectAllExternalSignalingControllers;
  56. - (void)subscribeForPushNotificationsForAccountId:(NSString *)accountId withCompletionBlock:(SubscribeForPushNotificationsCompletionBlock)block;
  57. - (NSInteger)chatMaxLengthConfigCapability;
  58. - (BOOL)canCreateGroupAndPublicRooms;
  59. - (BOOL)isGuestsAppEnabled;
  60. - (BOOL)isReferenceApiSupported;
  61. - (BOOL)isRecordingEnabled;
  62. - (NCPreferredFileSorting)getPreferredFileSorting;
  63. - (void)setPreferredFileSorting:(NCPreferredFileSorting)sorting;
  64. - (BOOL)isContactSyncEnabled;
  65. - (void)setContactSync:(BOOL)enabled;
  66. - (BOOL)didReceiveCallsFromOldAccount;
  67. - (void)setDidReceiveCallsFromOldAccount:(BOOL)receivedOldCalls;
  68. @end