PasswordWindowController.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // PasswordWindowController.h
  3. // PDF Reader
  4. //
  5. // Created by wangshuai on 13-12-3.
  6. // Copyright (c) 2013年 zhangjie. All rights reserved.
  7. //
  8. #import <Cocoa/Cocoa.h>
  9. @class PasswordWindowController;
  10. @protocol PasswordWindowDelegate <NSObject>
  11. @optional
  12. - (void)didFinshedUnlockFile:(PasswordWindowController*)passwordWindowCtr withPassword:(NSString*)password;
  13. - (void)didCancelUnlockFile:(PasswordWindowController*)passwordWindowCtr;
  14. @end
  15. @interface PasswordWindowController : NSWindowController{
  16. NSURL *_fileURL;
  17. // id<PasswordWindowDelegate> _passwordDelegate;
  18. NSInteger _tag;
  19. IBOutlet NSTextField *_passwordTextField;
  20. IBOutlet NSTextField *_titleTextField;
  21. IBOutlet NSTextField *_textField;
  22. IBOutlet NSButton *_openButton;
  23. IBOutlet NSButton *_cancelButton;
  24. }
  25. @property (nonatomic,retain) NSURL *fileURL;
  26. @property (nonatomic,weak) id<PasswordWindowDelegate> passwordDelegate;
  27. @property (nonatomic,assign) NSInteger tag;
  28. - (IBAction)cancelAction:(id)sender;
  29. - (IBAction)OKAction:(id)sender;
  30. - (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^)(NSString *password))handler;
  31. @end