1
0

SWFContainer.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #ifndef NULLSOFT_HTMLCONTAINERH
  2. #define NULLSOFT_HTMLCONTAINERH
  3. #include <oleidl.h>
  4. #include <ocidl.h>
  5. //#import <system32/macromed/Flash/Flash9e.ocx> /*no_namespace, */named_guids, raw_interfaces_only, exclude("IServiceProvider")
  6. #include "Flash9e.tlh"
  7. #include "FlashDispInterface.h"
  8. //#include <shlobj.h>
  9. /**************************************************************************
  10. class definitions
  11. **************************************************************************/
  12. #ifndef DOCHOSTUIFLAG_HOST_NAVIGATES
  13. #define DOCHOSTUIFLAG_HOST_NAVIGATES 0x02000000
  14. #endif
  15. #ifndef DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION
  16. #define DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION 0x04000000
  17. #endif
  18. #ifndef DOCHOSTUIFLAG_USE_WINDOWLESS_SELECTCONTROL
  19. #define DOCHOSTUIFLAG_USE_WINDOWLESS_SELECTCONTROL 0x08000000
  20. #endif
  21. #ifndef DOCHOSTUIFLAG_USE_WINDOWED_SELECTCONTROL
  22. #define DOCHOSTUIFLAG_USE_WINDOWED_SELECTCONTROL 0x10000000
  23. #endif
  24. #ifndef DOCHOSTUIFLAG_ENABLE_ACTIVEX_INACTIVATE_MODE
  25. #define DOCHOSTUIFLAG_ENABLE_ACTIVEX_INACTIVATE_MODE 0x20000000
  26. #endif
  27. class SWFContainer : public IOleClientSite,
  28. public IOleInPlaceSite,
  29. public IOleInPlaceFrame,
  30. public IOleControlSite,
  31. public IDispatch
  32. {
  33. protected:
  34. ULONG m_cRefs; // ref count
  35. IUnknown *m_punk; // IUnknown of contained object
  36. RECT m_rect; // size of control
  37. bool bInitialized;
  38. public:
  39. HWND m_hwnd; // window handle of the container
  40. SWFContainer(HWND hwnd);
  41. virtual ~SWFContainer();
  42. public:
  43. // *** IUnknown Methods ***
  44. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  45. STDMETHOD_(ULONG, AddRef)(void);
  46. STDMETHOD_(ULONG, Release)(void);
  47. // *** IOleInPlaceUIWindow Methods ***
  48. STDMETHOD (GetBorder)(LPRECT lprectBorder);
  49. STDMETHOD (RequestBorderSpace)(LPCBORDERWIDTHS lpborderwidths);
  50. STDMETHOD (SetBorderSpace)(LPCBORDERWIDTHS lpborderwidths);
  51. STDMETHOD (SetActiveObject)(IOleInPlaceActiveObject * pActiveObject,
  52. LPCOLESTR lpszObjName);
  53. // *** IOleClientSite Methods ***
  54. STDMETHOD (SaveObject)();
  55. STDMETHOD (GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER *ppMk);
  56. STDMETHOD (GetContainer)(LPOLECONTAINER *ppContainer);
  57. STDMETHOD (ShowObject)();
  58. STDMETHOD (OnShowWindow)(BOOL fShow);
  59. STDMETHOD (RequestNewObjectLayout)();
  60. // *** IOleWindow Methods ***
  61. STDMETHOD (GetWindow) (HWND * phwnd);
  62. STDMETHOD (ContextSensitiveHelp) (BOOL fEnterMode);
  63. // *** IOleInPlaceSite Methods ***
  64. STDMETHOD (CanInPlaceActivate) (void);
  65. STDMETHOD (OnInPlaceActivate) (void);
  66. STDMETHOD (OnUIActivate) (void);
  67. STDMETHOD (GetWindowContext) (IOleInPlaceFrame ** ppFrame, IOleInPlaceUIWindow ** ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo);
  68. STDMETHOD (Scroll) (SIZE scrollExtent);
  69. STDMETHOD (OnUIDeactivate) (BOOL fUndoable);
  70. STDMETHOD (OnInPlaceDeactivate) (void);
  71. STDMETHOD (DiscardUndoState) (void);
  72. STDMETHOD (DeactivateAndUndo) (void);
  73. STDMETHOD (OnPosRectChange) (LPCRECT lprcPosRect);
  74. // *** IOleInPlaceFrame Methods ***
  75. STDMETHOD (InsertMenus)(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths);
  76. STDMETHOD (SetMenu)(HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject);
  77. STDMETHOD (RemoveMenus)(HMENU hmenuShared);
  78. STDMETHOD (SetStatusText)(LPCOLESTR pszStatusText);
  79. STDMETHOD (EnableModeless)(BOOL fEnable);
  80. STDMETHOD (TranslateAccelerator)(LPMSG lpmsg, WORD wID);
  81. // *** IOleControlSite Methods ***
  82. STDMETHOD (OnControlInfoChanged)(void);
  83. STDMETHOD (LockInPlaceActive)(BOOL fLock);
  84. STDMETHOD (GetExtendedControl)(IDispatch **ppDisp);
  85. STDMETHOD (TransformCoords)(POINTL *pptlHimetric, POINTF *pptfContainer, DWORD dwFlags);
  86. STDMETHOD (TranslateAccelerator)(LPMSG pMsg, DWORD grfModifiers);
  87. STDMETHOD (OnFocus)(BOOL fGotFocus);
  88. STDMETHOD (ShowPropertyFrame)(void);
  89. // *** IDispatch Methods ***
  90. STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgdispid);
  91. STDMETHOD (GetTypeInfo)(unsigned int itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
  92. STDMETHOD (GetTypeInfoCount)(unsigned int FAR * pctinfo);
  93. STDMETHOD (Invoke) (
  94. /* [in] */ DISPID dispIdMember,
  95. /* [in] */ REFIID riid,
  96. /* [in] */ LCID lcid,
  97. /* [in] */ WORD wFlags,
  98. /* [out][in] */ DISPPARAMS *pDispParams,
  99. /* [out] */ VARIANT *pVarResult,
  100. /* [out] */ EXCEPINFO *pExcepInfo,
  101. /* [out] */ UINT *puArgErr);
  102. public:
  103. void add(CLSID clsid);
  104. void remove();
  105. void setLocation(int x, int y, int width, int height);
  106. void setVisible(BOOL fVisible);
  107. void setFocus(BOOL fFocus);
  108. void setStatusWindow(HWND hwndStatus);
  109. bool translateKey(LPMSG pMsg);
  110. void close();
  111. IUnknown * getUnknown();
  112. void SyncSizeToWindow(HWND window);
  113. IConnectionPoint *GetConnectionPoint(REFIID riid);
  114. DWORD m_dwCookie;
  115. struct ShockwaveFlashObjects::IShockwaveFlash *flash;
  116. FlashDispInterface *externalInterface;
  117. private:
  118. };
  119. #endif