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.

118 lines
4.5 KiB

  1. /**************************************************************\
  2. FILE: addrlist.h
  3. DESCRIPTION:
  4. This is a class that all Address Lists can inherite
  5. from. This will give them the IAddressList interface
  6. so they can work in the AddressBand/Bar.
  7. \**************************************************************/
  8. #ifndef _ADDRLIST_H
  9. #define _ADDRLIST_H
  10. #include "shellurl.h"
  11. #define ACP_LIST_MAX_CONST 25
  12. /**************************************************************\
  13. CLASS: CAddressList
  14. DESCRIPTION:
  15. This is a class that all Address Lists can inherite
  16. from. This will give them the IAddressList interface
  17. so they can work in the AddressBand/Bar.
  18. NOTE:
  19. This is a virtual class!
  20. \**************************************************************/
  21. class CAddressList
  22. : public IAddressList // (Includes IWinEventHandler)
  23. {
  24. public:
  25. //////////////////////////////////////////////////////
  26. // Public Interfaces
  27. //////////////////////////////////////////////////////
  28. // *** IUnknown ***
  29. virtual STDMETHODIMP_(ULONG) AddRef(void);
  30. virtual STDMETHODIMP_(ULONG) Release(void);
  31. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  32. // *** IWinEventHandler methods ***
  33. virtual STDMETHODIMP OnWinEvent(HWND hwnd, UINT dwMsg, WPARAM wParam, LPARAM lParam, LRESULT* plre);
  34. virtual STDMETHODIMP IsWindowOwner(HWND hwnd) { return E_NOTIMPL; }
  35. // *** IAddressList methods ***
  36. virtual STDMETHODIMP Connect(BOOL fConnect, HWND hwnd, IBrowserService * pbs, IBandProxy * pbp, IAutoComplete * pac);
  37. virtual STDMETHODIMP NavigationComplete(LPVOID pvCShellUrl);
  38. virtual STDMETHODIMP Refresh(DWORD dwType) { return S_OK; } // Force subclasses to handle.
  39. virtual STDMETHODIMP Load(void) {return E_NOTIMPL;}
  40. virtual STDMETHODIMP Save(void) {return E_NOTIMPL;}
  41. virtual STDMETHODIMP SetToListIndex(int nIndex, LPVOID pvShelLUrl);
  42. virtual STDMETHODIMP FileSysChangeAL(DWORD dw, LPCITEMIDLIST* ppidl);
  43. protected:
  44. //////////////////////////////////////////////////////
  45. // Private Member Functions
  46. //////////////////////////////////////////////////////
  47. // Constructor / Destructor
  48. CAddressList();
  49. virtual ~CAddressList(void); // This is now an OLE Object and cannot be used as a normal Class.
  50. // Address Band Specific Functions
  51. virtual LRESULT _OnNotify(LPNMHDR pnm);
  52. virtual LRESULT _OnCommand(WPARAM wParam, LPARAM lParam);
  53. virtual void _InitCombobox(void);
  54. virtual HRESULT _Populate(void) = 0; // This is a PURE function.
  55. virtual void _PurgeComboBox();
  56. // Helper Functions
  57. void _ComboBoxInsertURL(LPCTSTR pszURL, int cchStrSize, int nMaxComboBoxSize);
  58. BOOL _MoveAddressToTopOfList(int iSel);
  59. HRESULT _GetUrlUI(CShellUrl * psu, LPCTSTR szUrl, int *piImage, int *piImageSelected);
  60. HRESULT _GetFastPathIcons(LPCTSTR pszPath, int *piImage, int *piSelectedImage);
  61. HRESULT _GetPidlIcon(LPCITEMIDLIST pidl, int *piImage, int *piSelectedImage);
  62. virtual LPITEMIDLIST _GetDragDropPidl(LPNMCBEDRAGBEGINW pnmcbe);
  63. LRESULT _OnDragBeginW(LPNMCBEDRAGBEGINW pnmcbe);
  64. LRESULT _OnDragBeginA(LPNMCBEDRAGBEGINA pnmcbe) ;
  65. HRESULT _SetPreferedDropEffect(IDataObject *pdtobj, DWORD dwEffect);
  66. //////////////////////////////////////////////////////
  67. // Private Member Variables
  68. //////////////////////////////////////////////////////
  69. int _cRef;
  70. BOOL _fVisible:1; // TRUE when the toolbar is visible.
  71. HWND _hwnd; // The window
  72. IBrowserService * _pbs;
  73. IBandProxy * _pbp;
  74. CShellUrl * _pshuUrl;
  75. };
  76. HRESULT GetCBListIndex(HWND hwnd, int iItem, LPTSTR szAddress, int cchAddressSize);
  77. IAddressList * CSNSList_Create(void);
  78. IAddressList * CMRUList_Create(void);
  79. IAddressList * CACPList_Create(void);
  80. //===========================================================================
  81. // IMRU: Interface to CMRUList. Note that this interface never leaves browseui
  82. #undef INTERFACE
  83. #define INTERFACE IMRU
  84. DECLARE_INTERFACE_(IMRU, IUnknown)
  85. {
  86. // *** IUnknown methods ***
  87. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  88. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  89. STDMETHOD_(ULONG,Release) (THIS) PURE;
  90. // *** IMRU Methods ***
  91. STDMETHOD(AddEntry) (THIS_ LPCWSTR pszEntry) PURE;
  92. };
  93. #endif // _ADDRLIST_H