Files
MacPass/MacPass/MPDocument+Search.h
michael starke be5889c5b1 Search criteriy is objetified. Can be stored and saved in preferences.
This is a first step to enable saved searches inside the Keepass database via use of custom data.
2014-08-27 19:43:03 +02:00

38 lines
1.3 KiB
Objective-C

//
// MPDocument+Search.h
// MacPass
//
// Created by Michael Starke on 25.02.14.
// Copyright (c) 2014 HicknHack Software GmbH. All rights reserved.
//
#import "MPDocument.h"
@class MPEntrySearchContext;
FOUNDATION_EXTERN NSString *const MPDocumentDidEnterSearchNotification;
FOUNDATION_EXTERN NSString *const MPDocumentDidChangeSearchFlags;
FOUNDATION_EXTERN NSString *const MPDocumentDidExitSearchNotification;
/**
* Posted by the document, when the search results have been updated. This is only called when searching.
* If the search is exited, it will be notified by MPDocumentDidExitSearchNotification
* The userInfo dictionary has one key kMPDocumentSearchResultsKey with an NSArray of KPKEntries mathching the search.
*/
FOUNDATION_EXTERN NSString *const MPDocumentDidChangeSearchResults;
/* keys used in userInfo dictionaries on notifications */
FOUNDATION_EXTERN NSString *const kMPDocumentSearchResultsKey;
@interface MPDocument (Search)
- (void)enterSearchWithContext:(MPEntrySearchContext *)context;
/* Should be called by the NSSearchTextField to update the search string */
- (IBAction)updateSearch:(id)sender;
/* exits searching mode */
- (IBAction)exitSearch:(id)sender;
/* called by the filter toggle buttons */
- (IBAction)toggleSearchFlags:(id)sender;
@end