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.

171 lines
3.4 KiB

  1. /*++
  2. Copyright (C) 1993-1999 Microsoft Corporation
  3. Module Name:
  4. iipobj.cpp
  5. Abstract:
  6. IOleInPlaceObject interface implementation for Polyline
  7. --*/
  8. #include "polyline.h"
  9. #include "unkhlpr.h"
  10. /*
  11. * CImpIOleInPlaceObject interface implementation
  12. */
  13. IMPLEMENT_CONTAINED_INTERFACE(CPolyline, CImpIOleInPlaceObject)
  14. /*
  15. * CImpIOleInPlaceObject::GetWindow
  16. *
  17. * Purpose:
  18. * Retrieves the handle of the window associated with the object
  19. * on which this interface is implemented.
  20. *
  21. * Parameters:
  22. * phWnd HWND * in which to store the window handle.
  23. *
  24. * Return Value:
  25. * HRESULT NOERROR if successful, E_FAIL if there is no
  26. * window.
  27. */
  28. STDMETHODIMP CImpIOleInPlaceObject::GetWindow(HWND *phWnd)
  29. {
  30. if (NULL!=m_pObj->m_pHW)
  31. *phWnd=m_pObj->m_pHW->Window();
  32. else
  33. *phWnd=m_pObj->m_pCtrl->Window();
  34. return NOERROR;
  35. }
  36. /*
  37. * CImpIOleInPlaceObject::ContextSensitiveHelp
  38. *
  39. * Purpose:
  40. * Instructs the object on which this interface is implemented to
  41. * enter or leave a context-sensitive help mode.
  42. *
  43. * Parameters:
  44. * fEnterMode BOOL TRUE to enter the mode, FALSE otherwise.
  45. *
  46. * Return Value:
  47. * HRESULT NOERROR or an error code
  48. */
  49. STDMETHODIMP CImpIOleInPlaceObject::ContextSensitiveHelp (
  50. BOOL /* fEnterMode */)
  51. {
  52. return ResultFromScode(E_NOTIMPL);
  53. }
  54. /*
  55. * CImpIOleInPlaceObject::InPlaceDeactivate
  56. *
  57. * Purpose:
  58. * Instructs the object to deactivate itself from an in-place state
  59. * and to discard any Undo state.
  60. *
  61. * Parameters:
  62. * None
  63. *
  64. * Return Value:
  65. * HRESULT NOERROR or an error code
  66. */
  67. STDMETHODIMP CImpIOleInPlaceObject::InPlaceDeactivate(void)
  68. {
  69. m_pObj->InPlaceDeactivate();
  70. return NOERROR;
  71. }
  72. /*
  73. * CImpIOleInPlaceObject::UIDeactivate
  74. *
  75. * Purpose:
  76. * Instructs the object to just remove any in-place user interface
  77. * but to do no other deactivation. The object should just hide
  78. * the UI components but not destroy them until InPlaceDeactivate
  79. * is called.
  80. *
  81. * Parameters:
  82. * None
  83. *
  84. * Return Value:
  85. * HRESULT NOERROR or an error code
  86. */
  87. STDMETHODIMP CImpIOleInPlaceObject::UIDeactivate(void)
  88. {
  89. m_pObj->UIDeactivate();
  90. return NOERROR;
  91. }
  92. /*
  93. * CImpIOleInPlaceObject::SetObjectRects
  94. *
  95. * Purpose:
  96. * Provides the object with rectangles describing the position of
  97. * the object in the container window as well as its visible area.
  98. *
  99. * Parameters:
  100. * prcPos LPCRECT providing the object's full rectangle
  101. * relative to the continer's document. The object
  102. * should scale to this rectangle.
  103. * prcClip LPCRECT describing the visible area of the object
  104. * which should not draw outside these areas.
  105. *
  106. * Return Value:
  107. * HRESULT NOERROR or an error code
  108. */
  109. STDMETHODIMP CImpIOleInPlaceObject::SetObjectRects(LPCRECT prcPos
  110. , LPCRECT prcClip)
  111. {
  112. if (NULL!=m_pObj->m_pHW)
  113. m_pObj->m_pHW->RectsSet((LPRECT)prcPos, (LPRECT)prcClip);
  114. return NOERROR;
  115. }
  116. /*
  117. * CImpIOleInPlaceObject::ReactivateAndUndo
  118. *
  119. * Purpose:
  120. * Instructs the object to reactivate itself in-place and perform
  121. * whatever Undo means for it.
  122. *
  123. * Parameters:
  124. * None
  125. *
  126. * Return Value:
  127. * HRESULT NOERROR or an error code
  128. */
  129. STDMETHODIMP CImpIOleInPlaceObject::ReactivateAndUndo(void)
  130. {
  131. return m_pObj->InPlaceActivate(m_pObj->m_pIOleClientSite, TRUE);
  132. }