Source code of Windows XP (NT5)
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.

127 lines
3.5 KiB

  1. // File calv.h
  2. //
  3. // Address List View class
  4. #ifndef _CALV_H_
  5. #define _CALV_H_
  6. #include "confutil.h"
  7. #include "richaddr.h"
  8. VOID ClearRai(RAI ** ppRai);
  9. RAI * DupRai(RAI * pRai);
  10. RAI * CreateRai(LPCTSTR pszName, NM_ADDR_TYPE addrType, LPCTSTR pszAddr);
  11. BOOL FEnabledNmAddr(DWORD dwAddrType);
  12. ///////////////////////////////
  13. // Globals for FEnabledNmAddr
  14. extern BOOL g_fGkEnabled;
  15. extern BOOL g_fGatewayEnabled;
  16. extern BOOL g_bGkPhoneNumberAddressing;
  17. // Generic class for handling I/O to the list for CallDialog
  18. class CALV : public RefCount
  19. {
  20. private:
  21. BOOL m_fAvailable; // TRUE if data is available
  22. int m_idsName; // The address type name resource id
  23. HWND m_hwnd; // The list view
  24. int m_iIcon; // small icon index
  25. const int * m_pIdMenu; // Right click menu data
  26. bool m_fOwnerDataList;
  27. public:
  28. CALV(int ids, int iIcon=0, const int * pIdMenu=NULL, bool fOwnerData = false);
  29. ~CALV();
  30. // Return TRUE if there is data available
  31. BOOL FAvailable(void) {return m_fAvailable;}
  32. VOID SetAvailable(BOOL fAvail) {m_fAvailable = fAvail;}
  33. VOID SetWindow(HWND hwnd) {m_hwnd = hwnd;}
  34. HWND GetHwnd(void) {return m_hwnd;}
  35. VOID ClearHwnd(void) {m_hwnd = NULL;}
  36. BOOL FOwnerData(void) {return m_fOwnerDataList;}
  37. int GetSelection(void);
  38. VOID SetHeader(HWND hwnd, int ids);
  39. VOID DeleteItem(int iItem);
  40. // Get the standard name for the address list
  41. VOID GetName(LPTSTR psz, int cchMax)
  42. {
  43. FLoadString(m_idsName, psz, cchMax);
  44. }
  45. VOID DoMenu(POINT pt, const int * pIdMenu);
  46. static VOID SetBusyCursor(BOOL fBusy);
  47. ///////////////////////////////////////////////////////////////////////
  48. // VIRTUAL methods
  49. virtual int GetIconId(LPCTSTR psz) {return m_iIcon;}
  50. // Put the items into the list control
  51. virtual VOID ShowItems(HWND hwnd) = 0; // This must be implemented
  52. // Destroy all of the data in the list control
  53. virtual VOID ClearItems(void);
  54. // Return the string data for the item/column
  55. virtual BOOL GetSzData(LPTSTR psz, int cchMax, int iItem, int iCol);
  56. // Return the name (from the first column)
  57. virtual BOOL GetSzName(LPTSTR psz, int cchMax);
  58. virtual BOOL GetSzName(LPTSTR psz, int cchMax, int iItem);
  59. // Return the "callTo" address (from the second column)
  60. virtual BOOL GetSzAddress(LPTSTR psz, int cchMax);
  61. virtual BOOL GetSzAddress(LPTSTR psz, int cchMax, int iItem);
  62. // Get the "Rich" address information
  63. virtual RAI * GetAddrInfo(void);
  64. virtual RAI * GetAddrInfo(NM_ADDR_TYPE addType);
  65. virtual LPARAM LParamFromItem(int iItem);
  66. // Handle a right click notification
  67. virtual VOID OnRClick(POINT pt);
  68. // Handle a command
  69. virtual VOID OnCommand(WPARAM wParam, LPARAM lParam);
  70. // Default commands
  71. virtual VOID CmdProperties(void);
  72. virtual VOID CmdSpeedDial(void);
  73. virtual VOID CmdRefresh(void);
  74. virtual void OnListCacheHint( int indexFrom, int indexTo )
  75. {
  76. ;
  77. }
  78. virtual ULONG OnListFindItem( const TCHAR* szPartialMatchingString )
  79. {
  80. return TRUE;
  81. }
  82. virtual bool IsItemBold( int index )
  83. {
  84. return false;
  85. }
  86. virtual int OnListGetImageForItem( int iIndex )
  87. {
  88. return II_INVALIDINDEX;
  89. }
  90. virtual void OnListGetColumn1Data( int iItemIndex, int cchTextMax, TCHAR* szBuf ) { lstrcpyn( szBuf, "", cchTextMax ); }
  91. virtual void OnListGetColumn2Data( int iItemIndex, int cchTextMax, TCHAR* szBuf ) { lstrcpyn( szBuf, "", cchTextMax ); }
  92. virtual void OnListGetColumn3Data( int iItemIndex, int cchTextMax, TCHAR* szBuf ) { lstrcpyn( szBuf, "", cchTextMax ); }
  93. };
  94. #endif /* _CALV_H_ */