jwafaxroute.pas 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {******************************************************************************}
  2. { }
  3. { Fax Routing Extension 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: faxroute.h, released November 2001. The original Pascal}
  9. { code is: FaxRoute.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 JwaFaxRoute;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "faxroute.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaWinType;
  51. //
  52. // microsoft routing guids
  53. //
  54. const
  55. MS_FAXROUTE_PRINTING_GUID = TEXT('{aec1b37c-9af2-11d0-abf7-00c04fd91a4e}');
  56. {$EXTERNALSYM MS_FAXROUTE_PRINTING_GUID}
  57. MS_FAXROUTE_FOLDER_GUID = TEXT('{92041a90-9af2-11d0-abf7-00c04fd91a4e}');
  58. {$EXTERNALSYM MS_FAXROUTE_FOLDER_GUID}
  59. MS_FAXROUTE_EMAIL_GUID = TEXT('{6bbf7bfe-9af2-11d0-abf7-00c04fd91a4e}');
  60. {$EXTERNALSYM MS_FAXROUTE_EMAIL_GUID}
  61. //
  62. // callback routines
  63. //
  64. type
  65. PFAXROUTEADDFILE = function(JobId: DWORD; FileName: LPCWSTR; Guid: LPGUID): LONG; stdcall;
  66. {$EXTERNALSYM PFAXROUTEADDFILE}
  67. PFAXROUTEDELETEFILE = function(JobId: DWORD; FileName: LPCWSTR): LONG; stdcall;
  68. {$EXTERNALSYM PFAXROUTEDELETEFILE}
  69. PFAXROUTEGETFILE = function(JobId, Index: DWORD; FileNameBuffer: LPWSTR; RequiredSize: LPDWORD): BOOL; stdcall;
  70. {$EXTERNALSYM PFAXROUTEGETFILE}
  71. PFAXROUTEENUMFILE = function(JobId: DWORD; GuidOwner, GuidCaller: LPGUID; FileName: LPCWSTR; Context: PVOID): BOOL; stdcall;
  72. {$EXTERNALSYM PFAXROUTEENUMFILE}
  73. PFAXROUTEENUMFILES = function(JobId: DWORD; Guid: LPGUID; FileEnumerator: PFAXROUTEENUMFILE; Context: PVOID): BOOL; stdcall;
  74. {$EXTERNALSYM PFAXROUTEENUMFILES}
  75. PFAXROUTEMODIFYROUTINGDATA = function(JobId: DWORD; RoutingGuid: LPCWSTR; RoutingData: LPBYTE; RoutingDataSize: DWORD): BOOL; stdcall;
  76. {$EXTERNALSYM PFAXROUTEMODIFYROUTINGDATA}
  77. PFAX_ROUTE_CALLBACKROUTINES = ^FAX_ROUTE_CALLBACKROUTINES;
  78. {$EXTERNALSYM PFAX_ROUTE_CALLBACKROUTINES}
  79. _FAX_ROUTE_CALLBACKROUTINES = record
  80. SizeOfStruct: DWORD; // size of the struct set by the fax service
  81. FaxRouteAddFile: PFAXROUTEADDFILE;
  82. FaxRouteDeleteFile: PFAXROUTEDELETEFILE;
  83. FaxRouteGetFile: PFAXROUTEGETFILE;
  84. FaxRouteEnumFiles: PFAXROUTEENUMFILES;
  85. FaxRouteModifyRoutingData: PFAXROUTEMODIFYROUTINGDATA;
  86. end;
  87. {$EXTERNALSYM _FAX_ROUTE_CALLBACKROUTINES}
  88. FAX_ROUTE_CALLBACKROUTINES = _FAX_ROUTE_CALLBACKROUTINES;
  89. {$EXTERNALSYM FAX_ROUTE_CALLBACKROUTINES}
  90. TFaxRouteCallbackRoutines = FAX_ROUTE_CALLBACKROUTINES;
  91. PFaxRouteCallbackRoutines = PFAX_ROUTE_CALLBACKROUTINES;
  92. //
  93. // routing data structure
  94. //
  95. PFAX_ROUTE = ^FAX_ROUTE;
  96. {$EXTERNALSYM PFAX_ROUTE}
  97. _FAX_ROUTE = record
  98. SizeOfStruct: DWORD; // size of the struct set by the fax service
  99. JobId: DWORD; // Fax job identifier
  100. ElapsedTime: DWORDLONG; // Elapsed time for whole fax job in Coordinated Universal Time (UTC)
  101. ReceiveTime: DWORDLONG; // Starting time for fax job in Coordinated Universal Time (UTC)
  102. PageCount: DWORD; // Number of pages received
  103. Csid: LPCWSTR; // Called station identifier
  104. Tsid: LPCWSTR; // Transmitting station identifier
  105. CallerId: LPCWSTR; // Caller id
  106. RoutingInfo: LPCWSTR; // Routing info such as DID, T.30-subaddress, etc.
  107. ReceiverName: LPCWSTR; // Receiver's name
  108. ReceiverNumber: LPCWSTR; // Receiver's fax number
  109. DeviceName: LPCWSTR; // Device name for the line that received the fax
  110. DeviceId: DWORD; // Permenant line identifier for the receiving device
  111. RoutingInfoData: LPBYTE; // Routing infor data to override configured info
  112. RoutingInfoDataSize: DWORD; // Size of routing info data
  113. end;
  114. {$EXTERNALSYM _FAX_ROUTE}
  115. FAX_ROUTE = _FAX_ROUTE;
  116. {$EXTERNALSYM FAX_ROUTE}
  117. TFaxRoute = FAX_ROUTE;
  118. PFaxRoute = PFAX_ROUTE;
  119. FAXROUTE_ENABLE = DWORD;
  120. {$EXTERNALSYM FAXROUTE_ENABLE}
  121. TFaxRouteEnabl = FAXROUTE_ENABLE;
  122. const
  123. QUERY_STATUS = DWORD(-1);
  124. {$EXTERNALSYM QUERY_STATUS}
  125. STATUS_DISABLE = 0;
  126. {$EXTERNALSYM STATUS_DISABLE}
  127. STATUS_ENABLE = 1;
  128. {$EXTERNALSYM STATUS_ENABLE}
  129. //
  130. // prototypes
  131. //
  132. type
  133. PFAXROUTEINITIALIZE = function(HeapHandle: HANDLE; FaxRouteCallbackRoutines: PFAX_ROUTE_CALLBACKROUTINES): BOOL; stdcall;
  134. {$EXTERNALSYM PFAXROUTEINITIALIZE}
  135. PFAXROUTEMETHOD = function(FaxRoute: PFAX_ROUTE; P: PVOID; D: LPDWORD): BOOL; stdcall;
  136. {$EXTERNALSYM PFAXROUTEMETHOD}
  137. PFAXROUTEDEVICEENABLE = function(RoutingGuid: LPCWSTR; DeviceId: DWORD; Enabled: LONG): BOOL; stdcall;
  138. {$EXTERNALSYM PFAXROUTEDEVICEENABLE}
  139. PFAXROUTEDEVICECHANGENOTIFICATION = function(DeviceId: DWORD; NewDevice: BOOL): BOOL; stdcall;
  140. {$EXTERNALSYM PFAXROUTEDEVICECHANGENOTIFICATION}
  141. PFAXROUTEGETROUTINGINFO = function(RoutingGuid: LPCWSTR; DeviceId: DWORD; RoutingInfo: LPBYTE; RoutingInfoSize: LPDWORD): BOOL; stdcall;
  142. {$EXTERNALSYM PFAXROUTEGETROUTINGINFO}
  143. PFAXROUTESETROUTINGINFO = function(RoutingGuid: LPCWSTR; DeviceId: DWORD; RoutingInfo: LPBYTE; RoutingInfoSize: DWORD): BOOL; stdcall;
  144. {$EXTERNALSYM PFAXROUTESETROUTINGINFO}
  145. implementation
  146. end.