Prevent sending 0-byte files. Fixes #8711.
[adiumx.git] / Source / AIPasswordPromptController.h
blob4210faf37c5d67390e6302051a10ae0feffc711a
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 /*!
20 * @class AIPasswordPromptController
22 * This abstract superclass simplifies displaying a password prompt and notifying a target when the
23 * password is entered.
25 @interface AIPasswordPromptController : AIWindowController {
26 IBOutlet NSTextField *textField_password;
27 IBOutlet NSButton *checkBox_savePassword;
28 IBOutlet NSButton *button_OK;
30 NSString *password;
32 SEL selector;
33 id target;
35 id context;
38 /*!
39 * @brief Designated initializer for AIPasswordPromptController
41 * @param windowNibName Nib name.
42 * @param password Iniital password to put in the password field. If nil, the field will be empty.
43 * @param inTarget Target to notify when the prompt window is closed
44 * @param inSelector Selector on target. Signature is - (void)passwordReturnedForConnect:(NSString *)inPassword context:(id)inContext
45 * @param context Context to pass back when notifying the target.
47 * @result An AIPasswordPromptController
49 - (id)initWithWindowNibName:(NSString *)windowNibName password:(NSString *)password notifyingTarget:(id)inTarget selector:(SEL)inSelector context:(id)inContext;
50 - (IBAction)cancel:(id)sender;
51 - (IBAction)okay:(id)sender;
52 - (IBAction)togglePasswordSaved:(id)sender;
54 @end
56 @interface AIPasswordPromptController (PRIVATE_and_Subclasses)
57 - (NSString *)savedPasswordKey;
58 - (void)windowDidLoad;
59 - (void)savePassword:(NSString *)password;
60 - (void)setTarget:(id)inTarget selector:(SEL)inSelector context:(id)inContext;
61 @end