2012-06-04 09:27:02 +00:00
|
|
|
//
|
2014-09-21 14:39:09 +00:00
|
|
|
// MPEntities.h
|
2012-06-04 09:27:02 +00:00
|
|
|
// MasterPassword-iOS
|
|
|
|
//
|
|
|
|
// Created by Maarten Billemont on 31/05/12.
|
|
|
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2014-09-21 14:39:09 +00:00
|
|
|
#import "MPSiteEntity.h"
|
2014-09-21 15:47:53 +00:00
|
|
|
#import "MPStoredSiteEntity.h"
|
|
|
|
#import "MPGeneratedSiteEntity.h"
|
2012-06-04 09:27:02 +00:00
|
|
|
#import "MPUserEntity.h"
|
2012-07-17 20:57:11 +00:00
|
|
|
#import "MPAlgorithm.h"
|
2014-09-15 05:00:23 +00:00
|
|
|
#import "MPFixable.h"
|
2012-06-04 09:27:02 +00:00
|
|
|
|
2012-06-05 22:59:09 +00:00
|
|
|
#define MPAvatarCount 19
|
|
|
|
|
2013-04-13 17:40:17 +00:00
|
|
|
@interface NSManagedObjectContext(MP)
|
2013-01-31 05:42:32 +00:00
|
|
|
|
2013-04-13 17:40:17 +00:00
|
|
|
- (BOOL)saveToStore;
|
2013-01-31 05:42:32 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2017-04-30 03:52:57 +00:00
|
|
|
@interface NSManagedObject(MP)
|
|
|
|
|
|
|
|
- (NSManagedObjectID *)permanentObjectID;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2016-02-21 02:56:04 +00:00
|
|
|
@interface MPSiteQuestionEntity(MP)
|
|
|
|
|
|
|
|
- (NSString *)resolveQuestionAnswerUsingKey:(MPKey *)key;
|
|
|
|
- (void)resolveQuestionAnswerUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2014-09-21 14:39:09 +00:00
|
|
|
@interface MPSiteEntity(MP)<MPFixable>
|
2013-04-20 18:11:19 +00:00
|
|
|
|
2014-09-15 05:00:23 +00:00
|
|
|
@property(assign) BOOL loginGenerated;
|
2014-09-21 14:39:09 +00:00
|
|
|
@property(assign) MPSiteType type;
|
2013-04-20 18:11:19 +00:00
|
|
|
@property(readonly) NSString *typeName;
|
|
|
|
@property(readonly) NSString *typeShortName;
|
|
|
|
@property(readonly) NSString *typeClassName;
|
|
|
|
@property(readonly) Class typeClass;
|
|
|
|
@property(assign) NSUInteger uses;
|
|
|
|
@property(assign) BOOL requiresExplicitMigration;
|
2015-02-28 15:01:41 +00:00
|
|
|
@property(strong) id<MPAlgorithm> algorithm;
|
2012-06-04 22:55:02 +00:00
|
|
|
|
|
|
|
- (NSUInteger)use;
|
2014-09-24 11:58:23 +00:00
|
|
|
- (BOOL)tryMigrateExplicitly:(BOOL)explicit;
|
2014-09-15 05:00:23 +00:00
|
|
|
- (NSString *)resolveLoginUsingKey:(MPKey *)key;
|
|
|
|
- (NSString *)resolvePasswordUsingKey:(MPKey *)key;
|
2016-02-21 02:56:04 +00:00
|
|
|
- (NSString *)resolveSiteAnswerUsingKey:(MPKey *)key;
|
2014-09-15 05:00:23 +00:00
|
|
|
- (void)resolveLoginUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
|
|
|
- (void)resolvePasswordUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
2016-02-21 02:56:04 +00:00
|
|
|
- (void)resolveSiteAnswerUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
2016-04-24 03:56:16 +00:00
|
|
|
- (void)resolveAnswerUsingKey:(MPKey *)key forQuestion:(NSString *)question result:(void ( ^ )(NSString *))result;
|
2012-06-04 09:27:02 +00:00
|
|
|
|
|
|
|
@end
|
2012-06-04 22:55:02 +00:00
|
|
|
|
2014-09-21 15:47:53 +00:00
|
|
|
@interface MPGeneratedSiteEntity(MP)
|
2012-06-04 22:55:02 +00:00
|
|
|
|
2013-04-20 18:11:19 +00:00
|
|
|
@property(assign) NSUInteger counter;
|
2012-06-04 22:55:02 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2013-04-20 18:11:19 +00:00
|
|
|
@interface MPUserEntity(MP)
|
2012-06-04 22:55:02 +00:00
|
|
|
|
2013-04-20 18:11:19 +00:00
|
|
|
@property(assign) NSUInteger avatar;
|
|
|
|
@property(assign) BOOL saveKey;
|
2016-01-14 07:14:36 +00:00
|
|
|
@property(assign) BOOL touchID;
|
2014-09-21 14:39:09 +00:00
|
|
|
@property(assign) MPSiteType defaultType;
|
2013-04-20 18:11:19 +00:00
|
|
|
@property(readonly) NSString *userID;
|
2015-02-28 15:01:41 +00:00
|
|
|
@property(strong) id<MPAlgorithm> algorithm;
|
2012-06-14 19:56:54 +00:00
|
|
|
|
|
|
|
+ (NSString *)idFor:(NSString *)userName;
|
2012-06-04 22:55:02 +00:00
|
|
|
|
|
|
|
@end
|