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.

124 lines
5.7 KiB

  1. /*****************************************************************************\
  2. FILE: view.h
  3. DESCRIPTION:
  4. This is our ShellView which implements FTP specific behavior. We get
  5. the default DefView implementation and then use IShellFolderViewCB to
  6. override behavior specific to us.
  7. \*****************************************************************************/
  8. #ifndef _FTPVIEW_H
  9. #define _FTPVIEW_H
  10. #include "isfvcb.h"
  11. #include "statusbr.h"
  12. #include "msieftp.h"
  13. #include "dspsprt.h"
  14. CFtpView * GetCFtpViewFromDefViewSite(IUnknown * punkSite);
  15. CStatusBar * GetCStatusBarFromDefViewSite(IUnknown * punkSite);
  16. HRESULT FtpView_SetRedirectPidl(IUnknown * punkSite, LPCITEMIDLIST pidl);
  17. class CFtpView
  18. : public CBaseFolderViewCB
  19. , public IFtpWebView
  20. , public CImpIDispatch
  21. {
  22. public:
  23. //////////////////////////////////////////////////////
  24. // Public Interfaces
  25. //////////////////////////////////////////////////////
  26. // *** IUnknown ***
  27. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  28. virtual STDMETHODIMP_(ULONG) AddRef(void) {return CBaseFolderViewCB::AddRef();};
  29. virtual STDMETHODIMP_(ULONG) Release(void) {return CBaseFolderViewCB::Release();};
  30. // *** IDispatch methods ***
  31. virtual STDMETHODIMP GetTypeInfoCount(UINT * pctinfo);
  32. virtual STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo * * pptinfo);
  33. virtual STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR * * rgszNames, UINT cNames, LCID lcid, DISPID * rgdispid);
  34. virtual STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, UINT * puArgErr);
  35. // *** IFtpWebView methods ***
  36. virtual STDMETHODIMP get_Server(BSTR * pbstr);
  37. virtual STDMETHODIMP get_Directory(BSTR * pbstr);
  38. virtual STDMETHODIMP get_UserName(BSTR * pbstr);
  39. virtual STDMETHODIMP get_PasswordLength(long * plLength);
  40. virtual STDMETHODIMP get_EmailAddress(BSTR * pbstr);
  41. virtual STDMETHODIMP put_EmailAddress(BSTR bstr);
  42. virtual STDMETHODIMP get_CurrentLoginAnonymous(VARIANT_BOOL * pfAnonymousLogin);
  43. virtual STDMETHODIMP get_MessageOfTheDay(BSTR * pbstr);
  44. virtual STDMETHODIMP LoginAnonymously(void);
  45. virtual STDMETHODIMP LoginWithPassword(BSTR bUserName, BSTR bPassword);
  46. virtual STDMETHODIMP LoginWithoutPassword(BSTR bUserName);
  47. virtual STDMETHODIMP InvokeHelp(void) {return _OnInvokeFtpHelp(m_hwndOwner);};
  48. // *** CFtpViewPriv methods ***
  49. BOOL IsForegroundThread(void);
  50. CStatusBar * GetStatusBar(void) { return m_psb; };
  51. HRESULT SetRedirectPidl(LPCITEMIDLIST pidlRedirect);
  52. public:
  53. // Public Member Functions
  54. static HRESULT DummyHintCallback(HWND hwnd, CFtpFolder * pff, HINTERNET hint, LPVOID pv1, LPVOID pv2);
  55. // Friend Functions
  56. friend HRESULT CFtpView_Create(CFtpFolder * pff, HWND hwndOwner, REFIID riid, LPVOID * ppv);
  57. protected:
  58. // Private Member Variables
  59. HWND m_hwndOwner; // The owner window
  60. HWND m_hwndStatusBar; // The Status Bar window
  61. CFtpFolder * m_pff; // The owner Folder
  62. LPGLOBALTIMEOUTINFO m_hgtiWelcome; // The timeout for the welcome message
  63. CStatusBar * m_psb; // The timeout for the welcome message
  64. HINSTANCE m_hinstInetCpl; // HANDLE to Internet Control panel for View.Options.
  65. RECT m_rcPrev; // Previous size so we know when to ignore resizes.
  66. UINT m_idMergedMenus; // Where did I start merging menus?
  67. UINT m_nMenuItemsAdded; // How many menu items did I had?
  68. LPITEMIDLIST m_pidlRedirect; // We want to redirect to this pidl. See the comments in _OnBackGroundEnumDone().
  69. UINT m_nThreadID; // What is the main thread?
  70. // Private Member Functions
  71. CFtpView(CFtpFolder * pff, HWND hwndOwner);
  72. ~CFtpView();
  73. void _InitStatusBar(void);
  74. void _ShowMotd(void);
  75. HRESULT _OnInvokeFtpHelp(HWND hwnd);
  76. HRESULT _LoginWithPassword(LPCTSTR pszUserName, LPCTSTR pszPassword);
  77. virtual HRESULT _OnWindowCreated(void);
  78. virtual HRESULT _OnDefItemCount(LPINT pi);
  79. virtual HRESULT _OnGetHelpText(LPARAM lParam, WPARAM wParam);
  80. virtual HRESULT _OnGetZone(DWORD * pdwZone, WPARAM wParam);
  81. virtual HRESULT _OnGetPane(DWORD dwPaneID, DWORD * pdwPane);
  82. virtual HRESULT _OnRefresh(BOOL fReload);
  83. virtual HRESULT _OnDidDragDrop(DROPEFFECT de, IDataObject * pdto);
  84. virtual HRESULT _OnGetDetailsOf(UINT ici, PDETAILSINFO pdi);
  85. virtual HRESULT _OnInvokeCommand(UINT idc);
  86. virtual HRESULT _OnMergeMenu(LPQCMINFO pqcm);
  87. virtual HRESULT _OnUnMergeMenu(HMENU hMenu);
  88. virtual HRESULT _OnColumnClick(UINT ici);
  89. virtual HRESULT _OnGetNotify(LPITEMIDLIST * ppidl, LONG * lEvents);
  90. virtual HRESULT _OnSize(LONG x, LONG y);
  91. virtual HRESULT _OnUpdateStatusBar(void);
  92. virtual HRESULT _OnThisIDList(LPITEMIDLIST * ppidl);
  93. virtual HRESULT _OnAddPropertyPages(SFVM_PROPPAGE_DATA * pData);
  94. virtual HRESULT _OnInitMenuPopup(HMENU hmenu, UINT idCmdFirst, UINT nIndex);
  95. virtual HRESULT _OnGetHelpTopic(SFVM_HELPTOPIC_DATA * phtd);
  96. virtual HRESULT _OnBackGroundEnumDone(void);
  97. HRESULT _OnInvokeLoginAs(HWND hwndOwner);
  98. HRESULT _OnInvokeNewFolder(HWND hwndOwner);
  99. void _ShowMotdPsf(HWND hwndOwner);
  100. private:
  101. static INT_PTR CALLBACK _MOTDDialogProc(HWND hDlg, UINT wm, WPARAM wParam, LPARAM lParam);
  102. };
  103. #endif // _FTPVIEW_H