home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / progect-src-0.20.tar.gz / progect-src-0.20.tar / progect-0.20 / task.h < prev    next >
C/C++ Source or Header  |  2000-10-26  |  7KB  |  199 lines

  1. /* -*-Mode:C; tab-width:4; indent-tabs-mode:t; c-file-style:"bsd";-*- */
  2. // $Id: task.h,v 1.6 2000/10/22 18:35:27 burgbach Exp $
  3. #ifndef __TASK_H__
  4. #define __TASK_H__
  5.  
  6. #include "progect.h"
  7.  
  8. // first usable index in db
  9. #define FIRST_INDEX 0
  10.  
  11. // first usable level
  12. #define FIRST_LEVEL 1
  13. #define ACTION 11
  14. #define ACTION_OK 12
  15. #define ACTION_NO 13
  16. #define YEAR_OFFSET 1904 // for DateType
  17.  
  18.  
  19. enum {
  20.     Extra_NULL = 0,    // sentinel for block tail, must be subkey is zero.
  21.     Extra_Description, // currently not used.
  22.     Extra_Note,        // currently not used.
  23.  
  24.     Extra_Link_ToDo = 20,
  25.     Extra_Link_LinkMaster,
  26.  
  27.     Extra_Icon = 50,
  28. };
  29.  
  30.  
  31. // DANGER!! 
  32. //  This structer could not contain field large than 8bit.
  33. //  becouse in task record. this structer stay on not even(word aligned) addr.
  34. //  in this case motrola m68k serieas CPU gots bus-error.
  35. typedef struct {
  36.     UInt8 type;
  37.     UInt8 subkey;    // subkey for same type chunks. 0xff is reserved.
  38.                     // if not use, must be set zero.
  39.     UInt8 reserve1; //
  40.     UInt8 size;        // not contain head size. please care word alignment.
  41.  
  42.     UInt8 body[0];  // data body. next chunk head exists at (body + size)
  43. } ExtraChunkHeadType;
  44. #define NextChunk(p) ((ExtraChunkHeadType*)((char*)(p)->body + (p)->size))
  45. #define ChunkSize(p) ((UInt8)NextChunk(p) - (UInt8)(p))
  46.  
  47.  
  48. // prototypes
  49. // Tasks
  50. pgErr    TaskSetAttr(DmOpenRef dbP, UInt16 index, TaskAttrType attr) 
  51.     TASKSECT;
  52. TaskAttrType TaskGetAttr(DmOpenRef dbP, UInt16 index) 
  53.     TASKSECT;
  54. pgErr    TaskSetFormat(DmOpenRef dbP, UInt16 index, TaskFormatType format)
  55.     TASKSECT;
  56. TaskFormatType TaskGetFormat(DmOpenRef dbP, UInt16 index)
  57.     TASKSECT;
  58. pgErr    TaskSetLevel(DmOpenRef dbP, UInt16 index, UInt8 level) 
  59.     TASKSECT;
  60. UInt8    TaskGetLevel(DmOpenRef dbP, UInt16 index) 
  61.     TASKSECT;
  62. pgErr    TaskSetPriority(DmOpenRef dbP, UInt16 index, UInt8 priority) 
  63.     TASKSECT;
  64. UInt8    TaskGetPriority(DmOpenRef dbP, UInt16 index) 
  65.     TASKSECT;
  66. pgErr    TaskSetHasChild(DmOpenRef dbP, UInt16 index, Boolean hasChild) 
  67.     TASKSECT;
  68. Boolean  TaskGetHasChild(DmOpenRef dbP, UInt16 index) 
  69.     TASKSECT;
  70. pgErr    TaskSetHasPrev(DmOpenRef dbP, UInt16 index, Boolean hasPrev) 
  71.     TASKSECT;
  72. Boolean  TaskGetHasPrev(DmOpenRef dbP, UInt16 index) 
  73.     TASKSECT;
  74. pgErr    TaskSetHasNext(DmOpenRef dbP, UInt16 index, Boolean next) 
  75.     TASKSECT;
  76. Boolean  TaskGetHasNext(DmOpenRef dbP, UInt16 index) 
  77.     TASKSECT;
  78. Boolean  TaskIsOpened(DmOpenRef dbP, UInt16 index) 
  79.     TASKSECT;
  80. Boolean  TaskIsVisible(DmOpenRef dbP, UInt16 index) 
  81.     TASKSECT;
  82. void TaskMakeVisible(DmOpenRef dbP, UInt16 index)
  83.     TASKSECT;
  84. Boolean  TaskToggleIsOpened(DmOpenRef dbP, UInt16 index) 
  85.     TASKSECT;
  86. pgErr    TaskSetOpened(DmOpenRef dbP, UInt16 index, Boolean value) 
  87.     TASKSECT;
  88. UInt16   TaskGetFatherIndex(DmOpenRef dbP, UInt16 index) 
  89.     TASKSECT;
  90. UInt16   TaskGetPrevIndex(DmOpenRef dbP, UInt16 index) 
  91.     TASKSECT;
  92. UInt16   TaskGetPrevIndexByLevel(DmOpenRef dbP, UInt16 index, UInt8 level) 
  93.     TASKSECT;
  94. UInt16   TaskGetNextIndex(DmOpenRef dbP, UInt16 index) 
  95.     TASKSECT;
  96. UInt16   TaskGetNextRelativeIndex(DmOpenRef dbP, UInt16 index) 
  97.     TASKSECT;
  98. pgErr    TaskSetActionState(DmOpenRef dbP, UInt16 index, Boolean action) 
  99.     TASKSECT;
  100. UInt8    TaskGetCompleted(DmOpenRef dbP, UInt16 index) 
  101.     TASKSECT;
  102. pgErr    TaskSetCompleted(DmOpenRef dbP, UInt16 index, UInt8 value) 
  103.     TASKSECT;
  104. Boolean  TaskGetIsDone(DmOpenRef dbP, UInt16 index) 
  105.     TASKSECT;
  106. Boolean  TaskGetActionState(DmOpenRef dbP, UInt16 index) 
  107.     TASKSECT;
  108. pgErr    TaskSetDueDate(DmOpenRef dbP, UInt16 index, DateType date) 
  109.     TASKSECT;
  110. DateType TaskGetDueDate(DmOpenRef dbP, UInt16 index) 
  111.     TASKSECT;
  112. pgErr    TaskSetNote(DmOpenRef dbP, UInt16 index, Char* note) 
  113.     TASKSECT;
  114. Char*    TaskGetNote(DmOpenRef dbP, UInt16 index) 
  115.     TASKSECT;
  116. Char* TaskGetDescription(DmOpenRef dbP, UInt16 index)
  117.     TASKSECT;
  118. Char* TaskGetDescriptionByTaskPtr(TaskExtendedRecordType* pTask)
  119.     TASKSECT;
  120. pgErr    TaskSetExtraBlock(DmOpenRef dbP, UInt16 index, MemPtr s, UInt32 size)
  121.     TASKSECT;
  122. UInt32   TaskGetExtraBlock(DmOpenRef dbP, UInt16 index, MemPtr dest)
  123.     TASKSECT;
  124. UInt32   TaskGetToDoUniqueID(DmOpenRef dbP, UInt16 index)
  125.     TASKSECT;
  126. pgErr    TaskCopyExtraBlock(DmOpenRef dbP, UInt16 source, UInt16 dest)
  127.     TASKSECT;
  128. pgErr    TaskInputDueDate(DmOpenRef dbP, UInt16 index) 
  129.     TASKSECT;
  130. pgErr    TaskSave(UInt16 index) 
  131.     TASKSECT;
  132. pgErr    TaskGetSaved(UInt16 index) 
  133.     TASKSECT;
  134. pgErr    TaskRemoveSaved(void) 
  135.     TASKSECT;
  136. pgErr    TaskRemove(DmOpenRef dbP, UInt16 index) 
  137.     TASKSECT;
  138. pgErr TaskRemoveChildren(DmOpenRef dbP, UInt16 index)
  139.     TASKSECT;
  140. pgErr    TaskRemoveDone(DmOpenRef dbP)
  141.     TASKSECT;
  142. pgErr    TaskRemoveDoneChildren(DmOpenRef dbP, UInt16 index)
  143.     TASKSECT;
  144. pgErr    TaskExpand(DmOpenRef dbP, UInt16 index) 
  145.     TASKSECT;
  146. pgErr    TaskCollapse(DmOpenRef dbP, UInt16 index) 
  147.     TASKSECT;
  148. pgErr    TaskCalcCompleted(DmOpenRef dbP, UInt16 index) 
  149.     TASKSECT;
  150. pgErr    TaskCalcCompletedAll(DmOpenRef dbP) 
  151.     TASKSECT;
  152. pgErr    TaskToRight(DmOpenRef dbP, UInt16 index) 
  153.     TASKSECT;
  154. pgErr    TaskToLeft(DmOpenRef dbP, UInt16 index) 
  155.     TASKSECT;
  156. pgErr    TaskUp(DmOpenRef dbP, UInt16 index) 
  157.     TASKSECT;
  158. pgErr    TaskDown(DmOpenRef dbP, UInt16 index) 
  159.     TASKSECT;
  160. pgErr    TaskPublishToDo(DmOpenRef dbP, UInt16 index)
  161.     TASKSECT;
  162. pgErr    TaskGetToDoStatus(DmOpenRef dbP, UInt16 index, UInt8 *value, 
  163.                            UInt8 *priority, DateType *dueDate)
  164.     TASKSECT;
  165. pgErr    TaskSetToDoStatus(DmOpenRef dbP, UInt16 index, UInt16 fields, 
  166.                            UInt8 value, UInt16 priority, DateType dueDate)
  167.     TASKSECT;
  168. Err      TaskUpdateToDo(DmOpenRef dbP, UInt16 index)
  169.     TASKSECT;
  170. void     TaskSyncAll(void)
  171.     TASKSECT;
  172. pgErr    TaskRemoveHasToDo(DmOpenRef dbP, UInt16 index)
  173.     TASKSECT;
  174. pgErr    TaskRepairTree(DmOpenRef dbP, UInt16 start, UInt16 stop)
  175.     TASKSECT;
  176. pgErr    TaskToClipboard(DmOpenRef dbP, UInt16 index, Boolean withParent)
  177.     TASKSECT;
  178. pgErr    TaskFromClipboard(DmOpenRef dbP, UInt16 index, Boolean asChildren)
  179.     TASKSECT;
  180.  
  181.  
  182. pgErr    TaskGetExtraChunk(DmOpenRef dbP, UInt16 index,
  183.                            UInt8 type, UInt8 subkey,
  184.                            MemPtr dest, UInt16* size/*in bytes*/)
  185.     TASKSECT;
  186. pgErr    TaskGetExtraChunkByTaskPtr(TaskExtendedRecordType* pTask,
  187.                                     UInt8 type, UInt8 subkey,
  188.                                     MemPtr dest, UInt16* size/*in bytes*/)
  189.     TASKSECT;
  190. void    TaskRemoveExtraChunk(DmOpenRef dbP, UInt16 index,
  191.                              UInt8 type, UInt8 subkey)
  192.     TASKSECT;
  193. pgErr    TaskSetExtraChunk(DmOpenRef dbP, UInt16 index,
  194.                            UInt8 type, UInt8 subkey,
  195.                            MemPtr src, UInt16 size)
  196.     TASKSECT;
  197.  
  198. #endif
  199.