//**********************************************************************************************************************
//
//  NSObject_PerformDeferred.h
//
//  Author:		Peter Baumgartner, peter@baumgartner.com
//  Copyright:	©2006-2009 by IMAGINE GbR. All rights reserved.
//	Abstract:	Category that performs a deferred method the next time through the runloop
//
//**********************************************************************************************************************


	@interface NSObject (PerformDeferred)

	// This group of methods is recommended over the older performDeferred methods. Here we are using the runloop
	// directly istead of going through an NSNotificationQueue, which adds extra overhead...

	- (void) performCoalescedSelector:(SEL)inSelector withObject:(id)inObject;
	- (void) performCoalescedSelector:(SEL)inSelector withObject:(id)inObject afterDelay:(double)inDelay;
	- (void) performDelayedSelector:(SEL)inSelector withObject:(id)inObject;
	- (void) cancelDelayedSelector:(SEL)inSelector withObject:(id)inObject;
	- (void) cancelAllDelayedSelectors;
	
	// The following methods will be deprecated in the future. Please use the newer methods listed above...
	
	- (void) registerDeferredSelector:(SEL)inSelector;
	- (void) unregisterDeferredSelector:(SEL)inSelector;
		
	- (void) performDeferredSelector:(SEL)inSelector;
	- (void) performDeferredSelector:(SEL)inSelector mode:(NSString*)inMode;
	- (void) cancelDeferredSelector:(SEL)inSelector;
	
	- (void) performCoalescedDeferredSelector:(SEL)inSelector;
	- (void) performCoalescedDeferredSelector:(SEL)inSelector mode:(NSString*)inMode;
	- (void) cancelCoalescedDeferredSelector:(SEL)inSelector;

	@end


//----------------------------------------------------------------------------------------------------------------------


	@interface NSRunLoop (PerformDeferred)
	+ (NSArray*) commonRunLoopModes;
	@end
	
	
//----------------------------------------------------------------------------------------------------------------------
