]> err.no Git - sope/blob - libFoundation/Foundation/NSRunLoop.h
fixed some NGMail framework build issue
[sope] / libFoundation / Foundation / NSRunLoop.h
1 /* 
2    NSRunLoop.h
3
4    Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
5    All rights reserved.
6
7    Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
8
9    This file is part of libFoundation.
10
11    Permission to use, copy, modify, and distribute this software and its
12    documentation for any purpose and without fee is hereby granted, provided
13    that the above copyright notice appear in all copies and that both that
14    copyright notice and this permission notice appear in supporting
15    documentation.
16
17    We disclaim all warranties with regard to this software, including all
18    implied warranties of merchantability and fitness, in no event shall
19    we be liable for any special, indirect or consequential damages or any
20    damages whatsoever resulting from loss of use, data or profits, whether in
21    an action of contract, negligence or other tortious action, arising out of
22    or in connection with the use or performance of this software.
23 */
24
25 #ifndef __NSRunLoop_h__
26 #define __NSRunLoop_h__
27
28 #include <Foundation/NSObject.h>
29
30 @class NSString, NSDate, NSTimer, NSNotification;
31 @class NSPosixFileDescriptor;
32 @class NSMutableArray, NSMutableDictionary;
33 @class NSPort;
34
35 LF_EXPORT NSString *NSDefaultRunLoopMode;
36 LF_EXPORT NSString *NSConnectionReplyMode;
37
38 LF_EXPORT NSString *NSFileObjectBecameActiveNotificationName; // not OpenStep
39
40 @interface NSRunLoop : NSObject
41 {
42     NSMutableDictionary *inputsForMode;
43     NSString            *mode;
44 }
45
46 /* Accessing the Current Run Loop */
47 + (NSRunLoop*)currentRunLoop;
48 - (NSString*)currentMode;
49 - (NSDate*)limitDateForMode:(NSString*)mode;
50
51 /* Adding Timers */
52 - (void)addTimer:(NSTimer*)aTimer
53         forMode:(NSString*)mode;
54
55 /* Running a Run Loop */
56 - (void)acceptInputForMode:(NSString*)mode
57         beforeDate:(NSDate*)limitDate;
58 - (void)run;
59 - (BOOL)runMode:(NSString*)mode
60         beforeDate:(NSDate*)limitDate;
61 - (void)runUntilDate:(NSDate*)limitDate;
62
63 /* Delayed perform of an action */
64 - (void)performSelector:(SEL)aSelector
65   target:(id)target
66   argument:(id)anArgument
67   order:(unsigned)order
68   modes:(NSArray*)modes;
69 - (void)cancelPerformSelector:(SEL)aSelector
70   target:(id)target
71   argument:(id)anArgument;
72
73 /* Monitoring file descriptors */
74 - (void)addPosixFileDescriptor:(NSPosixFileDescriptor*)fileDescriptor
75   forMode:(NSString*)mode;
76 - (void)removePosixFileDescriptor:(NSPosixFileDescriptor*)fileDescriptor
77   forMode:(NSString*)mode;
78
79 /* Monitoring file objects */
80 - (void)addFileObject:(id)_fileObject
81   activities:(unsigned int)_activities
82   forMode:(NSString *)_mode;
83 - (void)removeFileObject:(id)_fileObject
84   forMode:(NSString *)_mode;
85
86 /* Ports */
87 - (void)addPort:(NSPort *)_port forMode:(NSString *)_mode;
88 - (void)removePort:(NSPort *)_port forMode:(NSString *)_mode;
89
90 /* Server operation */
91 - (void)configureAsServer;
92
93 /* Private methods */
94 + (void)taskNowMultiThreaded:(NSNotification *)notification;
95
96 @end
97
98 @interface NSObject(RunloopFileObject)
99
100 - (int)fileDescriptor;
101
102 @end
103
104 #endif /* __NSRunLoop_h__ */
105
106 /*
107   Local Variables:
108   c-basic-offset: 4
109   tab-width: 8
110   End:
111 */