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.

111 lines
2.3 KiB

  1. /*
  2. */
  3. #pragma once
  4. #include <set>
  5. #include <assert.h>
  6. #include <string>
  7. #include "mshtml.h"
  8. #include "ihost.h"
  9. #include "SxApwComPtr.h"
  10. #include "atlwin.h"
  11. #include "FusionTrace.h"
  12. #include "iuiview.h"
  13. #include "SxApwWin.h"
  14. #include "HostFrame.h"
  15. extern _ATL_FUNC_INFO s_OnClickSignature;
  16. class __declspec(uuid(CLSID_CSxApwHost_declspec_uuid))
  17. CSxApwHost
  18. :
  19. public ATL::CComObjectRootEx<CComSingleThreadModel>,
  20. public ATL::CComCoClass<CSxApwHost, &__uuidof(CSxApwHost)>,
  21. public ISxApwHost
  22. {
  23. public:
  24. CSxApwHost() { }
  25. BEGIN_COM_MAP(CSxApwHost)
  26. COM_INTERFACE_ENTRY(ISxApwHost)
  27. END_COM_MAP()
  28. DECLARE_NO_REGISTRY();
  29. STDMETHOD(SetDataSource)(
  30. LPCWSTR
  31. );
  32. STDMETHOD(CreateView)(
  33. LPCWSTR
  34. );
  35. STDMETHOD(DestroyView)(
  36. LPCWSTR
  37. );
  38. STDMETHOD(RunQuery)(
  39. LPCWSTR
  40. );
  41. STDMETHOD(OnNextRow)(
  42. int nColumns,
  43. const LPCWSTR columns[]
  44. );
  45. STDMETHOD(OnRowCountEstimateAvailable)(
  46. int
  47. );
  48. STDMETHOD(OnQueryDone)(
  49. );
  50. STDMETHOD(InformSchema)(
  51. const SxApwColumnInfo rgColumnInfo[],
  52. int nColumnCount
  53. );
  54. HRESULT Main();
  55. private:
  56. void MdiTile();
  57. class CView
  58. {
  59. public:
  60. CView() { }
  61. ~CView() { }
  62. CView(const CView& that) :
  63. m_string(that.m_string)
  64. {
  65. assert(that.m_axMdiChild.m_hWnd == NULL);
  66. assert(that.m_iuiview == NULL);
  67. }
  68. void operator=(const CView& that)
  69. {
  70. this->m_string = that.m_string;
  71. assert(this->m_axMdiChild.m_hWnd == NULL);
  72. assert(that.m_axMdiChild.m_hWnd == NULL);
  73. assert(this->m_iuiview == NULL);
  74. assert(that.m_iuiview == NULL);
  75. }
  76. bool operator<(const CView& that) const
  77. {
  78. return _wcsicmp(this->m_string.c_str(), that.m_string.c_str()) < 0;
  79. }
  80. std::wstring m_string;
  81. CSxApwHostAxMdiChild m_axMdiChild;
  82. CSxApwComPtr<ISxApwUiView> m_iuiview;
  83. };
  84. typedef std::set<CView> CViews;
  85. typedef std::pair<CViews::iterator, bool> CViewsConditionalInsertPair;
  86. CViews m_views;
  87. CSxApwComPtr<ISxApwDataSource> m_dataSource;
  88. CSxApwHostMdiClient m_mdiClient;
  89. };