Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
4.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. abobj.h
  5. Abstract:
  6. Class definition for CCommonAbObj
  7. Environment:
  8. Fax send wizard
  9. --*/
  10. #ifndef __ABOBJ_H_
  11. #define __ABOBJ_H_
  12. /*
  13. The following pre-processor directives were added so that fxswzrd.dll no longer depends on msvcp60.dll.
  14. That dependency raised deployment issues with point-and-print installation on down-level operating systems.
  15. Undefining _MT, _CRTIMP, and _DLL causes the STL set implementation to be non-thread-safe (no locks when accessing data).
  16. In the fax send wizard, the set is used to keep the list of recipient unique.
  17. Since the wizard (at that stage) has only a single thread, thread safety is not an issue anymore.
  18. */
  19. #undef _MT
  20. #undef _CRTIMP
  21. #undef _DLL
  22. #pragma warning (disable: 4273)
  23. #include <set>
  24. using namespace std;
  25. typedef struct
  26. {
  27. LPTSTR DisplayName;
  28. LPTSTR BusinessFax;
  29. LPTSTR HomeFax;
  30. LPTSTR OtherFax;
  31. LPTSTR Country;
  32. } PICKFAX, * PPICKFAX;
  33. struct CRecipCmp
  34. {
  35. /*
  36. Comparison operator 'less'
  37. Compare two PRECIPIENT by recipient's name and fax number
  38. */
  39. bool operator()(const PRECIPIENT pcRecipient1, const PRECIPIENT pcRecipient2) const;
  40. };
  41. typedef set<PRECIPIENT, CRecipCmp> RECIPIENTS_SET;
  42. class CCommonAbObj {
  43. protected:
  44. LPADRBOOK m_lpAdrBook;
  45. LPADRLIST m_lpAdrList;
  46. LPMAILUSER m_lpMailUser;
  47. HWND m_hWnd;
  48. // DWORD m_PickNumber;
  49. RECIPIENTS_SET m_setRecipients;
  50. BOOL m_bUnicode; // The Unicode is supported by Address Book
  51. ULONG StrCoding() { return m_bUnicode ? MAPI_UNICODE : 0; }
  52. LPTSTR StrToAddrBk(LPCTSTR szStr, DWORD* pdwSize = NULL); // return allocated string converted to the Address book encoding
  53. LPTSTR StrFromAddrBk(LPSPropValue pValue); // return allocated string converted from the Address book encoding
  54. BOOL StrPropOk(LPSPropValue lpPropVals);
  55. BOOL ABStrCmp(LPSPropValue lpPropVals, LPTSTR pStr);
  56. enum eABType {AB_MAPI, AB_WAB};
  57. virtual eABType GetABType()=0;
  58. BOOL GetAddrBookCaption(LPTSTR szCaption, DWORD dwSize);
  59. LPSPropValue FindProp(LPSPropValue rgprop,
  60. ULONG cprop,
  61. ULONG ulPropTag);
  62. virtual HRESULT ABAllocateBuffer(
  63. ULONG cbSize,
  64. LPVOID FAR * lppBuffer
  65. ) = 0;
  66. virtual ULONG ABFreeBuffer(
  67. LPVOID lpBuffer
  68. ) = 0;
  69. virtual BOOL isInitialized() const = 0;
  70. DWORD GetRecipientInfo(
  71. LPSPropValue SPropVals,
  72. ULONG cValues,
  73. PRECIPIENT pRecipient,
  74. PRECIPIENT pOldRecipList
  75. );
  76. BOOL
  77. GetOneOffRecipientInfo(
  78. LPSPropValue SPropVals,
  79. ULONG cValues,
  80. PRECIPIENT pRecipient,
  81. PRECIPIENT pOldRecipList
  82. );
  83. LPTSTR GetEmail(
  84. LPSPropValue SPropVals,
  85. ULONG cValues
  86. );
  87. DWORD InterpretAddress(
  88. LPSPropValue SPropVals,
  89. ULONG cValues,
  90. PRECIPIENT *ppNewRecipList,
  91. PRECIPIENT pOldRecipList
  92. );
  93. LPTSTR
  94. InterpretEmailAddress(
  95. LPSPropValue SPropVal,
  96. ULONG cValues
  97. );
  98. DWORD InterpretDistList(
  99. LPSPropValue SPropVals,
  100. ULONG cValues,
  101. PRECIPIENT *ppNewRecipList,
  102. PRECIPIENT pOldRecipList
  103. );
  104. PRECIPIENT FindRecipient(
  105. PRECIPIENT pRecipList,
  106. PICKFAX* pPickFax
  107. );
  108. PRECIPIENT FindRecipient(
  109. PRECIPIENT pRecipient,
  110. PRECIPIENT pRecipList
  111. );
  112. DWORD AddRecipient(
  113. PRECIPIENT* ppNewRecip,
  114. PRECIPIENT pRecipient,
  115. BOOL bFromAddressBook
  116. );
  117. BOOL GetRecipientProps(PRECIPIENT pRecipient,
  118. LPSPropValue* pMapiProps,
  119. DWORD* pdwPropsNum);
  120. public:
  121. CCommonAbObj(HINSTANCE hInstance);
  122. ~CCommonAbObj();
  123. BOOL
  124. Address(
  125. HWND hWnd,
  126. PRECIPIENT pRecip,
  127. PRECIPIENT * ppNewRecip
  128. );
  129. LPTSTR
  130. AddressEmail(
  131. HWND hWnd
  132. );
  133. static HINSTANCE m_hInstance;
  134. } ;
  135. #endif