2015-12-07 03:31:43 +01:00
|
|
|
//
|
|
|
|
// TSStorageManager.h
|
|
|
|
// TextSecureKit
|
|
|
|
//
|
|
|
|
// Created by Frederic Jacobs on 27/10/14.
|
|
|
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "TSStorageKeys.h"
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <YapDatabase/YapDatabase.h>
|
|
|
|
|
|
|
|
@class ECKeyPair;
|
|
|
|
@class PreKeyRecord;
|
|
|
|
@class SignedPreKeyRecord;
|
2016-11-08 02:42:44 +01:00
|
|
|
@class TSPrivacyPreferences;
|
2015-12-07 03:31:43 +01:00
|
|
|
|
|
|
|
extern NSString *const TSUIDatabaseConnectionDidUpdateNotification;
|
|
|
|
|
|
|
|
@interface TSStorageManager : NSObject
|
|
|
|
|
|
|
|
+ (instancetype)sharedManager;
|
|
|
|
- (void)setupDatabase;
|
|
|
|
- (void)deleteThreadsAndMessages;
|
|
|
|
- (BOOL)databasePasswordAccessible;
|
|
|
|
- (void)wipeSignalStorage;
|
|
|
|
|
|
|
|
- (YapDatabase *)database;
|
|
|
|
- (YapDatabaseConnection *)newDatabaseConnection;
|
|
|
|
|
|
|
|
|
|
|
|
- (void)setObject:(id)object forKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (void)removeObjectForKey:(NSString *)string inCollection:(NSString *)collection;
|
|
|
|
|
|
|
|
|
|
|
|
- (BOOL)boolForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (int)intForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (void)setInt:(int)integer forKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (id)objectForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (NSDictionary *)dictionaryForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (NSString *)stringForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (NSData *)dataForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (ECKeyPair *)keyPairForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (PreKeyRecord *)preKeyRecordForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (SignedPreKeyRecord *)signedPreKeyRecordForKey:(NSString *)key inCollection:(NSString *)collection;
|
|
|
|
- (void)purgeCollection:(NSString *)collection;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) YapDatabaseConnection *dbConnection;
|
2016-11-08 02:42:44 +01:00
|
|
|
@property (nonatomic, readonly) TSPrivacyPreferences *privacyPreferences;
|
2015-12-07 03:31:43 +01:00
|
|
|
|
|
|
|
@end
|