2
0
MasterPassword/MasterPassword/ObjC/MPEntities.h

63 lines
1.5 KiB
Objective-C

//
// MPEntities.h
// MasterPassword-iOS
//
// Created by Maarten Billemont on 31/05/12.
// Copyright (c) 2012 Lyndir. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MPSiteEntity.h"
#import "MPStoredSiteEntity.h"
#import "MPGeneratedSiteEntity.h"
#import "MPUserEntity.h"
#import "MPAlgorithm.h"
#import "MPFixable.h"
#define MPAvatarCount 19
@interface NSManagedObjectContext(MP)
- (BOOL)saveToStore;
@end
@interface MPSiteEntity(MP)<MPFixable>
@property(assign) BOOL loginGenerated;
@property(assign) MPSiteType type;
@property(readonly) NSString *typeName;
@property(readonly) NSString *typeShortName;
@property(readonly) NSString *typeClassName;
@property(readonly) Class typeClass;
@property(assign) NSUInteger uses;
@property(assign) NSUInteger version;
@property(assign) BOOL requiresExplicitMigration;
@property(readonly) id<MPAlgorithm> algorithm;
- (NSUInteger)use;
- (BOOL)tryMigrateExplicitly:(BOOL)explicit;
- (NSString *)resolveLoginUsingKey:(MPKey *)key;
- (NSString *)resolvePasswordUsingKey:(MPKey *)key;
- (void)resolveLoginUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
- (void)resolvePasswordUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
@end
@interface MPGeneratedSiteEntity(MP)
@property(assign) NSUInteger counter;
@end
@interface MPUserEntity(MP)
@property(assign) NSUInteger avatar;
@property(assign) BOOL saveKey;
@property(assign) MPSiteType defaultType;
@property(readonly) NSString *userID;
+ (NSString *)idFor:(NSString *)userName;
@end