2017-05-07 22:36:01 +00:00
|
|
|
//==============================================================================
|
|
|
|
// This file is part of Master Password.
|
|
|
|
// Copyright (c) 2011-2017, Maarten Billemont.
|
2012-06-04 09:27:02 +00:00
|
|
|
//
|
2017-05-07 22:36:01 +00: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 09:27:02 +00:00
|
|
|
//
|
2017-05-07 22:36:01 +00: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 09:27:02 +00:00
|
|
|
//
|
2017-05-07 22:36:01 +00: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 09:27:02 +00:00
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2017-05-01 22:32:52 +00:00
|
|
|
#import "MPSiteEntity+CoreDataClass.h"
|
|
|
|
#import "MPStoredSiteEntity+CoreDataClass.h"
|
|
|
|
#import "MPGeneratedSiteEntity+CoreDataClass.h"
|
|
|
|
#import "MPUserEntity+CoreDataClass.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;
|
2017-08-13 01:57:47 +00:00
|
|
|
@property(assign) MPResultType 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
|
|
|
|
2017-08-13 01:57:47 +00:00
|
|
|
@property(assign) MPCounterValue 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;
|
2017-08-13 01:57:47 +00:00
|
|
|
@property(assign) MPResultType 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
|