category.pp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {$MACRO ON}
  2. (******************************************************************************
  3. *
  4. * Copyright (c) 1995-2000 Palm, Inc. or its subsidiaries.
  5. * All rights reserved.
  6. *
  7. * File: Category.h
  8. *
  9. * Release: Palm OS SDK 4.0 (63220)
  10. *
  11. * Description:
  12. * This file defines category structures and routines.
  13. *
  14. * History:
  15. * 03/07/95 art Created by Art Lamb
  16. * 07/14/99 bob Fix up const junk
  17. * 08/12/99 gap Add new constants categoryHideEditCategory & categoryDefaultEditCategoryString.
  18. * 11/13/00 kwk The listP param for CategoryCreateList[V10] is not const.
  19. *
  20. *****************************************************************************)
  21. unit category;
  22. interface
  23. uses palmos, coretraps, datamgr, control, list, form;
  24. // Note: although these constants are in the range of system resource IDs, the are actually
  25. // constants passed to CategoryCreateList, CategorySelect, and CategoryFreeList which will
  26. // produce the desired action. The reason the constants are in this range is to keep them
  27. // out of the numeric range that developers can use for resource IDs in the attempt to avoid
  28. // conflicts.
  29. const
  30. categoryHideEditCategory = 10000;
  31. categoryDefaultEditCategoryString = 10001;
  32. type
  33. AppInfoType = record
  34. renamedCategories: UInt16;
  35. categoryLabels: array [0..dmRecNumCategories-1, 0..dmCategoryLength-1] of Char;
  36. categoryUniqIDs: array [0..dmRecNumCategories-1] of UInt8;
  37. lastUniqID: UInt8; // Uniq IDs generated by the device are between
  38. // 0 - 127. Those from the PC are 128 - 255.
  39. padding: UInt8;
  40. end;
  41. AppInfoTag = AppInfoType;
  42. AppInfoPtr = ^AppInfoType;
  43. procedure CategoryCreateListV10(db: DmOpenRef; lst: ListPtr; currentCategory: UInt16; showAll: Boolean); syscall sysTrapCategoryCreateListV10;
  44. procedure CategoryCreateList(db: DmOpenRef; listP: ListPtr;
  45. currentCategory: UInt16; showAll, showUneditables: Boolean;
  46. numUneditableCategories: UInt8; editingStrID: UInt32; resizeList: Boolean); syscall sysTrapCategoryCreateList;
  47. procedure CategoryFreeListV10(db: DmOpenRef; lst: ListPtr); syscall sysTrapCategoryFreeListV10;
  48. procedure CategoryFreeList(db: DmOpenRef; listP: ListPtr; showAll: Boolean; editingStrID: UInt32); syscall sysTrapCategoryFreeList;
  49. function CategoryFind(db: DmOpenRef; const name: PChar): UInt16; syscall sysTrapCategoryFind;
  50. procedure CategoryGetName(db: DmOpenRef; index: UInt16; name: PChar); syscall sysTrapCategoryGetName;
  51. function CategoryEditV10(db: DmOpenRef; var category: UInt16): Boolean; syscall sysTrapCategoryEditV10;
  52. function CategoryEditV20(db: DmOpenRef; var category: UInt16; titleStrID: UInt32): Boolean; syscall sysTrapCategoryEditV20;
  53. function CategoryEdit(db: DmOpenRef; var category: UInt16; titleStrID: UInt32; numUneditableCategories: UInt8): Boolean; syscall sysTrapCategoryEdit;
  54. function CategorySelectV10(db: DmOpenRef; const frm: FormPtr; ctlID, lstID: UInt16; title: Boolean;
  55. var categoryP: UInt16; categoryName: PChar): Boolean; syscall sysTrapCategorySelectV10;
  56. function CategorySelect(db: DmOpenRef; const frm: FormPtr; ctlID, lstID: UInt16; title: Boolean; var categoryP: UInt16;
  57. categoryName: PChar; numUneditableCategories: UInt8; editingStrID: UInt32): Boolean; syscall sysTrapCategorySelect;
  58. function CategoryGetNext(db: DmOpenRef; index: UInt16): UInt16; syscall sysTrapCategoryGetNext;
  59. procedure CategorySetTriggerLabel(ctl: ControlPtr; name: PChar); syscall sysTrapCategorySetTriggerLabel;
  60. procedure CategoryTruncateName(name: PChar; maxWidth: UInt16); syscall sysTrapCategoryTruncateName;
  61. procedure CategoryInitialize(appInfoP: AppInfoPtr; localizedAppInfoStrID: UInt16); syscall sysTrapCategoryInitialize;
  62. procedure CategorySetName(db: DmOpenRef; index: UInt16; const nameP: PChar); syscall sysTrapCategorySetName;
  63. implementation
  64. end.