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 INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOACTIVEX_H
23 #define INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOACTIVEX_H
34 #pragma clang diagnostic push
35 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
37 #include <so_activex.h>
39 #pragma clang diagnostic pop
42 class SODispatchInterceptor
;
57 class ATL_NO_VTABLE CSOActiveX
:
58 public CComObjectRootEx
<CComSingleThreadModel
>,
59 public IDispatchImpl
<ISOActiveX
, &IID_ISOActiveX
, &LIBID_SO_ACTIVEXLib
>,
60 public CComControl
<CSOActiveX
>,
61 public IPersistStreamInitImpl
<CSOActiveX
>,
62 public IOleControlImpl
<CSOActiveX
>,
63 public IOleObjectImpl
<CSOActiveX
>,
64 public IOleInPlaceActiveObjectImpl
<CSOActiveX
>,
65 public IViewObjectExImpl
<CSOActiveX
>,
66 public IOleInPlaceObjectWindowlessImpl
<CSOActiveX
>,
67 // public IConnectionPointContainerImpl<CSOActiveX>,
68 public CComCoClass
<CSOActiveX
, &CLSID_SOActiveX
>,
69 // public CProxy_ItryPluginEvents< CSOActiveX >,
70 public IPersistPropertyBagImpl
< CSOActiveX
>,
71 public IProvideClassInfo2Impl
< &CLSID_SOActiveX
,
72 &DIID__ISOActiveXEvents
,
73 &LIBID_SO_ACTIVEXLib
>,
74 public IObjectSafetyImpl
< CSOActiveX
,
75 INTERFACESAFE_FOR_UNTRUSTED_DATA
>
78 CComPtr
<IWebBrowser2
> mWebBrowser2
;
81 CComPtr
<IDispatch
> mpDispFactory
;
82 CComPtr
<IDispatch
> mpDispFrame
;
83 CComPtr
<IDispatch
> mpInstanceLocker
;
84 CComPtr
<IDispatch
> mpDispWin
;
85 OLECHAR
const * mCurFileUrl
;
92 SODispatchInterceptor
* mpDispatchInterceptor
;
95 BOOL mbReadyForActivation
;
96 CComPtr
<IDispatch
> mpDispTempFile
;
102 ~CSOActiveX() override
;
104 DECLARE_REGISTRY_RESOURCEID(IDR_SOACTIVEX
)
106 DECLARE_PROTECT_FINAL_CONSTRUCT()
108 BEGIN_COM_MAP(CSOActiveX
)
109 COM_INTERFACE_ENTRY(ISOActiveX
)
110 COM_INTERFACE_ENTRY(IDispatch
)
111 COM_INTERFACE_ENTRY(IViewObjectEx
)
112 COM_INTERFACE_ENTRY(IViewObject2
)
113 COM_INTERFACE_ENTRY(IViewObject
)
114 COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless
)
115 COM_INTERFACE_ENTRY(IOleInPlaceObject
)
116 COM_INTERFACE_ENTRY2(IOleWindow
, IOleInPlaceObjectWindowless
)
117 COM_INTERFACE_ENTRY(IOleInPlaceActiveObject
)
118 COM_INTERFACE_ENTRY(IOleControl
)
119 COM_INTERFACE_ENTRY(IOleObject
)
120 COM_INTERFACE_ENTRY(IPersistStreamInit
)
121 COM_INTERFACE_ENTRY2(IPersist
, IPersistStreamInit
)
122 // COM_INTERFACE_ENTRY(IConnectionPointContainer)
123 COM_INTERFACE_ENTRY(IProvideClassInfo
)
124 COM_INTERFACE_ENTRY(IProvideClassInfo2
)
125 COM_INTERFACE_ENTRY(IPersistPropertyBag
)
126 COM_INTERFACE_ENTRY(IObjectSafety
)
127 #if defined __clang__
128 #pragma clang diagnostic push
129 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
132 #if defined __clang__
133 #pragma clang diagnostic pop
136 #if defined __clang__
137 #pragma clang diagnostic push
138 #pragma clang diagnostic ignored "-Winvalid-offsetof"
139 // offset of on non-standard-layout type '_PropMapClass' (aka 'CSOActiveX'),
140 // expanded from macro 'PROP_DATA_ENTRY'
142 BEGIN_PROP_MAP(CSOActiveX
)
143 PROP_DATA_ENTRY("_cx", m_sizeExtent
.cx
, VT_UI4
)
144 PROP_DATA_ENTRY("_cy", m_sizeExtent
.cy
, VT_UI4
)
146 // PROP_ENTRY("Property Description", dispid, clsid)
147 // PROP_PAGE(CLSID_StockColorPage)
149 #if defined __clang__
150 #pragma clang diagnostic pop
153 BEGIN_CONNECTION_POINT_MAP(CSOActiveX
)
154 END_CONNECTION_POINT_MAP()
156 #if defined __clang__
157 #pragma clang diagnostic push
158 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
160 BEGIN_MSG_MAP(CSOActiveX
)
161 #if defined __clang__
162 #pragma clang diagnostic pop
164 CHAIN_MSG_MAP(CComControl
<CSOActiveX
>)
165 DEFAULT_REFLECTION_HANDLER()
167 // Handler prototypes:
168 // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
169 // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
170 // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
175 static DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND
| VIEWSTATUS_OPAQUE
)
180 STDMETHOD(SetClientSite
)( IOleClientSite
* aClientSite
) override
;
181 STDMETHOD(Invoke
)( DISPID dispidMember
,
185 DISPPARAMS
* pDispParams
,
187 EXCEPINFO
* pExcepInfo
,
188 UINT
* puArgErr
) override
;
189 STDMETHOD(Load
) ( LPPROPERTYBAG pPropBag
, LPERRORLOG pErrorLog
) override
;
190 STDMETHOD(Load
) ( LPSTREAM pStm
) override
;
191 STDMETHOD(InitNew
) () override
;
192 HRESULT
OnDrawAdvanced(ATL_DRAWINFO
& di
) override
;
193 HRESULT
OnDraw(ATL_DRAWINFO
& di
) override
;
195 HRESULT
SetLayoutManagerProps();
196 HRESULT
CreateFrameOldWay( HWND hwnd
, int width
, int height
);
197 HRESULT
GetUnoStruct( OLECHAR
const * sStructName
, CComPtr
<IDispatch
>& pdispResult
);
198 HRESULT
LoadURLToFrame();
199 HRESULT
CallDispatchMethod( OLECHAR
const * sUrl
, CComVariant
* sArgNames
, CComVariant
* sArgVal
, unsigned int count
);
200 HRESULT
CallLoadComponentFromURL1PBool( OLECHAR
const * sUrl
, OLECHAR
const * sArgName
, BOOL sArgVal
);
201 HRESULT
GetUrlStruct( OLECHAR
const * sUrl
, CComPtr
<IDispatch
>& pdispUrl
);
203 HRESULT
TerminateOffice();
204 HRESULT
GetURL( const OLECHAR
* url
,
205 const OLECHAR
* target
);
207 void CallbackCreateXInputStream( CBindStatusCallback
<CSOActiveX
>* pbsc
, BYTE
* pBytes
, DWORD dwSize
);
210 SOVersion
GetVersionConnected();
215 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */