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.

121 lines
3.9 KiB

  1. // badata.h: interface for the CAddressBookData class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #ifndef __BADATA_H_
  5. #define __BADATA_H_
  6. // Pull in the WAB header files
  7. #include <wab.h>
  8. #include <mimeole.h>
  9. class CIEMsgAb;
  10. typedef struct tagITEMINFO {
  11. LONG lObjectType;
  12. LPENTRYID pEntryID;
  13. ULONG cbEntryID;
  14. } ITEMINFO, *PITEMINFO;
  15. typedef enum
  16. {
  17. LPARAM_MENTRY = 1,
  18. LPARAM_ABENTRY,
  19. LPARAM_MABENTRY,
  20. LPARAM_ABGRPENTRY,
  21. MAX_LPARAM
  22. } MABENUM;
  23. // MAB types masks
  24. #define MAB_CONTACT 0x001
  25. #define MAB_GROUP 0x002
  26. #define MAB_BUDDY 0x004
  27. #define MAB_CERT 0x008
  28. class ATL_NO_VTABLE CAddressBookData
  29. {
  30. public:
  31. /////////////////////////////////////////////////////////////////////////
  32. // Constructor & Destructor
  33. //
  34. CAddressBookData();
  35. virtual ~CAddressBookData();
  36. /////////////////////////////////////////////////////////////////////////
  37. // WAB Functions
  38. //
  39. BOOL fIsWabLoaded(void) {return(m_pAdrBook ? TRUE : FALSE);};
  40. HRESULT OpenWabFile(BOOL fWAB);
  41. HRESULT LoadWabContents(CContainedWindow& ctlList, CIEMsgAb *pSink);
  42. HRESULT DoLDAPSearch(LPTSTR pszText, CContainedWindow& ctlList);
  43. HRESULT NewContact(HWND hwndParent);
  44. HRESULT AddRecipient(LPMIMEADDRESSTABLEW pAddrTable, LPSBinary pInfo, BOOL fGroup);
  45. HRESULT FreeListViewItem(LPSBinary pSB);
  46. HRESULT ShowDetails(HWND hwndParent, LPSBinary pSB);
  47. HRESULT AddAddress(LPWSTR pwszDisplay, LPWSTR pwszAddress);
  48. HRESULT GetDisplayName(LPSBinary pSB, LPWSTR pwszDisplayName, int nMax);
  49. HRESULT DeleteItems(ENTRYLIST *pList);
  50. HRESULT Unadvise(void)
  51. {
  52. if (m_ulConnection)
  53. m_pAdrBook->Unadvise(m_ulConnection);
  54. return (S_OK);
  55. }
  56. HRESULT Find(HWND hwndParent);
  57. HRESULT AddressBook(HWND hwndParent);
  58. HRESULT NewGroup(HWND hwndParent);
  59. HRESULT AutoAddContact(TCHAR * pchName, TCHAR * pchID);
  60. HRESULT InitNamedProps(void);
  61. HRESULT SetDefaultMsgrID(LPSBinary pSB, LPWSTR pchID);
  62. BOOL CheckEmailAddr(LPSBinary pSB, LPWSTR wszEmail);
  63. /////////////////////////////////////////////////////////////////////////
  64. // MAPI Utility Functions
  65. //
  66. protected:
  67. void _FreeProws(LPSRowSet prows);
  68. HRESULT _MergeRowSets(LPSRowSet prows, LPSRowSet FAR *pprowsDst);
  69. HRESULT _QueryAllRows(LPMAPITABLE ptable, LPSPropTagArray ptaga,
  70. LPSRestriction pres, LPSSortOrderSet psos,
  71. LONG crowsMax, LPSRowSet FAR *pprows);
  72. HRESULT _FillListFromTable(CContainedWindow& ctlList, LPSRowSet pSRowSet,
  73. BOOL bLDAP = FALSE);
  74. HRESULT _GetWABTemplateID(ULONG ulObjectType, ULONG *lpcbEID, LPENTRYID *lppEID);
  75. HRESULT _AllocateBuffer(ULONG cbSize, LPVOID FAR *lppBuffer);
  76. HRESULT _FreeBuffer(LPVOID lppBuffer);
  77. HRESULT _AllocateMore(ULONG cbSize, LPVOID lpObject, LPVOID FAR *lppBuffer);
  78. /////////////////////////////////////////////////////////////////////////
  79. // LDAP Routines
  80. //
  81. typedef struct _SortInfo
  82. {
  83. BOOL bSortAscending;
  84. BOOL bSortByLastName;
  85. } SORT_INFO, *LPSORT_INFO;
  86. HRESULT _GetLDAPContainer(ULONG *pcbEntryID, LPENTRYID *ppEntryID);
  87. HRESULT _GetLDAPSearchRestriction(LPTSTR pszText, LPSRestriction lpSRes);
  88. HRESULT _GetLDAPContentsList(ULONG cbContainerEID, LPENTRYID pContainerEID,
  89. SORT_INFO rSortInfo, LPSRestriction pPropRes,
  90. CContainedWindow& ctlList);
  91. // Private member data
  92. private:
  93. // WAB Stuff
  94. LPWABOBJECT m_pWABObject;
  95. HINSTANCE m_hInstWAB;
  96. LPADRBOOK m_pAdrBook;
  97. ULONG m_ulConnection;
  98. // LPMAPISESSION m_pSession;
  99. CIEMsgAb * m_pAB;
  100. };
  101. void AddAccountsToList(HWND hDlg, int id, LPARAM lParam);
  102. #endif // __BADATA_H_