2012-05-07 20:18:01 +00:00
|
|
|
//
|
|
|
|
// MPAppDelegate_Key.h
|
|
|
|
// MasterPassword
|
|
|
|
//
|
|
|
|
// Created by Maarten Billemont on 24/11/11.
|
|
|
|
// Copyright (c) 2011 Lyndir. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "MPAppDelegate_Shared.h"
|
|
|
|
|
|
|
|
#import "UbiquityStoreManager.h"
|
|
|
|
|
2012-05-09 08:11:34 +00:00
|
|
|
typedef enum {
|
|
|
|
MPImportResultSuccess,
|
|
|
|
MPImportResultCancelled,
|
|
|
|
MPImportResultInvalidPassword,
|
|
|
|
MPImportResultMalformedInput,
|
|
|
|
MPImportResultInternalError,
|
|
|
|
} MPImportResult;
|
|
|
|
|
2013-04-20 18:11:19 +00:00
|
|
|
@interface MPAppDelegate_Shared(Store)<UbiquityStoreManagerDelegate>
|
2012-05-07 20:18:01 +00:00
|
|
|
|
2013-01-31 05:42:32 +00:00
|
|
|
+ (NSManagedObjectContext *)managedObjectContextForThreadIfReady;
|
2013-05-16 02:42:21 +00:00
|
|
|
+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock;
|
|
|
|
+ (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock;
|
2012-05-07 20:18:01 +00:00
|
|
|
|
2013-04-03 23:25:15 +00:00
|
|
|
- (UbiquityStoreManager *)storeManager;
|
2013-05-07 04:45:06 +00:00
|
|
|
|
|
|
|
- (void)addElementNamed:(NSString *)siteName completion:(void (^)(MPElementEntity *element))completion;
|
2013-06-15 05:39:24 +00:00
|
|
|
- (MPElementEntity *)changeElement:(MPElementEntity *)element inContext:(NSManagedObjectContext *)context toType:(MPElementType)type;
|
2012-08-19 07:34:49 +00:00
|
|
|
- (MPImportResult)importSites:(NSString *)importedSitesString
|
|
|
|
askImportPassword:(NSString *(^)(NSString *userName))importPassword
|
|
|
|
askUserPassword:(NSString *(^)(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword;
|
2012-05-08 13:57:11 +00:00
|
|
|
- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords;
|
|
|
|
|
2012-05-07 20:18:01 +00:00
|
|
|
@end
|