2017-05-07 18:36:01 -04:00
|
|
|
//==============================================================================
|
|
|
|
// This file is part of Master Password.
|
|
|
|
// Copyright (c) 2011-2017, Maarten Billemont.
|
2012-06-04 11:27:02 +02:00
|
|
|
//
|
2017-05-07 18:36:01 -04:00
|
|
|
// Master Password is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2012-06-04 11:27:02 +02:00
|
|
|
//
|
2017-05-07 18:36:01 -04:00
|
|
|
// Master Password is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2012-06-04 11:27:02 +02:00
|
|
|
//
|
2017-05-07 18:36:01 -04:00
|
|
|
// You can find a copy of the GNU General Public License in the
|
|
|
|
// LICENSE file. Alternatively, see <http://www.gnu.org/licenses/>.
|
|
|
|
//==============================================================================
|
2012-06-04 11:27:02 +02:00
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2017-05-01 18:32:52 -04:00
|
|
|
#import "MPSiteEntity+CoreDataClass.h"
|
|
|
|
#import "MPStoredSiteEntity+CoreDataClass.h"
|
|
|
|
#import "MPGeneratedSiteEntity+CoreDataClass.h"
|
|
|
|
#import "MPUserEntity+CoreDataClass.h"
|
2012-07-17 22:57:11 +02:00
|
|
|
#import "MPAlgorithm.h"
|
2014-09-15 01:00:23 -04:00
|
|
|
#import "MPFixable.h"
|
2012-06-04 11:27:02 +02:00
|
|
|
|
2012-06-06 00:59:09 +02:00
|
|
|
#define MPAvatarCount 19
|
|
|
|
|
2013-04-13 13:40:17 -04:00
|
|
|
@interface NSManagedObjectContext(MP)
|
2013-01-31 00:42:32 -05:00
|
|
|
|
2013-04-13 13:40:17 -04:00
|
|
|
- (BOOL)saveToStore;
|
2013-01-31 00:42:32 -05:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2017-04-29 23:52:57 -04:00
|
|
|
@interface NSManagedObject(MP)
|
|
|
|
|
|
|
|
- (NSManagedObjectID *)permanentObjectID;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2016-02-20 21:56:04 -05:00
|
|
|
@interface MPSiteQuestionEntity(MP)
|
|
|
|
|
|
|
|
- (NSString *)resolveQuestionAnswerUsingKey:(MPKey *)key;
|
|
|
|
- (void)resolveQuestionAnswerUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2014-09-21 10:39:09 -04:00
|
|
|
@interface MPSiteEntity(MP)<MPFixable>
|
2013-04-20 14:11:19 -04:00
|
|
|
|
2014-09-15 01:00:23 -04:00
|
|
|
@property(assign) BOOL loginGenerated;
|
2017-08-12 21:57:47 -04:00
|
|
|
@property(assign) MPResultType type;
|
2013-04-20 14:11:19 -04: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 10:01:41 -05:00
|
|
|
@property(strong) id<MPAlgorithm> algorithm;
|
2012-06-05 00:55:02 +02:00
|
|
|
|
|
|
|
- (NSUInteger)use;
|
2014-09-24 07:58:23 -04:00
|
|
|
- (BOOL)tryMigrateExplicitly:(BOOL)explicit;
|
2014-09-15 01:00:23 -04:00
|
|
|
- (NSString *)resolveLoginUsingKey:(MPKey *)key;
|
|
|
|
- (NSString *)resolvePasswordUsingKey:(MPKey *)key;
|
2016-02-20 21:56:04 -05:00
|
|
|
- (NSString *)resolveSiteAnswerUsingKey:(MPKey *)key;
|
2014-09-15 01:00:23 -04:00
|
|
|
- (void)resolveLoginUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
|
|
|
- (void)resolvePasswordUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
2016-02-20 21:56:04 -05:00
|
|
|
- (void)resolveSiteAnswerUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
2016-04-23 23:56:16 -04:00
|
|
|
- (void)resolveAnswerUsingKey:(MPKey *)key forQuestion:(NSString *)question result:(void ( ^ )(NSString *))result;
|
2012-06-04 11:27:02 +02:00
|
|
|
|
|
|
|
@end
|
2012-06-05 00:55:02 +02:00
|
|
|
|
2014-09-21 11:47:53 -04:00
|
|
|
@interface MPGeneratedSiteEntity(MP)
|
2012-06-05 00:55:02 +02:00
|
|
|
|
2017-08-12 21:57:47 -04:00
|
|
|
@property(assign) MPCounterValue counter;
|
2012-06-05 00:55:02 +02:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2013-04-20 14:11:19 -04:00
|
|
|
@interface MPUserEntity(MP)
|
2012-06-05 00:55:02 +02:00
|
|
|
|
2013-04-20 14:11:19 -04:00
|
|
|
@property(assign) NSUInteger avatar;
|
|
|
|
@property(assign) BOOL saveKey;
|
2016-01-14 02:14:36 -05:00
|
|
|
@property(assign) BOOL touchID;
|
2017-08-12 21:57:47 -04:00
|
|
|
@property(assign) MPResultType defaultType;
|
2013-04-20 14:11:19 -04:00
|
|
|
@property(readonly) NSString *userID;
|
2015-02-28 10:01:41 -05:00
|
|
|
@property(strong) id<MPAlgorithm> algorithm;
|
2012-06-14 21:56:54 +02:00
|
|
|
|
|
|
|
+ (NSString *)idFor:(NSString *)userName;
|
2012-06-05 00:55:02 +02:00
|
|
|
|
|
|
|
@end
|