ftp.nice.ch/Attic/openStep/implementation/gnustep/sources/libFoundation.0.7.tgz#/libFoundation-0.7/libFoundation/Foundation/NSRunLoop.h

This is NSRunLoop.h in view mode; [Download] [Up]

/* 
   NSRunLoop.h

   Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
   All rights reserved.

   Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>

   This file is part of libFoundation.

   Permission to use, copy, modify, and distribute this software and its
   documentation for any purpose and without fee is hereby granted, provided
   that the above copyright notice appear in all copies and that both that
   copyright notice and this permission notice appear in supporting
   documentation.

   We disclaim all warranties with regard to this software, including all
   implied warranties of merchantability and fitness, in no event shall
   we be liable for any special, indirect or consequential damages or any
   damages whatsoever resulting from loss of use, data or profits, whether in
   an action of contract, negligence or other tortious action, arising out of
   or in connection with the use or performance of this software.
*/

#ifndef __NSRunLoop_h__
#define __NSRunLoop_h__

#include <Foundation/NSObject.h>

@class NSString;
@class NSDate;
@class NSTimer;
@class NSConnection;
@class NSMutableArray;
@class NSMutableDictionary;

extern NSString* NSDefaultRunLoopMode;
extern NSString* NSConnectionReplyMode;

@interface NSRunLoop : NSObject
{
    NSMutableDictionary* inputsForMode;
    NSString*		mode;
}

/* Accessing the Current Run Loop */
+ (NSRunLoop*)currentRunLoop;
- (NSString*)currentMode;
- (NSDate*)limitDateForMode:(NSString*)mode;

/* Adding Timers */
- (void)addTimer:(NSTimer*)aTimer
	forMode:(NSString*)mode;

/* Running a Run Loop */
- (void)acceptInputForMode:(NSString*)mode
	beforeDate:(NSDate*)limitDate;
- (void)run;
- (BOOL)runMode:(NSString*)mode
	beforeDate:(NSDate*)limitDate;
- (void)runUntilDate:(NSDate*)limitDate;

@end


@interface NSRunLoop (Extensions)
+ (void)setConcreteEventLoopClass:(Class)aClass;
+ (Class)concreteEventLoopClass;

- (void)addConnection:(NSConnection*)connection;
- (void)removeConnection:(NSConnection*)connection;

- (void)addFileDescriptor:(int)fd
    handler:handler
    userInfo:(id)anArgument
    forMode:(NSString*)mode;
- (void)removeFileDescriptor:(int)fd
    forMode:(NSString*)mode;

+ (void)pushRunLoop:(NSRunLoop*)runLoop;
+ (void)popRunLoop;
+ (NSArray*)runLoopsStack;

// Private methods
- (void)dispatchEventOnConnection:(NSConnection*)connection;
@end


/* Protocol that have to be adopted by a file descriptor handler */
@interface NSObject (FileDescriptorHandler)
- dataOnFileDescriptor:(int)fd userInfo:(id)anArgument;
@end


#endif /* __NSRunLoop_h__ */

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.