JwaFaxRoute.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:8k
源码类别:

Windows编程

开发平台:

Delphi

  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@chello.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 home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaFaxRoute;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "faxroute.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinType;
  52. //
  53. // microsoft routing guids
  54. //
  55. const
  56.   MS_FAXROUTE_PRINTING_GUID = TEXT('{aec1b37c-9af2-11d0-abf7-00c04fd91a4e}');
  57.   {$EXTERNALSYM MS_FAXROUTE_PRINTING_GUID}
  58.   MS_FAXROUTE_FOLDER_GUID   = TEXT('{92041a90-9af2-11d0-abf7-00c04fd91a4e}');
  59.   {$EXTERNALSYM MS_FAXROUTE_FOLDER_GUID}
  60.   MS_FAXROUTE_EMAIL_GUID    = TEXT('{6bbf7bfe-9af2-11d0-abf7-00c04fd91a4e}');
  61.   {$EXTERNALSYM MS_FAXROUTE_EMAIL_GUID}
  62. //
  63. // callback routines
  64. //
  65. type
  66.   PFAXROUTEADDFILE = function (JobId: DWORD; FileName: LPCWSTR; Guid: LPGUID): LONG; stdcall;
  67.   {$EXTERNALSYM PFAXROUTEADDFILE}
  68.   PFAXROUTEDELETEFILE = function (JobId: DWORD; FileName: LPCWSTR): LONG; stdcall;
  69.   {$EXTERNALSYM PFAXROUTEDELETEFILE}
  70.   PFAXROUTEGETFILE = function (JobId, Index: DWORD; FileNameBuffer: LPWSTR; RequiredSize: LPDWORD): BOOL; stdcall;
  71.   {$EXTERNALSYM PFAXROUTEGETFILE}
  72.   PFAXROUTEENUMFILE = function (JobId: DWORD; GuidOwner, GuidCaller: LPGUID; FileName: LPCWSTR; Context: PVOID): BOOL; stdcall;
  73.   {$EXTERNALSYM PFAXROUTEENUMFILE}
  74.   PFAXROUTEENUMFILES = function (JobId: DWORD; Guid: LPGUID; FileEnumerator: PFAXROUTEENUMFILE; Context: PVOID): BOOL; stdcall;
  75.   {$EXTERNALSYM PFAXROUTEENUMFILES}
  76.   PFAXROUTEMODIFYROUTINGDATA = function (JobId: DWORD; RoutingGuid: LPCWSTR; RoutingData: LPBYTE; RoutingDataSize: DWORD): BOOL; stdcall;
  77.   {$EXTERNALSYM PFAXROUTEMODIFYROUTINGDATA}
  78.   PFAX_ROUTE_CALLBACKROUTINES = ^FAX_ROUTE_CALLBACKROUTINES;
  79.   {$EXTERNALSYM PFAX_ROUTE_CALLBACKROUTINES}
  80.   _FAX_ROUTE_CALLBACKROUTINES = record
  81.     SizeOfStruct: DWORD; // size of the struct set by the fax service
  82.     FaxRouteAddFile: PFAXROUTEADDFILE;
  83.     FaxRouteDeleteFile: PFAXROUTEDELETEFILE;
  84.     FaxRouteGetFile: PFAXROUTEGETFILE;
  85.     FaxRouteEnumFiles: PFAXROUTEENUMFILES;
  86.     FaxRouteModifyRoutingData: PFAXROUTEMODIFYROUTINGDATA;
  87.   end;
  88.   {$EXTERNALSYM _FAX_ROUTE_CALLBACKROUTINES}
  89.   FAX_ROUTE_CALLBACKROUTINES = _FAX_ROUTE_CALLBACKROUTINES;
  90.   {$EXTERNALSYM FAX_ROUTE_CALLBACKROUTINES}
  91.   TFaxRouteCallbackRoutines = FAX_ROUTE_CALLBACKROUTINES;
  92.   PFaxRouteCallbackRoutines = PFAX_ROUTE_CALLBACKROUTINES;
  93. //
  94. // routing data structure
  95. //
  96.   PFAX_ROUTE = ^FAX_ROUTE;
  97.   {$EXTERNALSYM PFAX_ROUTE}
  98.   _FAX_ROUTE = record
  99.     SizeOfStruct: DWORD; // size of the struct set by the fax service
  100.     JobId: DWORD; // Fax job identifier
  101.     ElapsedTime: DWORDLONG; // Elapsed time for whole fax job in Coordinated Universal Time (UTC)
  102.     ReceiveTime: DWORDLONG; // Starting time for fax job in Coordinated Universal Time (UTC)
  103.     PageCount: DWORD; // Number of pages received
  104.     Csid: LPCWSTR; // Called station identifier
  105.     Tsid: LPCWSTR; // Transmitting station identifier
  106.     CallerId: LPCWSTR; // Caller id
  107.     RoutingInfo: LPCWSTR; // Routing info such as DID, T.30-subaddress, etc.
  108.     ReceiverName: LPCWSTR; // Receiver's name
  109.     ReceiverNumber: LPCWSTR; // Receiver's fax number
  110.     DeviceName: LPCWSTR; // Device name for the line that received the fax
  111.     DeviceId: DWORD; // Permenant line identifier for the receiving device
  112.     RoutingInfoData: LPBYTE; // Routing infor data to override configured info
  113.     RoutingInfoDataSize: DWORD; // Size of routing info data
  114.   end;
  115.   {$EXTERNALSYM _FAX_ROUTE}
  116.   FAX_ROUTE = _FAX_ROUTE;
  117.   {$EXTERNALSYM FAX_ROUTE}
  118.   TFaxRoute = FAX_ROUTE;
  119.   PFaxRoute = PFAX_ROUTE;
  120.   FAXROUTE_ENABLE = DWORD;
  121.   {$EXTERNALSYM FAXROUTE_ENABLE}
  122.   TFaxRouteEnabl = FAXROUTE_ENABLE;
  123. const
  124.   QUERY_STATUS = DWORD(-1);
  125.   {$EXTERNALSYM QUERY_STATUS}
  126.   STATUS_DISABLE = 0;
  127.   {$EXTERNALSYM STATUS_DISABLE}
  128.   STATUS_ENABLE = 1;
  129.   {$EXTERNALSYM STATUS_ENABLE}
  130. //
  131. // prototypes
  132. //
  133. type
  134.   PFAXROUTEINITIALIZE = function (HeapHandle: HANDLE; FaxRouteCallbackRoutines: PFAX_ROUTE_CALLBACKROUTINES): BOOL; stdcall;
  135.   {$EXTERNALSYM PFAXROUTEINITIALIZE}
  136.   PFAXROUTEMETHOD = function (FaxRoute: PFAX_ROUTE; P: PVOID; D: LPDWORD): BOOL; stdcall;
  137.   {$EXTERNALSYM PFAXROUTEMETHOD}
  138.   PFAXROUTEDEVICEENABLE = function (RoutingGuid: LPCWSTR; DeviceId: DWORD; Enabled: LONG): BOOL; stdcall;
  139.   {$EXTERNALSYM PFAXROUTEDEVICEENABLE}
  140.   PFAXROUTEDEVICECHANGENOTIFICATION = function (DeviceId: DWORD; NewDevice: BOOL): BOOL; stdcall;
  141.   {$EXTERNALSYM PFAXROUTEDEVICECHANGENOTIFICATION}
  142.   PFAXROUTEGETROUTINGINFO = function (RoutingGuid: LPCWSTR; DeviceId: DWORD; RoutingInfo: LPBYTE; RoutingInfoSize: LPDWORD): BOOL; stdcall;
  143.   {$EXTERNALSYM PFAXROUTEGETROUTINGINFO}
  144.   PFAXROUTESETROUTINGINFO = function (RoutingGuid: LPCWSTR; DeviceId: DWORD; RoutingInfo: LPBYTE; RoutingInfoSize: DWORD): BOOL; stdcall;
  145.   {$EXTERNALSYM PFAXROUTESETROUTINGINFO}
  146. implementation
  147. end.