2017-01-12 21:37:37 +01:00
|
|
|
//
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2016-10-10 22:02:09 +02:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2016-11-12 18:22:29 +01:00
|
|
|
/**
|
|
|
|
* The users privacy preference for what kind of content to show in lock screen notifications.
|
|
|
|
*/
|
2016-10-10 22:02:09 +02:00
|
|
|
typedef NS_ENUM(NSUInteger, NotificationType) {
|
|
|
|
NotificationNoNameNoPreview,
|
|
|
|
NotificationNameNoPreview,
|
|
|
|
NotificationNamePreview,
|
|
|
|
};
|
|
|
|
|
2017-01-24 01:48:14 +01:00
|
|
|
// Used when migrating logging to NSUserDefaults.
|
2017-09-14 21:45:04 +02:00
|
|
|
extern NSString *const OWSPreferencesSignalDatabaseCollection;
|
|
|
|
extern NSString *const OWSPreferencesKeyEnableDebugLog;
|
2017-01-24 01:48:14 +01:00
|
|
|
|
2017-09-14 21:45:04 +02:00
|
|
|
@interface OWSPreferences : NSObject
|
2014-05-06 19:41:08 +02:00
|
|
|
|
2016-10-10 22:02:09 +02:00
|
|
|
#pragma mark - Helpers
|
|
|
|
|
|
|
|
- (nullable id)tryGetValueForKey:(NSString *)key;
|
|
|
|
- (void)setValueForKey:(NSString *)key toValue:(nullable id)value;
|
2015-12-22 12:45:09 +01:00
|
|
|
- (void)clear;
|
2014-05-06 19:41:08 +02:00
|
|
|
|
2016-10-10 22:02:09 +02:00
|
|
|
#pragma mark - Specific Preferences
|
|
|
|
|
2017-11-28 22:30:08 +01:00
|
|
|
+ (BOOL)isReadyForAppExtensions;
|
|
|
|
+ (void)setIsReadyForAppExtensions:(BOOL)value;
|
2017-11-28 19:46:26 +01:00
|
|
|
|
2017-12-06 19:53:01 +01:00
|
|
|
// TSAccountManager is the source of truth; this is less reliable
|
|
|
|
// and should only be used in edge cases where the database is not
|
|
|
|
// yet available.
|
|
|
|
+ (BOOL)isRegistered;
|
|
|
|
+ (void)setIsRegistered:(BOOL)value;
|
|
|
|
|
2016-10-10 22:02:09 +02:00
|
|
|
- (BOOL)getHasSentAMessage;
|
|
|
|
- (void)setHasSentAMessage:(BOOL)enabled;
|
|
|
|
|
|
|
|
- (BOOL)getHasArchivedAMessage;
|
|
|
|
- (void)setHasArchivedAMessage:(BOOL)enabled;
|
|
|
|
|
2017-12-01 18:20:09 +01:00
|
|
|
+ (BOOL)isLoggingEnabled;
|
|
|
|
+ (void)setIsLoggingEnabled:(BOOL)flag;
|
2016-10-10 22:02:09 +02:00
|
|
|
|
|
|
|
- (BOOL)screenSecurityIsEnabled;
|
|
|
|
- (void)setScreenSecurity:(BOOL)flag;
|
|
|
|
|
|
|
|
- (NotificationType)notificationPreviewType;
|
|
|
|
- (void)setNotificationPreviewType:(NotificationType)type;
|
|
|
|
- (NSString *)nameForNotificationPreviewType:(NotificationType)notificationType;
|
|
|
|
|
|
|
|
- (BOOL)soundInForeground;
|
|
|
|
- (void)setSoundInForeground:(BOOL)enabled;
|
|
|
|
|
2017-02-17 04:47:12 +01:00
|
|
|
- (BOOL)hasDeclinedNoContactsView;
|
|
|
|
- (void)setHasDeclinedNoContactsView:(BOOL)value;
|
|
|
|
|
2017-05-17 23:54:51 +02:00
|
|
|
- (void)setIOSUpgradeNagVersion:(NSString *)value;
|
|
|
|
- (nullable NSString *)iOSUpgradeNagVersion;
|
|
|
|
|
2017-02-02 18:21:48 +01:00
|
|
|
#pragma mark - Calling
|
|
|
|
|
|
|
|
#pragma mark Callkit
|
|
|
|
|
2017-02-25 04:15:11 +01:00
|
|
|
- (BOOL)isCallKitEnabled;
|
|
|
|
- (void)setIsCallKitEnabled:(BOOL)flag;
|
2017-02-27 20:37:42 +01:00
|
|
|
// Returns YES IFF isCallKitEnabled has been set by user.
|
|
|
|
- (BOOL)isCallKitEnabledSet;
|
|
|
|
|
2017-02-22 05:17:54 +01:00
|
|
|
- (BOOL)isCallKitPrivacyEnabled;
|
|
|
|
- (void)setIsCallKitPrivacyEnabled:(BOOL)flag;
|
2017-02-27 20:37:42 +01:00
|
|
|
// Returns YES IFF isCallKitPrivacyEnabled has been set by user.
|
|
|
|
- (BOOL)isCallKitPrivacySet;
|
2017-02-02 18:21:48 +01:00
|
|
|
|
2017-02-22 16:06:01 +01:00
|
|
|
#pragma mark direct call connectivity (non-TURN)
|
|
|
|
|
|
|
|
- (BOOL)doCallsHideIPAddress;
|
|
|
|
- (void)setDoCallsHideIPAddress:(BOOL)flag;
|
|
|
|
|
2016-10-10 22:02:09 +02:00
|
|
|
#pragma mark - Push Tokens
|
|
|
|
|
|
|
|
- (void)setPushToken:(NSString *)value;
|
|
|
|
- (nullable NSString *)getPushToken;
|
|
|
|
|
|
|
|
- (void)setVoipToken:(NSString *)value;
|
|
|
|
- (nullable NSString *)getVoipToken;
|
|
|
|
|
2017-11-07 20:28:08 +01:00
|
|
|
- (void)unsetRecordedAPNSTokens;
|
|
|
|
|
2014-05-06 19:41:08 +02:00
|
|
|
@end
|
2016-10-10 22:02:09 +02:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|