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.

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