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.

152 lines
4.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: clnthndlr.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 10-10-95 JohannP (Johann Posch) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef _CLTHNDLR_H_DEFINED_
  18. #define _CLTHNDLR_H_DEFINED_
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Class: CClientSiteHandler ()
  22. //
  23. // Purpose: Implement ClientSide of IOleClientSite handler
  24. //
  25. //
  26. // History: 11-17-95 JohannP (Johann Posch) Created
  27. //
  28. // Notes:
  29. //
  30. //----------------------------------------------------------------------------
  31. class CClientSiteHandler : public IClientSiteHandler
  32. {
  33. public:
  34. CClientSiteHandler(IOleClientSite *pOCS);
  35. ~CClientSiteHandler();
  36. STDMETHOD(QueryInterface) ( REFIID riid, LPVOID FAR* ppvObj);
  37. STDMETHOD_(ULONG,AddRef) (void);
  38. STDMETHOD_(ULONG,Release) (void);
  39. // IOleClientSite methods
  40. STDMETHOD (GetContainer)(IOleContainer **ppContainer);
  41. STDMETHOD (OnShowWindow)(BOOL fShow);
  42. STDMETHOD (GetMoniker)(DWORD dwAssign,DWORD dwWhichMoniker,IMoniker **ppmk);
  43. STDMETHOD (RequestNewObjectLayout)();
  44. STDMETHOD (SaveObject)();
  45. STDMETHOD (ShowObject)();
  46. // IOleWindow methods
  47. STDMETHOD (GetWindow)(HWND *phwnd);
  48. STDMETHOD (ContextSensitiveHelp)(BOOL fEnterMode);
  49. // IOleInPlaceSite methods
  50. STDMETHOD (CanInPlaceActivate)(void);
  51. STDMETHOD (OnInPlaceActivate)(void);
  52. STDMETHOD (OnUIActivate)(void);
  53. STDMETHOD (GetWindowContext)(IOleInPlaceFrame **ppFrame,IOleInPlaceUIWindow **ppDoc,
  54. LPRECT lprcPosRect,LPRECT lprcClipRect,LPOLEINPLACEFRAMEINFO lpFrameInfo);
  55. STDMETHOD (Scroll)(SIZE scrollExtant);
  56. STDMETHOD (OnUIDeactivate)(BOOL fUndoable);
  57. STDMETHOD (OnInPlaceDeactivate)(void);
  58. STDMETHOD (DiscardUndoState)(void);
  59. STDMETHOD (DeactivateAndUndo)(void);
  60. STDMETHOD (OnPosRectChange)(LPCRECT lprcPosRect);
  61. // IClientSiteHandler methods
  62. STDMETHOD (GoInPlaceActivate)(HWND *phwndOIPS);
  63. public:
  64. IOleClientSite *m_pOCS;
  65. IOleInPlaceSite *m_pOIPS;
  66. private:
  67. ULONG m_cRefs;
  68. };
  69. // IOleClientSite Replacement implementation
  70. // Implements ServerSide of ClientSiteHandler.
  71. class CEmbServerClientSite : public IOleClientSite, public IOleInPlaceSite
  72. {
  73. public:
  74. CEmbServerClientSite(IUnknown *pUnkOuter);
  75. ~CEmbServerClientSite();
  76. STDMETHOD(Initialize) (OBJREF objref,BOOL fHasIPSite);
  77. STDMETHOD(SetDoVerbState) (BOOL fDoVerbState);
  78. // Controlling Unknown.
  79. class CPrivUnknown : public IUnknown
  80. {
  81. public:
  82. STDMETHOD(QueryInterface) ( REFIID riid, LPVOID FAR* ppvObj);
  83. STDMETHOD_(ULONG,AddRef) (void);
  84. STDMETHOD_(ULONG,Release) (void);
  85. CEmbServerClientSite *m_EmbServerClientSite;
  86. };
  87. friend class CPrivUnknown;
  88. CPrivUnknown m_Unknown;
  89. // IUnknown Methods
  90. STDMETHOD(QueryInterface) ( REFIID iid, LPVOID FAR* ppvObj);
  91. STDMETHOD_(ULONG,AddRef) (void);
  92. STDMETHOD_(ULONG,Release) (void);
  93. // IOleClientSite Methods
  94. STDMETHOD (SaveObject)( void);
  95. STDMETHOD (GetMoniker)( DWORD dwAssign,DWORD dwWhichMoniker,IMoniker **ppmk);
  96. STDMETHOD (GetContainer)(IOleContainer **ppContainer);
  97. STDMETHOD (ShowObject)( void);
  98. STDMETHOD (OnShowWindow)(BOOL fShow);
  99. STDMETHOD (RequestNewObjectLayout)( void);
  100. // IOleInPlaceSiteMethods.
  101. STDMETHOD (GetWindow)(HWND *phwnd);
  102. STDMETHOD (ContextSensitiveHelp)( BOOL fEnterMode);
  103. STDMETHOD (CanInPlaceActivate)(void);
  104. STDMETHOD (OnInPlaceActivate)( void);
  105. STDMETHOD (OnUIActivate)( void);
  106. STDMETHOD (GetWindowContext)(IOleInPlaceFrame **ppFrame,IOleInPlaceUIWindow **ppDoc,
  107. LPRECT lprcPosRect,LPRECT lprcClipRect,LPOLEINPLACEFRAMEINFO lpFrameInfo);
  108. STDMETHOD (Scroll)(SIZE scrollExtant);
  109. STDMETHOD (OnUIDeactivate)(BOOL fUndoable);
  110. STDMETHOD (OnInPlaceDeactivate)( void);
  111. STDMETHOD (DiscardUndoState)( void);
  112. STDMETHOD (DeactivateAndUndo)( void);
  113. STDMETHOD (OnPosRectChange)(LPCRECT lprcPosRect);
  114. private:
  115. IClientSiteHandler *m_pClientSiteHandler; // Pointer to Real Containers ClientSite.
  116. IUnknown *m_pUnkOuter; // Controlling Unknown
  117. ULONG m_cRefs;
  118. IUnknown *m_pUnkInternal; // used for QI on object.
  119. BOOL m_fInDelete; // Set to True if RefCount has gone to Zero.
  120. BOOL m_fInDoVerb;
  121. BOOL m_fHasIPSite;
  122. // Cache data while in doVerbState
  123. HWND m_hwndOIPS;
  124. };
  125. HRESULT CreateClientSiteHandler(IOleClientSite *pOCS, CClientSiteHandler **ppClntHdlr,BOOL *pfHasIPSite);
  126. #endif // _CLTHNDLR_H_DEFINED