X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/29eb1a7ef6ff49cace92432b1813845fd3a7d1e9..d9649564199a7220e70716aa0999c6fddb0efadc:/ITHotKey.m diff --git a/ITHotKey.m b/ITHotKey.m new file mode 100755 index 0000000..bf411f9 --- /dev/null +++ b/ITHotKey.m @@ -0,0 +1,91 @@ +// +// ITHotKey.m +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import "ITHotKey.h" + +#import "ITHotKeyCenter.h" +#import "ITKeyCombo.h" + +@implementation ITHotKey + +- (id)init +{ + self = [super init]; + + if( self ) + { + [self setKeyCombo: [ITKeyCombo clearKeyCombo]]; + } + + return self; +} + +- (void)dealloc +{ + [mName release]; + [mKeyCombo release]; + + [super dealloc]; +} + +- (NSString*)description +{ + return [NSString stringWithFormat: @"<%@: %@>", NSStringFromClass( [self class] ), [self keyCombo]]; +} + +#pragma mark - + +- (void)setKeyCombo: (ITKeyCombo*)combo +{ + [combo retain]; + [mKeyCombo release]; + mKeyCombo = combo; +} + +- (ITKeyCombo*)keyCombo +{ + return mKeyCombo; +} + +- (void)setName: (NSString*)name +{ + [name retain]; + [mName release]; + mName = name; +} + +- (NSString*)name +{ + return mName; +} + +- (void)setTarget: (id)target +{ + mTarget = target; +} + +- (id)target +{ + return mTarget; +} + +- (void)setAction: (SEL)action +{ + mAction = action; +} + +- (SEL)action +{ + return mAction; +} + +- (void)invoke +{ + [mTarget performSelector: mAction withObject: self]; +} + +@end