//
//  BITrash.h
//  BIViews
//
//  Created by Oscar Perez on 2019-07-08.
//

#import <Foundation/Foundation.h>
#import <MCApplication/MCWindowController.h>
#import <BISubstrate/BIDatabaseObjectContext.h>
#import <BISubstrate/BPURLDownloader.h>
#import <BISubstrate/BISubstrateDefines.h>

NS_ASSUME_NONNULL_BEGIN

@interface BITrash : NSWindowController <NSSearchFieldDelegate>

@property (nonatomic, retain) BIDatabaseObjectContext *oc;
@property (nonatomic, retain) IBOutlet NSArrayController *deletedObjectsController;
@property (nonatomic, retain) IBOutlet NSButton *restoreButton;
@property (nonatomic, retain) IBOutlet NSTextField *status;
@property (nonatomic, retain) IBOutlet NSSearchField *searchField;


@property (assign) NSUInteger downloadedItemsCount;
@property (assign) NSUInteger failedDownloadsItemsCount;
@property (assign) NSUInteger restoredItemsCount;

- (IBAction)fetchDeletedData:(id)sender;
- (IBAction)restoreSlipsFromArchiveFolder:(id)sender;
- (IBAction)search:(id)sender;

- (void)downloader:(BPURLDownloader *)downloader failedWithError:(NSError *)anError;
- (void)downloaderDidFinish:(BPURLDownloader *)downloader;


@end

NS_ASSUME_NONNULL_END
