applaunchcmd.pp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. (******************************************************************************
  2. *
  3. * Copyright (c) 1996-2000 Palm, Inc. or its subsidiaries.
  4. * All rights reserved.
  5. *
  6. * File: AppLaunchCmd.h
  7. *
  8. * Release: Palm OS SDK 4.0 (63220)
  9. *
  10. * Description:
  11. * Pilot launch commands for applications. Some launch commands
  12. * are treated differently by different apps. The different
  13. * parameter blocks used by the apps are kept here.
  14. *
  15. * History:
  16. * 7/23/96 rsf - Created by Roger Flores
  17. * 7/28/98 dia - Added generic LaunchWithCommand. Made
  18. * AppLaunchWithCommand() use it.
  19. *
  20. *****************************************************************************)
  21. unit applaunchcmd;
  22. interface
  23. uses palmos, systemmgr;
  24. (*
  25. #define LaunchWithCommand(type, creator, command, commandParams) \
  26. { \
  27. UInt16 cardNo; \
  28. LocalID dbID; \
  29. DmSearchStateType searchState; \
  30. Err err; \
  31. DmGetNextDatabaseByTypeCreator(true, &searchState, type, \
  32. creator, true, &cardNo, &dbID); \
  33. ErrNonFatalDisplayIf(!dbID, "Could not find app"); \
  34. if (dbID) { \
  35. err = SysUIAppSwitch(cardNo, dbID, command, commandParams); \
  36. ErrNonFatalDisplayIf(err, "Could not launch app"); \
  37. } \
  38. }
  39. #define AppLaunchWithCommand(appCreator, appCommand, appCommandParams) \
  40. LaunchWithCommand (sysFileTApplication, appCreator, appCommand, appCommandParams)
  41. #define AppCallWithCommand(appCreator, appCommand, appCommandParams) \
  42. { \
  43. UInt16 cardNo; \
  44. LocalID dbID; \
  45. DmSearchStateType searchState; \
  46. UInt32 result; \
  47. Err err; \
  48. DmGetNextDatabaseByTypeCreator(true, &searchState, sysFileTApplication, \
  49. appCreator, true, &cardNo, &dbID); \
  50. ErrNonFatalDisplayIf(!dbID, "Could not find app"); \
  51. if (dbID) { \
  52. err = SysAppLaunch(cardNo, dbID, 0, appCommand, (MemPtr) appCommandParams, &result); \
  53. ErrNonFatalDisplayIf(err, "Could not launch app"); \
  54. } \
  55. }
  56. *)
  57. (************************************************************
  58. * Param Block passsed with the sysAppLaunchCmdLookup Command
  59. *************************************************************)
  60. //-------------------------------------------------------------------
  61. // sysAppLaunchCmdLookup parameter block for the Address Book
  62. //-------------------------------------------------------------------
  63. // This is a list of fields by which data may be looked up.
  64. type
  65. AddressLookupFields = Enum;
  66. const
  67. addrLookupName = 0;
  68. addrLookupFirstName = Succ(addrLookupName);
  69. addrLookupCompany = Succ(addrLookupFirstName);
  70. addrLookupAddress = Succ(addrLookupCompany);
  71. addrLookupCity = Succ(addrLookupAddress);
  72. addrLookupState = Succ(addrLookupCity);
  73. addrLookupZipCode = Succ(addrLookupState);
  74. addrLookupCountry = Succ(addrLookupZipCode);
  75. addrLookupTitle = Succ(addrLookupCountry);
  76. addrLookupCustom1 = Succ(addrLookupTitle);
  77. addrLookupCustom2 = Succ(addrLookupCustom1);
  78. addrLookupCustom3 = Succ(addrLookupCustom2);
  79. addrLookupCustom4 = Succ(addrLookupCustom3);
  80. addrLookupNote = Succ(addrLookupCustom4); // This field is assumed to be < 4K
  81. addrLookupWork = Succ(addrLookupNote);
  82. addrLookupHome = Succ(addrLookupWork);
  83. addrLookupFax = Succ(addrLookupHome);
  84. addrLookupOther = Succ(addrLookupFax);
  85. addrLookupEmail = Succ(addrLookupOther);
  86. addrLookupMain = Succ(addrLookupEmail);
  87. addrLookupPager = Succ(addrLookupMain);
  88. addrLookupMobile = Succ(addrLookupPager);
  89. addrLookupSortField = Succ(addrLookupMobile);
  90. addrLookupListPhone = Succ(addrLookupSortField);
  91. addrLookupFieldCount = Succ(addrLookupListPhone); // add new fields above this one
  92. addrLookupNoField = $ff;
  93. const
  94. addrLookupStringLength = 12;
  95. type
  96. AddrLookupParamsType = record
  97. title: PChar;
  98. // Title to appear in the title bar. If NULL the default is used.
  99. pasteButtonText: PChar;
  100. // Text to appear in paste button. If NULL "paste" is used.
  101. lookupString: array [0..addrLookupStringLength-1] of Char;
  102. // Buffer containing string to lookup. If the string matches
  103. // only one record then that record is used without
  104. // presenting the user with the lookup dialog.
  105. field1: AddressLookupFields;
  106. // Field to search by. This field appears on the left side
  107. // of the lookup dialog. If the field is the sort field then
  108. // searches use a binary search. If the field isn't the sort
  109. // field then the data does appear in sorted order and searching
  110. // is performed by a linear search (can get slow).
  111. field2: AddressLookupFields;
  112. // Field to display on the right. Often displays some
  113. // information about the person. If it is a phone field
  114. // and a record has multiple instances of the phone type
  115. // then the person appears once per instance of the phone
  116. // type. Either field1 or field2 may be a phone field but
  117. // not both.
  118. field2Optional: Boolean;
  119. // True means that the record need not have field2 for
  120. // the record to be listed. False means that field2 is
  121. // required in the record for it to be listed.
  122. userShouldInteract: Boolean;
  123. // True means that the user should resolve non unique
  124. // lookups. False means a non unique and complete lookup
  125. // returns resultStringH set to 0 and recordID set to 0;
  126. formatStringP: PChar;
  127. // When the user selects the paste button a string is generated
  128. // to return data from the record. The format of the result string
  129. // is controlled by this string. All characters which appear
  130. // in this string are copied straight to the result string unless
  131. // they are a field (a '^' follow by the field name). For
  132. // example, the format string "^first - ^home" might result in
  133. // "Roger - 123-4567".
  134. // The field arguments are name, first, company, address, city
  135. // state, zipcode, country, title, custom1, custom2, custom3,
  136. // custom4, work, home, fax, other, email, main, pager, mobile,
  137. // and listname.
  138. resultStringH: MemHandle;
  139. // If there is a format string a result string is allocated on
  140. // the dynamic heap and its handle is returned here.
  141. uniqueID: UInt32;
  142. // The unique ID of the found record or 0 if none was found.
  143. end;
  144. type
  145. AddrLookupParamsPtr = ^AddrLookupParamsType;
  146. (************************************************************
  147. * Param Block passsed with the sysAppLaunchCmdSetActivePanel Command
  148. *************************************************************)
  149. const
  150. prefAppLaunchCmdSetActivePanel = sysAppLaunchCmdCustomBase + 1;
  151. // Record this panel so switching to the Prefs app
  152. // causes this panel to execute.
  153. type
  154. PrefActivePanelParamsType = record
  155. activePanel: UInt32;
  156. // The creator ID of a panel. Usually sent by a panel so the prefs
  157. // apps will switch to it. This allows the last used panel to appear
  158. // when switching to the Prefs app.
  159. end;
  160. PrefActivePanelParamsPtr = ^PrefActivePanelParamsType;
  161. (************************************************************
  162. * Param Block passsed with the sysAppLaunchCmdAddRecord Command
  163. *************************************************************)
  164. //-------------------------------------------------------------------
  165. // sysAppLaunchCmdAddRecord parameter block for the Mail application
  166. //-------------------------------------------------------------------
  167. // Param Block passsed with the sysAppLaunchCmdAddRecord Command
  168. type
  169. MailMsgPriorityType = Enum;
  170. const
  171. mailPriorityHigh = 0;
  172. mailPriorityNormal = Succ(mailPriorityHigh);
  173. mailPriorityLow = Succ(mailPriorityNormal);
  174. type
  175. MailAddRecordParamsType = record
  176. secret: Boolean;
  177. // True means that the message should be marked secret
  178. signature: Boolean;
  179. // True means that signature from the Mail application's preferences
  180. // should be attached to the message.
  181. confirmRead: Boolean;
  182. // True means that a comfirmation should be sent when the message
  183. // is read.
  184. confirmDelivery: Boolean;
  185. // True means that a comfirmation should be sent when the message
  186. // is deliveried
  187. priority: MailMsgPriorityType;
  188. // high, normial, or low.
  189. padding: UInt8;
  190. subject: PChar;
  191. // Message's subject, a null-terminated string (optional).
  192. from: PChar;
  193. // Message's send, a null-terminated string (not currently used).
  194. to_: PChar;
  195. // Address the the recipient, a null-terminated string (required).
  196. cc: PChar;
  197. // Copy Addresses, a null-terminated string (required).
  198. bcc: PChar;
  199. // Blind copy Addresses, a null-terminated string (required).
  200. replyTo: PChar;
  201. // Reply to address, a null-terminated string (required).
  202. body: PChar;
  203. // The text of the message, a null-terminated string (required).
  204. end;
  205. MailAddRecordParamsPtr = ^MailAddRecordParamsType;
  206. //-------------------------------------------------------------------
  207. // sysAppLaunchCmdAddRecord parameter block for the Messaging application
  208. //-------------------------------------------------------------------
  209. // Param Block passsed with the sysAppLaunchCmdAddRecord Command
  210. //category defines
  211. const
  212. MsgInboxCategory = 0;
  213. MsgOutboxCategory = 1;
  214. MsgDeletedCategory = 2;
  215. MsgFiledCategory = 3;
  216. MsgDraftCategory = 4;
  217. type
  218. MsgAddRecordParamsType = record
  219. category: UInt16;
  220. //is this an outgoing mesage? Or should it be put into a different category
  221. edit: Boolean;
  222. // True means that the message should be opened in the editor,instead of
  223. // just dropped into the category (only applies to outBox category)
  224. signature: Boolean;
  225. // True means that signature from the Mail application's preferences
  226. // should be attached to the message.
  227. subject: PChar;
  228. // Message's subject, a null-terminated string (optional).
  229. from: PChar;
  230. // Message's send, a null-terminated string (not currently used).
  231. to_: PChar;
  232. // Address the the recipient, a null-terminated string (required).
  233. replyTo: PChar;
  234. // Reply to address, a null-terminated string (required).
  235. body: PChar;
  236. // The text of the message, a null-terminated string (required).
  237. end;
  238. MsgAddRecordParamsPtr = ^MsgAddRecordParamsType;
  239. implementation
  240. end.