~ubuntu-branches/ubuntu/edgy/gnustep-base/edgy

« back to all changes in this revision

Viewing changes to Headers/Foundation/NSTimer.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2004-04-06 15:21:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040406152111-95pwmfi50qp1s594
Tags: 1.9.1-2
* debian/rules: Update CC.
* Source/NSUserDefaults: apply patch from CVS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Declarations for NSTimer for GNUStep
 
2
   Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
 
3
 
 
4
   Written by:  Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
 
5
   Date: 1995
 
6
   
 
7
   This file is part of the GNUstep Base Library.
 
8
 
 
9
   This library is free software; you can redistribute it and/or
 
10
   modify it under the terms of the GNU Library General Public
 
11
   License as published by the Free Software Foundation; either
 
12
   version 2 of the License, or (at your option) any later version.
 
13
   
 
14
   This library is distributed in the hope that it will be useful,
 
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
   Library General Public License for more details.
 
18
   
 
19
   You should have received a copy of the GNU Library General Public
 
20
   License along with this library; if not, write to the Free
 
21
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
 
22
   */ 
 
23
 
 
24
#ifndef __NSTimer_include__
 
25
#define __NSTimer_include__
 
26
 
 
27
/* This class is currently thrown together.  When it is cleaned up, it
 
28
   may no longer be concrete. */
 
29
 
 
30
#include <Foundation/NSDate.h>
 
31
 
 
32
/*
 
33
 *      NB. NSRunLoop is optimised using a hack that knows about the
 
34
 *      class layout for the fire date and invialidation flag in NSTimer.
 
35
 *      These MUST remain the first two items in the class.
 
36
 */
 
37
@interface NSTimer : NSObject
 
38
{
 
39
  NSDate        *_date;         /* Must be first - for NSRunLoop optimisation */
 
40
  BOOL          _invalidated;   /* Must be 2nd - for NSRunLoop optimisation */
 
41
  BOOL          _repeats;
 
42
  NSTimeInterval _interval;
 
43
  id            _target;
 
44
  SEL           _selector;
 
45
  id            _info;
 
46
}
 
47
 
 
48
/* Creating timer objects. */
 
49
 
 
50
+ (NSTimer*) scheduledTimerWithTimeInterval: (NSTimeInterval)ti
 
51
                                 invocation: (NSInvocation*)invocation
 
52
                                    repeats: (BOOL)f;
 
53
+ (NSTimer*) scheduledTimerWithTimeInterval: (NSTimeInterval)ti
 
54
                                     target: (id)object
 
55
                                   selector: (SEL)selector
 
56
                                   userInfo: (id)info
 
57
                                    repeats: (BOOL)f;
 
58
 
 
59
+ (NSTimer*) timerWithTimeInterval: (NSTimeInterval)ti
 
60
                        invocation: (NSInvocation*)invocation
 
61
                           repeats: (BOOL)f;
 
62
+ (NSTimer*) timerWithTimeInterval: (NSTimeInterval)ti
 
63
                            target: (id)object
 
64
                          selector: (SEL)selector
 
65
                          userInfo: (id)info
 
66
                           repeats: (BOOL)f;
 
67
 
 
68
- (void) fire;
 
69
- (NSDate*) fireDate;
 
70
- (void) invalidate;
 
71
- (id) userInfo;
 
72
 
 
73
 
 
74
#ifndef STRICT_OPENSTEP
 
75
- (id) initWithFireDate: (NSDate*)fd
 
76
               interval: (NSTimeInterval)ti
 
77
                 target: (id)object
 
78
               selector: (SEL)selector
 
79
               userInfo: (id)info
 
80
                repeats: (BOOL)f;
 
81
- (BOOL) isValid;
 
82
- (void) setFireDate: (NSDate*)fireDate;
 
83
- (NSTimeInterval) timeInterval;
 
84
#endif
 
85
 
 
86
@end
 
87
 
 
88
#endif