//
//  PasswordWindowController.h
//  PDF Reader
//
//  Created by wangshuai on 13-12-3.
//  Copyright (c) 2013年 zhangjie. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class PasswordWindowController;
@protocol PasswordWindowDelegate <NSObject>
@optional
- (void)didFinshedUnlockFile:(PasswordWindowController*)passwordWindowCtr withPassword:(NSString*)password;
- (void)didCancelUnlockFile:(PasswordWindowController*)passwordWindowCtr;

@end

@interface PasswordWindowController : NSWindowController{
    NSURL *_fileURL;
//    id<PasswordWindowDelegate> _passwordDelegate;
    NSInteger _tag;
    
    IBOutlet NSTextField *_passwordTextField;
    IBOutlet NSTextField *_titleTextField;
    IBOutlet NSTextField *_textField;
    
    IBOutlet NSButton *_openButton;
    IBOutlet NSButton *_cancelButton;
}
@property (nonatomic,retain) NSURL *fileURL;
@property (nonatomic,weak) id<PasswordWindowDelegate> passwordDelegate;
@property (nonatomic,assign) NSInteger tag;

- (IBAction)cancelAction:(id)sender;
- (IBAction)OKAction:(id)sender;

- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^)(NSString *password))handler;


@end