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.

150 lines
6.0 KiB

  1. /*
  2. * e n v h o s t . h
  3. *
  4. * Purpose:
  5. *
  6. * History
  7. *
  8. * Copyright (C) Microsoft Corp. 1995, 1996.
  9. */
  10. #ifndef _ENVHOST_H
  11. #define _ENVHOST_H
  12. #include "privunk.h"
  13. #include <envelope.h>
  14. #include <mso.h>
  15. #include <envguid.h>
  16. class CEnvHost:
  17. public IMsoEnvelopeHost,
  18. public CPrivateUnknown
  19. {
  20. public:
  21. // ---------------------------------------------------------------------------
  22. // IUnknown members
  23. // ---------------------------------------------------------------------------
  24. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj) {
  25. return CPrivateUnknown::QueryInterface(riid, ppvObj); };
  26. virtual STDMETHODIMP_(ULONG) AddRef(void) {
  27. return CPrivateUnknown::AddRef();};
  28. virtual STDMETHODIMP_(ULONG) Release(void) {
  29. return CPrivateUnknown::Release(); };
  30. // *** IMsoEnvelopeHost ***
  31. virtual HRESULT STDMETHODCALLTYPE CreateNote(IUnknown *punk,REFCLSID clsidCreate, LPCWSTR wszTheme, LPCWSTR wszAuthor, LPCWSTR wszPrefix, DWORD grfCreate);
  32. virtual HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock);
  33. CEnvHost(IUnknown *pUnkOuter=NULL);
  34. virtual ~CEnvHost();
  35. private:
  36. virtual HRESULT PrivateQueryInterface(REFIID riid, LPVOID * ppvObj);
  37. };
  38. class CGWNote:
  39. public IPersistMime,
  40. public IServiceProvider,
  41. public IMsoEnvelopeSite,
  42. public IMsoComponentManager,
  43. public CPrivateUnknown
  44. {
  45. public:
  46. // ---------------------------------------------------------------------------
  47. // IUnknown members
  48. // ---------------------------------------------------------------------------
  49. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj) {
  50. return CPrivateUnknown::QueryInterface(riid, ppvObj); };
  51. virtual STDMETHODIMP_(ULONG) AddRef(void) {
  52. return CPrivateUnknown::AddRef();};
  53. virtual STDMETHODIMP_(ULONG) Release(void) {
  54. return CPrivateUnknown::Release(); };
  55. // *** IServiceProvider ***
  56. virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, LPVOID *ppvObject);
  57. // *** IPersist ***
  58. virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
  59. // *** IPersistMime ***
  60. virtual HRESULT STDMETHODCALLTYPE Load(IMimeMessage *pMsg);
  61. virtual HRESULT STDMETHODCALLTYPE Save(IMimeMessage *pMsg, DWORD dwFlags);
  62. // *** IEnvelopeSite ***
  63. virtual HRESULT STDMETHODCALLTYPE RequestResize(int *pcHeight);
  64. virtual HRESULT STDMETHODCALLTYPE CloseNote(DWORD grfClose);
  65. virtual HRESULT STDMETHODCALLTYPE GetBody(IStream *pstm, DWORD dwCodePage, DWORD grfBody);
  66. virtual HRESULT STDMETHODCALLTYPE SetBody(IStream *pstm, DWORD dwCodePage, DWORD grfBody);
  67. virtual HRESULT STDMETHODCALLTYPE SetFocus(BOOL fTab);
  68. virtual HRESULT STDMETHODCALLTYPE OnEnvSetFocus();
  69. virtual HRESULT STDMETHODCALLTYPE DirtyToolbars(void);
  70. virtual HRESULT STDMETHODCALLTYPE OnPropChange(ULONG dispid);
  71. virtual HRESULT STDMETHODCALLTYPE IsBodyDirty();
  72. virtual HRESULT STDMETHODCALLTYPE HandsOff();
  73. virtual HRESULT STDMETHODCALLTYPE GetMsoInst(HMSOINST *phinst);
  74. virtual HRESULT STDMETHODCALLTYPE GetFrameWnd(HWND *phwndFrame);
  75. virtual HRESULT STDMETHODCALLTYPE DisplayMessage(HRESULT hr, LPCWSTR wszError, DWORD grfMsg);
  76. virtual HRESULT STDMETHODCALLTYPE SetHelpMode(BOOL fEnter);
  77. virtual HRESULT STDMETHODCALLTYPE TranslateAccelerators(MSG *pMsg);
  78. // *** IMsoComponentManager ***
  79. //HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID iid, void **ppvObj);
  80. BOOL STDMETHODCALLTYPE FDebugMessage(HMSOINST hinst, UINT message, WPARAM wParam, LPARAM lParam);
  81. BOOL STDMETHODCALLTYPE FRegisterComponent(IMsoComponent *piComponent, const MSOCRINFO *pcrinfo, DWORD *pdwComponentID);
  82. BOOL STDMETHODCALLTYPE FRevokeComponent(DWORD dwComponentID);
  83. BOOL STDMETHODCALLTYPE FUpdateComponentRegistration(DWORD dwComponentID, const MSOCRINFO *pcrinfo);
  84. BOOL STDMETHODCALLTYPE FOnComponentActivate(DWORD dwComponentID);
  85. BOOL STDMETHODCALLTYPE FSetTrackingComponent(DWORD dwComponentID, BOOL fTrack);
  86. void STDMETHODCALLTYPE OnComponentEnterState(DWORD dwComponentID, ULONG uStateID, ULONG uContext, ULONG cpicmExclude, IMsoComponentManager **rgpicmExclude, DWORD dwReserved);
  87. BOOL STDMETHODCALLTYPE FOnComponentExitState(DWORD dwComponentID, ULONG uStateID, ULONG uContext, ULONG cpicmExclude, IMsoComponentManager **rgpicmExclude);
  88. BOOL STDMETHODCALLTYPE FInState(ULONG uStateID, void *pvoid);
  89. BOOL STDMETHODCALLTYPE FContinueIdle ();
  90. BOOL STDMETHODCALLTYPE FPushMessageLoop(DWORD dwComponentID, ULONG uReason, void *pvLoopData);
  91. BOOL STDMETHODCALLTYPE FCreateSubComponentManager(IUnknown *piunkOuter, IUnknown *piunkServProv,REFIID riid, void **ppvObj);
  92. BOOL STDMETHODCALLTYPE FGetParentComponentManager(IMsoComponentManager **ppicm);
  93. BOOL STDMETHODCALLTYPE FGetActiveComponent(DWORD dwgac, IMsoComponent **ppic, MSOCRINFO *pcrinfo, DWORD dwReserved);
  94. CGWNote(IUnknown *pUnkOuter=NULL);
  95. virtual ~CGWNote();
  96. static LRESULT CALLBACK ExtWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  97. HRESULT Init(REFCLSID clsidEnvelope, DWORD dwFlags);
  98. HRESULT Show();
  99. HRESULT TranslateAcclerator(MSG *lpmsg);
  100. private:
  101. IMsoEnvelope *m_pEnv;
  102. IMsoComponent *m_pComponent;
  103. HWND m_hwnd,
  104. m_hwndRE,
  105. m_hwndFocus;
  106. ULONG m_cyEnv;
  107. HRESULT PrivateQueryInterface(REFIID riid, LPVOID * ppvObj);
  108. LRESULT WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  109. HRESULT OnNCDestroy();
  110. HRESULT OnCreate(HWND hwnd);
  111. HRESULT InitEnvelope(REFCLSID clsidEnvelope, DWORD dwFlags);
  112. HRESULT WMCommand(HWND hwndCmd, int id, WORD wCmd);
  113. HRESULT WMNotify(int idFrom, NMHDR *pnmh);
  114. HRESULT HrHeaderExecCommand(UINT uCmdID, DWORD nCmdExecOpt, VARIANTARG *pvaIn);
  115. //saveas helpers
  116. HRESULT SaveToFile(LPWSTR pszW);
  117. HRESULT SaveAs();
  118. };
  119. #endif