home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / ToDoItem.h < prev    next >
Encoding:
Text File  |  1996-07-30  |  1.4 KB  |  57 lines

  1. /*
  2.   You may freely copy, distribute, and reuse the code in this example.
  3.   NeXT disclaims any warranty of any kind, expressed or implied, as to its
  4.   fitness for any particular use.
  5. */
  6.  
  7. #import <AppKit/AppKit.h>
  8.  
  9. typedef enum ToDoItemStatus {
  10.     incomplete = 0,
  11.     complete,
  12.     deferToNextDay
  13. } ToDoItemStatus;
  14.  
  15. enum {
  16.     minInSecs = 60,
  17.     hrInSecs = (minInSecs * 60),
  18.     dayInSecs = (hrInSecs * 24),
  19.     weekInSecs = (dayInSecs * 7)
  20. };
  21.  
  22. BOOL ConvertSecondsToTime(long secs, int *hour, int *minute);
  23. long ConvertTimeToSeconds(int hr, int min, BOOL pmFlag);
  24.  
  25. @interface ToDoItem : NSObject
  26. {
  27.     NSCalendarDate *day;
  28.     NSString *itemName;
  29.     NSString *notes;
  30.     NSTimer *itemTimer;
  31.     long secsUntilDue;
  32.     long secsUntilNotif;
  33.     ToDoItemStatus itemStatus;
  34. }
  35. - (id)initWithName:(NSString *)name andDate:(NSCalendarDate *)date;
  36. - (void)dealloc;
  37. - (BOOL)isEqual:(id)anObject;
  38. - (id)copyWithZone:(NSZone *)zone;
  39. - (id)initWithCoder:(NSCoder *)coder;
  40. - (void)encodeWithCoder:(NSCoder *)coder;
  41. - (void) setDay:(NSCalendarDate *)newDay;
  42. - (NSCalendarDate *)day;
  43. - (void)setItemName:(NSString *)newName;
  44. - (NSString *)itemName;
  45. - (void)setNotes:(NSString *)notes;
  46. - (NSString *)notes;
  47. - (void)setSecsUntilNotif:(long)secs;
  48. - (long)secsUntilNotif;
  49. - (void)setSecsUntilDue:(long)secs;
  50. - (long)secsUntilDue;
  51. - (void)setItemStatus:(ToDoItemStatus)newStatus;
  52. - (ToDoItemStatus)itemStatus;
  53. - (void)setItemTimer:(NSTimer *)aTimer;
  54. - (NSTimer *)itemTimer;
  55.  
  56. @end
  57.