#import "KLSIconImageView.h"
#define kPrompterResponseSpacing 8
#define kPrompterPromptSpacing 12
typedef struct LoginWindowState {
NSControl *usernameControl;
NSControl *realmControl;
krb5_flags flags;
KLLifetime lifetime;
KLBoolean renewable;
KLLifetime renewableLifetime;
KLLifetime startTime;
KLBoolean forwardable;
KLBoolean proxiable;
KLBoolean addressless;
const char *serviceName;
NSMutableString *acquiredPrincipalString;
NSMutableString *acquiredCacheNameString;
} LoginWindowState;
@interface KLSController : NSObject
{
IBOutlet NSWindow *loginWindow;
IBOutlet NSTextField *loginHeaderTextField;
IBOutlet NSButton *loginOkButton;
IBOutlet NSButton *loginCancelButton;
IBOutlet KLSIconImageView *loginKerberosIconImageView;
IBOutlet NSTextField *loginVersionTextField;
IBOutlet NSSecureTextField *loginPasswordSecureTextField;
IBOutlet NSComboBox *loginRealmComboBox;
IBOutlet NSTextField *loginCallerProvidedRealmTextField;
IBOutlet NSTextField *loginUsernameTextField;
IBOutlet NSTextField *loginCallerProvidedUsernameTextField;
IBOutlet NSButton *loginOptionsButton;
IBOutlet NSBox *loginOptionsBox;
IBOutlet NSButton *loginAddresslessCheckbox;
IBOutlet NSButton *loginForwardableCheckbox;
IBOutlet NSButton *loginRenewableCheckbox;
IBOutlet NSTextField *loginRenewableLifetimeText;
IBOutlet NSSlider *loginRenewableLifetimeSlider;
IBOutlet NSTextField *loginLifetimeText;
IBOutlet NSSlider *loginLifetimeSlider;
float loginWindowOptionsOnFrameHeight;
float loginWindowOptionsOffFrameHeight;
IBOutlet NSWindow *changePasswordWindow;
IBOutlet NSButton *changePasswordOkButton;
IBOutlet NSButton *changePasswordCancelButton;
IBOutlet KLSIconImageView *changePasswordKerberosIconImageView;
IBOutlet NSTextField *changePasswordVersionTextField;
IBOutlet NSTextField *changePasswordPrincipalTextField;
IBOutlet NSSecureTextField *changePasswordOldPasswordSecureTextField;
IBOutlet NSSecureTextField *changePasswordNewPasswordSecureTextField;
IBOutlet NSSecureTextField *changePasswordVerifyPasswordSecureTextField;
IBOutlet NSWindow *prompterWindow;
IBOutlet NSButton *prompterOkButton;
IBOutlet NSButton *prompterCancelButton;
IBOutlet KLSIconImageView *prompterKerberosIconImageView;
IBOutlet NSTextField *prompterVersionTextField;
IBOutlet NSTextField *prompterBannerTextField;
IBOutlet NSMatrix *prompterPromptsMatrix;
IBOutlet NSBox *prompterResponsesBox;
NSSize prompterWindowSize;
NSRect singleResponseFrame;
LoginWindowState loginState;
}
- (id) init;
- (void) dealloc;
- (void) awakeFromNib;
#pragma mark -
- (void) applicationDidFinishLaunching: (NSNotification *) aNotification;
- (void) controlTextDidChange: (NSNotification *) aNotification;
- (void) comboBoxSelectionDidChange: (NSNotification *) aNotification;
- (void) comboBoxWillDismiss: (NSNotification *) aNotification;
#pragma mark -
- (KLStatus) getTicketsForPrincipal: (const char *) principalUTF8String
flags: (krb5_flags) flags
lifetime: (KLLifetime) lifetime
renewableLifetime: (KLLifetime) renewableLifetime
startTime: (KLTime) startTime
forwardable: (KLBoolean) forwardable
proxiable: (KLBoolean) proxiable
addressless: (KLBoolean) addressless
serviceName: (const char *) serviceName
applicationName: (const char *) applicationNameString
applicationIconPath: (const char *) applicationIconPathString;
- (void) loginUpdateOkButton;
- (void) loginUpdateWithCallerProvidedPrincipal: (KLBoolean) callerProvidedPrincipal;
- (void) loginSetupSlider: (NSSlider *) slider
textField: (NSTextField *) textField
minimum: (int) minimum
maximum: (int) maximum
value: (int) value;
- (IBAction) loginAddresslessCheckboxWasHit: (id) sender;
- (IBAction) loginForwardableCheckboxWasHit: (id) sender;
- (IBAction) loginRenewableCheckboxWasHit: (id) sender;
- (IBAction) loginLifetimeSliderChanged: (id) sender;
- (IBAction) loginRenewableLifetimeSliderChanged: (id) sender;
- (IBAction) loginOptionsButtonWasHit: (id) sender;
- (IBAction) loginCancelButtonWasHit: (id) sender;
- (IBAction) loginOkButtonWasHit: (id) sender;
- (void) loginSaveOptionsIfNeeded;
- (const char *) loginAcquiredPrincipal;
- (const char *) loginAcquiredCacheName;
#pragma mark -
- (KLStatus) changePasswordForPrincipal: (const char *) principalUTF8String;
- (void) changePasswordUpdateOkButton;
- (IBAction) changePasswordCancelButtonWasHit: (id) sender;
- (IBAction) changePasswordOkButtonWasHit: (id) sender;
#pragma mark -
- (krb5_error_code) promptWithTitle: (const char *) title
banner: (const char *) banner
prompts: (krb5_prompt *) prompts
promptCount: (int) promptCount;
- (IBAction) prompterCancelButtonWasHit: (id) sender;
- (IBAction) prompterOkButtonWasHit: (id) sender;
#pragma mark -
- (void) displayKLError: (KLStatus) error;
- (void) displayKLError: (KLStatus) error
windowIdentifier: (KLDialogIdentifier) identifier;
- (void) displayServerError: (const char *) errorUTF8String
description: (const char *) descriptionUTF8String;
- (void) displayError: (NSString *) errorCString
description: (NSString *) descriptionCString;
- (BOOL) askYesNoQuestion: (NSString *) question;
#pragma mark -
- (int) displayAndRunWindow: (NSWindow *) window;
- (void) sheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (void *) cInfo;
- (NSWindow *) frontWindow;
@end