mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 00:02:28 +00:00
Disabled re-locking of already locked documents Disabled locking of documents without a password
60 lines
1.8 KiB
Objective-C
60 lines
1.8 KiB
Objective-C
//
|
|
// MPDocument.h
|
|
// MacPass
|
|
//
|
|
// Created by Michael Starke on 08.05.13.
|
|
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
#import "MPDatabaseVersion.h"
|
|
|
|
|
|
APPKIT_EXTERN NSString *const MPDocumentDidAddGroupNotification;
|
|
APPKIT_EXTERN NSString *const MPDocumentWillDelteGroupNotification;
|
|
APPKIT_EXTERN NSString *const MPDocumentDidAddEntryNotification;
|
|
APPKIT_EXTERN NSString *const MPDocumentWillDeleteEntryNotification;
|
|
|
|
APPKIT_EXTERN NSString *const MPDocumentEntryKey;
|
|
APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
|
|
|
@class KdbGroup;
|
|
@class KdbEntry;
|
|
@class KdbTree;
|
|
@class UUID;
|
|
|
|
@interface MPDocument : NSDocument
|
|
|
|
/* true, if password and/or keyfile are set */
|
|
@property (assign, readonly, getter = isSecured) BOOL secured;
|
|
/* true, if lock screen is present (no phyiscal locking) */
|
|
@property (assign, getter = isLocked) BOOL locked;
|
|
/* true, if document is loaded and decrypted (tree is loaded) */
|
|
@property (assign, readonly, getter = isDecrypted) BOOL decrypted;
|
|
@property (retain, readonly) KdbTree *tree;
|
|
@property (assign, readonly) KdbGroup *root;
|
|
@property (nonatomic,retain) NSString *password;
|
|
@property (nonatomic, retain) NSURL *key;
|
|
@property (assign, readonly) MPDatabaseVersion version;
|
|
|
|
|
|
- (id)initWithVersion:(MPDatabaseVersion)version;
|
|
- (BOOL)decryptWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL;
|
|
|
|
/* Lookup */
|
|
- (KdbEntry *)findEntry:(UUID *)uuid;
|
|
|
|
/* Undoable Intiialization of elements */
|
|
- (KdbGroup *)createGroup:(KdbGroup *)parent;
|
|
- (KdbEntry *)createEntry:(KdbGroup *)parent;
|
|
|
|
/*
|
|
Undoable movement of object
|
|
*/
|
|
- (void)moveGroup:(KdbGroup *)group toGroup:(KdbGroup *)target index:(NSInteger)index;
|
|
- (BOOL)group:(KdbGroup *)group isMoveableToGroup:(KdbGroup *)target;
|
|
|
|
- (void)moveEntry:(KdbEntry *)entry toGroup:(KdbGroup *)target index:(NSInteger)index;
|
|
|
|
@end
|