Added `-[NSArray validateAsPropertyList]` and `-[NSDictionary validateAsPropertyList...
[adiumx.git] / Source / AIPasswordPromptController.h
blob26943bf28a7d3c8bb1b79d5ad0344f82bd141b66
1 /*
2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
4 *
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #include "AIWindowController.h"
19 typedef enum {
20 AIPasswordPromptOKReturn = 0,
21 AIPasswordPromptCancelReturn
22 } AIPasswordPromptReturn;
24 /*!
25 * @class AIPasswordPromptController
27 * This abstract superclass simplifies displaying a password prompt and notifying a target when the
28 * password is entered.
30 @interface AIPasswordPromptController : AIWindowController {
31 IBOutlet NSTextField *textField_password;
32 IBOutlet NSButton *checkBox_savePassword;
33 IBOutlet NSButton *button_OK;
35 NSString *password;
37 SEL selector;
38 id target;
40 id context;
43 /*!
44 * @brief Designated initializer for AIPasswordPromptController
46 * @param windowNibName Nib name.
47 * @param password Iniital password to put in the password field. If nil, the field will be empty.
48 * @param inTarget Target to notify when the prompt window is closed
49 * @param inSelector Selector on target. Signature is - (void)passwordReturnedForConnect:(NSString *)inPassword returnCode:(AIPasswordPromptReturn)returnCode context:(id)inContext
50 * @param context Context to pass back when notifying the target.
52 * @result An AIPasswordPromptController
54 - (id)initWithWindowNibName:(NSString *)windowNibName password:(NSString *)password notifyingTarget:(id)inTarget selector:(SEL)inSelector context:(id)inContext;
55 - (IBAction)cancel:(id)sender;
56 - (IBAction)okay:(id)sender;
57 - (IBAction)togglePasswordSaved:(id)sender;
59 @end
61 @interface AIPasswordPromptController (PRIVATE_and_Subclasses)
62 - (NSString *)savedPasswordKey;
63 - (void)windowDidLoad;
64 - (void)savePassword:(NSString *)password;
65 - (void)setTarget:(id)inTarget selector:(SEL)inSelector context:(id)inContext;
66 @end