1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 // SOActiveX.h : Declaration of the CSOActiveX
22 #ifndef __SOACTIVEX_H_
23 #define __SOACTIVEX_H_
25 #include "resource.h" // main symbols
27 #pragma warning (disable:4505)
28 // permanently suppress "unreferenced local function has been removed" warning
30 #pragma warning (push,1)
31 #pragma warning (disable:4265)
39 #include "so_activex.h"
43 class SODispatchInterceptor
;
56 /////////////////////////////////////////////////////////////////////////////
58 class ATL_NO_VTABLE CSOActiveX
:
59 public CComObjectRootEx
<CComSingleThreadModel
>,
60 public IDispatchImpl
<ISOActiveX
, &IID_ISOActiveX
, &LIBID_SO_ACTIVEXLib
>,
61 public CComControl
<CSOActiveX
>,
62 public IPersistStreamInitImpl
<CSOActiveX
>,
63 public IOleControlImpl
<CSOActiveX
>,
64 public IOleObjectImpl
<CSOActiveX
>,
65 public IOleInPlaceActiveObjectImpl
<CSOActiveX
>,
66 public IViewObjectExImpl
<CSOActiveX
>,
67 public IOleInPlaceObjectWindowlessImpl
<CSOActiveX
>,
68 // public IConnectionPointContainerImpl<CSOActiveX>,
69 public CComCoClass
<CSOActiveX
, &CLSID_SOActiveX
>,
70 // public CProxy_ItryPluginEvents< CSOActiveX >,
71 public IPersistPropertyBagImpl
< CSOActiveX
>,
72 public IProvideClassInfo2Impl
< &CLSID_SOActiveX
,
73 &DIID__ISOActiveXEvents
,
74 &LIBID_SO_ACTIVEXLib
>,
75 public IObjectSafetyImpl
< CSOActiveX
,
76 INTERFACESAFE_FOR_UNTRUSTED_DATA
>
79 CComPtr
<IWebBrowser2
> mWebBrowser2
;
82 CComPtr
<IDispatch
> mpDispFactory
;
83 CComPtr
<IDispatch
> mpDispFrame
;
84 CComPtr
<IDispatch
> mpInstanceLocker
;
85 CComPtr
<IDispatch
> mpDispWin
;
93 SODispatchInterceptor
* mpDispatchInterceptor
;
96 BOOL mbReadyForActivation
;
97 CComPtr
<IDispatch
> mpDispTempFile
;
105 DECLARE_REGISTRY_RESOURCEID(IDR_SOACTIVEX
)
107 DECLARE_PROTECT_FINAL_CONSTRUCT()
109 BEGIN_COM_MAP(CSOActiveX
)
110 COM_INTERFACE_ENTRY(ISOActiveX
)
111 COM_INTERFACE_ENTRY(IDispatch
)
112 COM_INTERFACE_ENTRY(IViewObjectEx
)
113 COM_INTERFACE_ENTRY(IViewObject2
)
114 COM_INTERFACE_ENTRY(IViewObject
)
115 COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless
)
116 COM_INTERFACE_ENTRY(IOleInPlaceObject
)
117 COM_INTERFACE_ENTRY2(IOleWindow
, IOleInPlaceObjectWindowless
)
118 COM_INTERFACE_ENTRY(IOleInPlaceActiveObject
)
119 COM_INTERFACE_ENTRY(IOleControl
)
120 COM_INTERFACE_ENTRY(IOleObject
)
121 COM_INTERFACE_ENTRY(IPersistStreamInit
)
122 COM_INTERFACE_ENTRY2(IPersist
, IPersistStreamInit
)
123 // COM_INTERFACE_ENTRY(IConnectionPointContainer)
124 COM_INTERFACE_ENTRY(IProvideClassInfo
)
125 COM_INTERFACE_ENTRY(IProvideClassInfo2
)
126 COM_INTERFACE_ENTRY(IPersistPropertyBag
)
127 COM_INTERFACE_ENTRY(IObjectSafety
)
130 BEGIN_PROP_MAP(CSOActiveX
)
131 PROP_DATA_ENTRY("_cx", m_sizeExtent
.cx
, VT_UI4
)
132 PROP_DATA_ENTRY("_cy", m_sizeExtent
.cy
, VT_UI4
)
134 // PROP_ENTRY("Property Description", dispid, clsid)
135 // PROP_PAGE(CLSID_StockColorPage)
138 BEGIN_CONNECTION_POINT_MAP(CSOActiveX
)
139 END_CONNECTION_POINT_MAP()
141 BEGIN_MSG_MAP(CSOActiveX
)
142 CHAIN_MSG_MAP(CComControl
<CSOActiveX
>)
143 DEFAULT_REFLECTION_HANDLER()
145 // Handler prototypes:
146 // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
147 // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
148 // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
153 DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND
| VIEWSTATUS_OPAQUE
)
158 STDMETHOD(SetClientSite
)( IOleClientSite
* aClientSite
);
159 STDMETHOD(Invoke
)( DISPID dispidMember
,
163 DISPPARAMS
* pDispParams
,
165 EXCEPINFO
* pExcepInfo
,
167 STDMETHOD(Load
) ( LPPROPERTYBAG pPropBag
, LPERRORLOG pErrorLog
);
168 STDMETHOD(Load
) ( LPSTREAM pStm
);
169 STDMETHOD(InitNew
) ();
170 HRESULT
OnDrawAdvanced(ATL_DRAWINFO
& di
);
171 HRESULT
OnDraw(ATL_DRAWINFO
& di
);
173 HRESULT
SetLayoutManagerProps();
174 HRESULT
CreateFrameOldWay( HWND hwnd
, int width
, int height
);
175 HRESULT
GetUnoStruct( OLECHAR
* sStructName
, CComPtr
<IDispatch
>& pdispResult
);
176 HRESULT
LoadURLToFrame();
177 HRESULT
CallDispatchMethod( OLECHAR
* sUrl
, CComVariant
* sArgNames
, CComVariant
* sArgVal
, unsigned int count
);
178 HRESULT
CallLoadComponentFromURL1PBool( OLECHAR
* sUrl
, OLECHAR
* sArgName
, BOOL sArgVal
);
179 HRESULT
GetUrlStruct( OLECHAR
* sUrl
, CComPtr
<IDispatch
>& pdispUrl
);
181 HRESULT
TerminateOffice();
182 HRESULT
GetURL( const OLECHAR
* url
,
183 const OLECHAR
* target
);
185 void CallbackCreateXInputStream( CBindStatusCallback
<CSOActiveX
>* pbsc
, BYTE
* pBytes
, DWORD dwSize
);
188 SOVersion
GetVersionConnected();
191 #endif //__SOACTIVEX_H_
193 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */