//
//  SRRecorderControl.h
//  ShortcutRecorder
//
//  Copyright 2006 Contributors. All rights reserved.
//
//  License: BSD
//
//  Contributors:
//      David Dauer
//      Jesper
//      Jamie Kirkpatrick

// #import <Cocoa/Cocoa.h> //Imported in PrefixHeader
#import "SRRecorderCell.h"

@interface SRRecorderControl : NSControl
{
	IBOutlet id delegate;
}

#pragma mark *** Aesthetics ***
- (BOOL)animates;
- (void)setAnimates:(BOOL)an;
- (SRRecorderStyle)style;
- (void)setStyle:(SRRecorderStyle)nStyle;

#pragma mark *** Delegate ***
- (id)delegate;
- (void)setDelegate:(id)aDelegate;

#pragma mark *** Key Combination Control ***

- (NSUInteger)allowedFlags;
- (void)setAllowedFlags:(NSUInteger)flags;

- (BOOL)allowsKeyOnly;
- (void)setAllowsKeyOnly:(BOOL)nAllowsKeyOnly escapeKeysRecord:(BOOL)nEscapeKeysRecord;
- (BOOL)escapeKeysRecord;

- (NSUInteger)requiredFlags;
- (void)setRequiredFlags:(NSUInteger)flags;

- (BOOL)canCaptureGlobalHotKeys;
- (void)setCanCaptureGlobalHotKeys:(BOOL)inState;

// added by Boinx to make Shortcut Recorder record global hot keys in Mousepose
- (BOOL)ignoresValidation;
- (void)setIgnoresValidation:(BOOL)inFlag;
// until here

// added by Boinx to make Shortcut Recorder drawing black text, in Mousepose even if shortcut recorder is empty 
- (BOOL)blackTextWhenEmpty;
- (void)setBlackTextWhenEmpty:(BOOL)inFlag;
// until here

- (KeyCombo)keyCombo;
- (void)setKeyCombo:(KeyCombo)aKeyCombo;
- (void)updateWithKeyCombo:(KeyCombo)aKeyCombo;	// just updates the display, e.g. to reflect a selection change

- (NSString *)keyChars;
- (NSString *)keyCharsIgnoringModifiers;

#pragma mark *** Autosave Control ***

- (NSString *)autosaveName;
- (void)setAutosaveName:(NSString *)aName;

#pragma mark IB3 tomfoolery

- (void)forIBuse__nilOutDeprecatedAutosaveName:(id)sender;

#pragma mark -

// Returns the displayed key combination if set
- (NSString *)keyComboString;

#pragma mark *** Conversion Methods ***

- (NSUInteger)cocoaToCarbonFlags:(NSUInteger)cocoaFlags;
- (NSUInteger)carbonToCocoaFlags:(NSUInteger)carbonFlags;

@end

// Delegate Methods
@interface NSObject (SRRecorderDelegate)
- (BOOL)shortcutRecorder:(SRRecorderControl *)aRecorder isKeyCode:(signed short)keyCode andFlagsTaken:(NSUInteger)flags reason:(NSString **)aReason;
- (void)shortcutRecorder:(SRRecorderControl *)aRecorder keyComboDidChange:(KeyCombo)newKeyCombo;
- (void)shortcutRecorder:(SRRecorderControl *)aRecorder beginsRecordingForKeyCombo:(KeyCombo)newKeyCombo;	
- (void)shortcutRecorder:(SRRecorderControl *)aRecorder endsRecordingForKeyCombo:(KeyCombo)newKeyCombo;	

@end
