2017-01-12 21:37:37 +01:00
|
|
|
//
|
2019-03-19 21:17:10 +01:00
|
|
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
2017-01-12 21:37:37 +01:00
|
|
|
//
|
|
|
|
|
2020-11-26 00:37:56 +01:00
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2019-03-19 21:17:10 +01:00
|
|
|
NSString *NSStringForNotificationType(NotificationType value);
|
|
|
|
|
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;
|
2018-03-08 15:53:11 +01:00
|
|
|
extern NSString *const OWSPreferencesCallLoggingDidChangeNotification;
|
2017-01-24 01:48:14 +01:00
|
|
|
|
2018-03-06 03:43:50 +01:00
|
|
|
@class YapDatabaseReadWriteTransaction;
|
|
|
|
|
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;
|
2017-12-19 03:34:22 +01:00
|
|
|
+ (void)setIsReadyForAppExtensions;
|
2017-11-28 19:46:26 +01:00
|
|
|
|
2018-08-08 18:04:59 +02:00
|
|
|
- (BOOL)hasSentAMessage;
|
2016-10-10 22:02:09 +02:00
|
|
|
- (void)setHasSentAMessage:(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;
|
|
|
|
|
2018-02-13 21:00:25 +01:00
|
|
|
- (void)setIOSUpgradeNagDate:(NSDate *)value;
|
|
|
|
- (nullable NSDate *)iOSUpgradeNagDate;
|
2017-05-17 23:54:51 +02:00
|
|
|
|
2018-03-19 18:00:19 +01:00
|
|
|
- (BOOL)hasGeneratedThumbnails;
|
|
|
|
- (void)setHasGeneratedThumbnails:(BOOL)value;
|
|
|
|
|
2018-10-11 01:17:42 +02:00
|
|
|
- (BOOL)shouldShowUnidentifiedDeliveryIndicators;
|
|
|
|
- (void)setShouldShowUnidentifiedDeliveryIndicators:(BOOL)value;
|
|
|
|
|
2017-02-02 18:21:48 +01:00
|
|
|
#pragma mark Callkit
|
|
|
|
|
2018-02-23 23:08:21 +01:00
|
|
|
- (BOOL)isSystemCallLogEnabled;
|
|
|
|
- (void)setIsSystemCallLogEnabled:(BOOL)flag;
|
|
|
|
|
|
|
|
#pragma mark - Legacy CallKit settings
|
|
|
|
|
2018-03-06 03:32:35 +01:00
|
|
|
- (void)applyCallLoggingSettingsForLegacyUsersWithTransaction:(YapDatabaseReadWriteTransaction *)transaction;
|
|
|
|
|
2017-02-25 04:15:11 +01:00
|
|
|
- (BOOL)isCallKitEnabled;
|
|
|
|
- (void)setIsCallKitEnabled:(BOOL)flag;
|
2018-02-23 23:08:21 +01:00
|
|
|
|
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
|