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.

175 lines
6.0 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // IOIPFRAM.CPP - Implements IOleInPlaceFrame for the WebOC
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. #include <assert.h>
  12. #include "ioipfram.h"
  13. #include "iosite.h"
  14. //**********************************************************************
  15. // COleInPlaceFrame::COleInPlaceFrame -- Constructor
  16. //**********************************************************************
  17. COleInPlaceFrame::COleInPlaceFrame(COleSite* pSite)
  18. {
  19. m_pOleSite = pSite;
  20. m_nCount = 0;
  21. AddRef();
  22. }
  23. //**********************************************************************
  24. // COleInPlaceFrame::COleInPlaceFrame -- Destructor
  25. //**********************************************************************
  26. COleInPlaceFrame::~COleInPlaceFrame()
  27. {
  28. assert(m_nCount == 0);
  29. }
  30. //**********************************************************************
  31. // COleInPlaceFrame::QueryInterface
  32. //**********************************************************************
  33. STDMETHODIMP COleInPlaceFrame::QueryInterface(REFIID riid, LPVOID* ppvObj)
  34. {
  35. // delegate to the document Object
  36. return m_pOleSite->QueryInterface(riid, ppvObj);
  37. }
  38. //**********************************************************************
  39. // COleInPlaceFrame::AddRef
  40. //**********************************************************************
  41. STDMETHODIMP_(ULONG) COleInPlaceFrame::AddRef()
  42. {
  43. // increment the interface reference count
  44. return ++m_nCount;
  45. }
  46. //**********************************************************************
  47. // COleInPlaceFrame::Release
  48. //**********************************************************************
  49. STDMETHODIMP_(ULONG) COleInPlaceFrame::Release()
  50. {
  51. // decrement the interface reference count
  52. --m_nCount;
  53. if(m_nCount == 0)
  54. {
  55. delete this;
  56. return 0;
  57. }
  58. return m_nCount;
  59. }
  60. //**********************************************************************
  61. // COleInPlaceFrame::GetWindow
  62. //**********************************************************************
  63. STDMETHODIMP COleInPlaceFrame::GetWindow (HWND* lphwnd)
  64. {
  65. *lphwnd = m_pOleSite->m_hWnd;
  66. return ResultFromScode(S_OK);
  67. }
  68. //**********************************************************************
  69. // COleInPlaceFrame::ContextSensitiveHelp
  70. //**********************************************************************
  71. STDMETHODIMP COleInPlaceFrame::ContextSensitiveHelp (BOOL fEnterMode)
  72. {
  73. //Returning S_OK here prevents the default one from showing
  74. return ResultFromScode(S_OK);
  75. }
  76. //**********************************************************************
  77. // COleInPlaceFrame::GetBorder
  78. //**********************************************************************
  79. STDMETHODIMP COleInPlaceFrame::GetBorder (LPRECT lprectBorder)
  80. {
  81. RECT rect;
  82. // get the rect for the entire frame.
  83. GetClientRect(m_pOleSite->m_hWnd, &rect);
  84. CopyRect(lprectBorder, &rect);
  85. return ResultFromScode(S_OK);
  86. }
  87. //**********************************************************************
  88. // COleInPlaceFrame::RequestBorderSpace -- Not implemented
  89. //**********************************************************************
  90. STDMETHODIMP COleInPlaceFrame::RequestBorderSpace (LPCBORDERWIDTHS lpborderwidths)
  91. {
  92. // always approve the request
  93. return ResultFromScode(S_OK);
  94. }
  95. //**********************************************************************
  96. // COleInPlaceFrame::SetBorderSpace -- Not implemented
  97. //**********************************************************************
  98. STDMETHODIMP COleInPlaceFrame::SetBorderSpace (LPCBORDERWIDTHS lpborderwidths)
  99. {
  100. return ResultFromScode(S_OK);
  101. }
  102. //**********************************************************************
  103. // COleInPlaceFrame::SetActiveObject -- Not implemented
  104. //**********************************************************************
  105. STDMETHODIMP COleInPlaceFrame::SetActiveObject(LPOLEINPLACEACTIVEOBJECT lpActiveObject, LPCOLESTR lpszObjName)
  106. {
  107. return ResultFromScode(S_OK);
  108. }
  109. //**********************************************************************
  110. // COleInPlaceFrame::InsertMenus -- Not implemented
  111. //**********************************************************************
  112. STDMETHODIMP COleInPlaceFrame::InsertMenus (HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
  113. {
  114. return ResultFromScode(S_OK);
  115. }
  116. //**********************************************************************
  117. // COleInPlaceFrame::SetMenu -- Not implemented
  118. //**********************************************************************
  119. STDMETHODIMP COleInPlaceFrame::SetMenu (HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)
  120. {
  121. return ResultFromScode(S_OK);
  122. }
  123. //**********************************************************************
  124. // COleInPlaceFrame::RemoveMenus -- Not implemented
  125. //**********************************************************************
  126. STDMETHODIMP COleInPlaceFrame::RemoveMenus (HMENU hmenuShared)
  127. {
  128. return ResultFromScode(S_OK);
  129. }
  130. //**********************************************************************
  131. // COleInPlaceFrame::SetStatusText -- Not implemented
  132. //**********************************************************************
  133. STDMETHODIMP COleInPlaceFrame::SetStatusText (LPCOLESTR lpszStatusText)
  134. {
  135. return ResultFromScode(E_FAIL);
  136. }
  137. //**********************************************************************
  138. // COleInPlaceFrame::EnableModeless -- Not implemented
  139. //**********************************************************************
  140. STDMETHODIMP COleInPlaceFrame::EnableModeless (BOOL fEnable)
  141. {
  142. return ResultFromScode(S_OK);
  143. }
  144. //**********************************************************************
  145. // COleInPlaceFrame::TranslateAccelerator -- Not implemented
  146. //**********************************************************************
  147. STDMETHODIMP COleInPlaceFrame::TranslateAccelerator (LPMSG lpmsg, WORD wID)
  148. {
  149. return ResultFromScode(S_FALSE);
  150. }