jwafaxdev.pas 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. {******************************************************************************}
  2. { }
  3. { Fax Device Provider API interface unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: faxdev.h, released November 2001. The original Pascal }
  9. { code is: FaxDev.pas, released April 2002. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. unit JwaFaxDev;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "faxdev.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaWinType, JwaPrSht;
  51. //
  52. // FAX status constants
  53. //
  54. const
  55. FS_INITIALIZING = $20000000;
  56. {$EXTERNALSYM FS_INITIALIZING}
  57. FS_DIALING = $20000001;
  58. {$EXTERNALSYM FS_DIALING}
  59. FS_TRANSMITTING = $20000002;
  60. {$EXTERNALSYM FS_TRANSMITTING}
  61. FS_RECEIVING = $20000004;
  62. {$EXTERNALSYM FS_RECEIVING}
  63. FS_COMPLETED = $20000008;
  64. {$EXTERNALSYM FS_COMPLETED}
  65. FS_HANDLED = $20000010;
  66. {$EXTERNALSYM FS_HANDLED}
  67. FS_LINE_UNAVAILABLE = $20000020;
  68. {$EXTERNALSYM FS_LINE_UNAVAILABLE}
  69. FS_BUSY = $20000040;
  70. {$EXTERNALSYM FS_BUSY}
  71. FS_NO_ANSWER = $20000080;
  72. {$EXTERNALSYM FS_NO_ANSWER}
  73. FS_BAD_ADDRESS = $20000100;
  74. {$EXTERNALSYM FS_BAD_ADDRESS}
  75. FS_NO_DIAL_TONE = $20000200;
  76. {$EXTERNALSYM FS_NO_DIAL_TONE}
  77. FS_DISCONNECTED = $20000400;
  78. {$EXTERNALSYM FS_DISCONNECTED}
  79. FS_FATAL_ERROR = $20000800;
  80. {$EXTERNALSYM FS_FATAL_ERROR}
  81. FS_NOT_FAX_CALL = $20001000;
  82. {$EXTERNALSYM FS_NOT_FAX_CALL}
  83. FS_CALL_DELAYED = $20002000;
  84. {$EXTERNALSYM FS_CALL_DELAYED}
  85. FS_CALL_BLACKLISTED = $20004000;
  86. {$EXTERNALSYM FS_CALL_BLACKLISTED}
  87. FS_USER_ABORT = $20200000;
  88. {$EXTERNALSYM FS_USER_ABORT}
  89. FS_ANSWERED = $20800000;
  90. {$EXTERNALSYM FS_ANSWERED}
  91. //
  92. // data structures
  93. //
  94. type
  95. HCALL = HANDLE; // todo from TAPI
  96. PFAX_SEND = ^FAX_SEND;
  97. {$EXTERNALSYM PFAX_SEND}
  98. _FAX_SEND = record
  99. SizeOfStruct: DWORD;
  100. FileName: LPWSTR;
  101. CallerName: LPWSTR;
  102. CallerNumber: LPWSTR;
  103. ReceiverName: LPWSTR;
  104. ReceiverNumber: LPWSTR;
  105. Branding: BOOL;
  106. CallHandle: HCALL;
  107. Reserved: array [0..2] of DWORD;
  108. end;
  109. {$EXTERNALSYM _FAX_SEND}
  110. FAX_SEND = _FAX_SEND;
  111. {$EXTERNALSYM FAX_SEND}
  112. TFaxSend = FAX_SEND;
  113. PFaxSend = PFAX_SEND;
  114. PFAX_RECEIVE = ^FAX_RECEIVE;
  115. {$EXTERNALSYM PFAX_RECEIVE}
  116. _FAX_RECEIVE = record
  117. SizeOfStruct: DWORD;
  118. FileName: LPWSTR;
  119. ReceiverName: LPWSTR;
  120. ReceiverNumber: LPWSTR;
  121. Reserved: array [0..3] of DWORD;
  122. end;
  123. {$EXTERNALSYM _FAX_RECEIVE}
  124. FAX_RECEIVE = _FAX_RECEIVE;
  125. {$EXTERNALSYM FAX_RECEIVE}
  126. TFaxReceive = FAX_RECEIVE;
  127. PFaxReceive = PFAX_RECEIVE;
  128. PFAX_DEV_STATUS = ^FAX_DEV_STATUS;
  129. {$EXTERNALSYM PFAX_DEV_STATUS}
  130. _FAX_DEV_STATUS = record
  131. SizeOfStruct: DWORD;
  132. StatusId: DWORD;
  133. StringId: DWORD;
  134. PageCount: DWORD;
  135. CSI: LPWSTR;
  136. CallerId: LPWSTR;
  137. RoutingInfo: LPWSTR;
  138. ErrorCode: DWORD;
  139. Reserved: array [0..2] of DWORD;
  140. end;
  141. {$EXTERNALSYM _FAX_DEV_STATUS}
  142. FAX_DEV_STATUS = _FAX_DEV_STATUS;
  143. {$EXTERNALSYM FAX_DEV_STATUS}
  144. TFaxDevStatus = FAX_DEV_STATUS;
  145. PFaxDevStatus = PFAX_DEV_STATUS;
  146. PFAX_SERVICE_CALLBACK = function(FaxHandle: HANDLE; DeviceId: DWORD; Param1, Param2, Param3: DWORD_PTR): BOOL; stdcall;
  147. {$EXTERNALSYM PFAX_SERVICE_CALLBACK}
  148. PFAX_LINECALLBACK = procedure(FaxHandle: HANDLE; hDevice, dwMessage: DWORD; dwInstance, wParam1, dwParam2, dwParam3: DWORD_PTR); stdcall;
  149. {$EXTERNALSYM PFAX_LINECALLBACK}
  150. type
  151. PFAX_SEND_CALLBACK = function(FaxHandle: HANDLE; CallHandle: HCALL; Reserved1, Reserved2: DWORD): BOOL; stdcall;
  152. {$EXTERNALSYM PFAX_SEND_CALLBACK}
  153. const
  154. FAXDEVRECEIVE_SIZE = 4096;
  155. {$EXTERNALSYM FAXDEVRECEIVE_SIZE}
  156. const
  157. FAXDEVREPORTSTATUS_SIZE = 4096;
  158. {$EXTERNALSYM FAXDEVREPORTSTATUS_SIZE}
  159. type
  160. HLINEAPP = HANDLE; // todo from TAPI
  161. HLINE = HANDLE; // todo form TAPI
  162. PFAXDEVINITIALIZE = function(LineAppHandle: HLINEAPP; HeapHandle: HANDLE; out LineCallbackFunction: PFAX_LINECALLBACK; FaxServiceCallback: PFAX_SERVICE_CALLBACK): BOOL; stdcall;
  163. {$EXTERNALSYM PFAXDEVINITIALIZE}
  164. PFAXDEVSHUTDOWN = function : HRESULT; stdcall;
  165. {$EXTERNALSYM PFAXDEVSHUTDOWN}
  166. PFAXDEVVIRTUALDEVICECREATION = function(DeviceCount: LPDWORD; DeviceNamePrefix: LPWSTR; DeviceIdPrefix: LPDWORD; CompletionPort: HANDLE; CompletionKey: ULONG_PTR): BOOL; stdcall;
  167. {$EXTERNALSYM PFAXDEVVIRTUALDEVICECREATION}
  168. PFAXDEVSTARTJOB = function(LineHandle: HLINE; DeviceId: DWORD; FaxHandle: PHANDLE; CompletionPortHandle: HANDLE; CompletionKey: ULONG_PTR): BOOL; stdcall;
  169. {$EXTERNALSYM PFAXDEVSTARTJOB}
  170. PFAXDEVENDJOB = function(FaxHandle: HANDLE): BOOL; stdcall;
  171. {$EXTERNALSYM PFAXDEVENDJOB}
  172. PFAXDEVSEND = function(FaxHandle: HANDLE; FaxSend: PFAX_SEND; FaxSendCallback: PFAX_SEND_CALLBACK): BOOL; stdcall;
  173. {$EXTERNALSYM PFAXDEVSEND}
  174. PFAXDEVRECEIVE = function(FaxHandle: HANDLE; CallHandle: HCALL; FaxReceive: PFAX_RECEIVE): BOOL; stdcall;
  175. {$EXTERNALSYM PFAXDEVRECEIVE}
  176. PFAXDEVREPORTSTATUS = function(FaxHandle: HANDLE; FaxStatus: PFAX_DEV_STATUS; FaxStatusSize: DWORD; FaxStatusSizeRequired: LPDWORD): BOOL; stdcall;
  177. {$EXTERNALSYM PFAXDEVREPORTSTATUS}
  178. PFAXDEVABORTOPERATION = function(FaxHandle: HANDLE): BOOL; stdcall;
  179. {$EXTERNALSYM PFAXDEVABORTOPERATION}
  180. PFAXDEVCONFIGURE = function(out PropSheetPage: HPROPSHEETPAGE): BOOL; stdcall;
  181. {$EXTERNALSYM PFAXDEVCONFIGURE}
  182. implementation
  183. end.