home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Examples / AppKit / ToDo / ToDoItem.h < prev    next >
Encoding:
Text File  |  1996-03-26  |  1.3 KB  |  53 lines

  1. #import <AppKit/AppKit.h>
  2. #import <Foundation/Foundation.h>
  3.  
  4. typedef enum _ToDoItemStatus {
  5.     incomplete=0,
  6.     complete,
  7.     deferToNextDay
  8. } ToDoItemStatus; 
  9.  
  10. enum {
  11.     minInSecs = 60,
  12.     hrInSecs = (minInSecs * 60),
  13.     dayInSecs = (hrInSecs * 24),
  14.     weekInSecs = (dayInSecs * 7)
  15. };
  16.  
  17. BOOL ConvertSecondsToTime(long secs, int *hour, int *minute);
  18. long ConvertTimeToSeconds(int hr, int min, BOOL flag);
  19.  
  20. @interface ToDoItem:NSObject<NSCoding, NSCopying>
  21. {
  22.     NSCalendarDate *day;
  23.     NSString *itemName;
  24.     NSString *notes;
  25.     NSTimer *itemTimer;
  26.     long secsUntilDue;
  27.     long secsUntilNotif;
  28.     ToDoItemStatus itemStatus;
  29. }
  30.  
  31. - (id)initWithName:(NSString *)name andDate:(NSCalendarDate *)date;
  32. - (void)dealloc;
  33. - (BOOL)isEqual:(id)anObject;
  34. - (id)copyWithZone:(NSZone *)zone;
  35. - (id)initWithCoder:(NSCoder *)coder;
  36. - (void)encodeWithCoder:(NSCoder *)coder;
  37. - (void) setDay:(NSCalendarDate *)newDay;
  38. - (NSCalendarDate *)day;
  39. - (void)setItemName:(NSString *)newName;
  40. - (NSString *)itemName;
  41. - (void)setNotes:(NSString *)notes;
  42. - (NSString *)notes;
  43. - (void)setSecsUntilNotif:(long)secs;
  44. - (long)secsUntilNotif;
  45. - (void)setSecsUntilDue:(long)secs;
  46. - (long)secsUntilDue;
  47. - (void)setItemStatus:(ToDoItemStatus)newStatus;
  48. - (ToDoItemStatus)itemStatus;
  49. - (void)setItemTimer:(NSTimer *)aTimer;
  50. - (NSTimer *)itemTimer;
  51.  
  52. @end
  53.