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
32 #include <so_activex.h>
34 class SODispatchInterceptor
;
49 class ATL_NO_VTABLE CSOActiveX
:
50 public CComObjectRootEx
<CComSingleThreadModel
>,
51 public IDispatchImpl
<ISOActiveX
, &IID_ISOActiveX
, &LIBID_SO_ACTIVEXLib
>,
52 public CComControl
<CSOActiveX
>,
53 public IPersistStreamInitImpl
<CSOActiveX
>,
54 public IOleControlImpl
<CSOActiveX
>,
55 public IOleObjectImpl
<CSOActiveX
>,
56 public IOleInPlaceActiveObjectImpl
<CSOActiveX
>,
57 public IViewObjectExImpl
<CSOActiveX
>,
58 public IOleInPlaceObjectWindowlessImpl
<CSOActiveX
>,
59 // public IConnectionPointContainerImpl<CSOActiveX>,
60 public CComCoClass
<CSOActiveX
, &CLSID_SOActiveX
>,
61 // public CProxy_ItryPluginEvents< CSOActiveX >,
62 public IPersistPropertyBagImpl
< CSOActiveX
>,
63 public IProvideClassInfo2Impl
< &CLSID_SOActiveX
,
64 &DIID__ISOActiveXEvents
,
65 &LIBID_SO_ACTIVEXLib
>,
66 public IObjectSafetyImpl
< CSOActiveX
,
67 INTERFACESAFE_FOR_UNTRUSTED_DATA
>
70 CComPtr
<IWebBrowser2
> mWebBrowser2
;
73 CComPtr
<IDispatch
> mpDispFactory
;
74 CComPtr
<IDispatch
> mpDispFrame
;
75 CComPtr
<IDispatch
> mpInstanceLocker
;
76 CComPtr
<IDispatch
> mpDispWin
;
84 SODispatchInterceptor
* mpDispatchInterceptor
;
87 BOOL mbReadyForActivation
;
88 CComPtr
<IDispatch
> mpDispTempFile
;
94 ~CSOActiveX() override
;
96 DECLARE_REGISTRY_RESOURCEID(IDR_SOACTIVEX
)
98 DECLARE_PROTECT_FINAL_CONSTRUCT()
100 BEGIN_COM_MAP(CSOActiveX
)
101 COM_INTERFACE_ENTRY(ISOActiveX
)
102 COM_INTERFACE_ENTRY(IDispatch
)
103 COM_INTERFACE_ENTRY(IViewObjectEx
)
104 COM_INTERFACE_ENTRY(IViewObject2
)
105 COM_INTERFACE_ENTRY(IViewObject
)
106 COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless
)
107 COM_INTERFACE_ENTRY(IOleInPlaceObject
)
108 COM_INTERFACE_ENTRY2(IOleWindow
, IOleInPlaceObjectWindowless
)
109 COM_INTERFACE_ENTRY(IOleInPlaceActiveObject
)
110 COM_INTERFACE_ENTRY(IOleControl
)
111 COM_INTERFACE_ENTRY(IOleObject
)
112 COM_INTERFACE_ENTRY(IPersistStreamInit
)
113 COM_INTERFACE_ENTRY2(IPersist
, IPersistStreamInit
)
114 // COM_INTERFACE_ENTRY(IConnectionPointContainer)
115 COM_INTERFACE_ENTRY(IProvideClassInfo
)
116 COM_INTERFACE_ENTRY(IProvideClassInfo2
)
117 COM_INTERFACE_ENTRY(IPersistPropertyBag
)
118 COM_INTERFACE_ENTRY(IObjectSafety
)
119 #if defined __clang__
120 #pragma clang diagnostic push
121 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
124 #if defined __clang__
125 #pragma clang diagnostic pop
128 #if defined __clang__
129 #pragma clang diagnostic push
130 #pragma clang diagnostic ignored "-Winvalid-offsetof"
131 // offset of on non-standard-layout type '_PropMapClass' (aka 'CSOActiveX'),
132 // expanded from macro 'PROP_DATA_ENTRY'
134 BEGIN_PROP_MAP(CSOActiveX
)
135 PROP_DATA_ENTRY("_cx", m_sizeExtent
.cx
, VT_UI4
)
136 PROP_DATA_ENTRY("_cy", m_sizeExtent
.cy
, VT_UI4
)
138 // PROP_ENTRY("Property Description", dispid, clsid)
139 // PROP_PAGE(CLSID_StockColorPage)
141 #if defined __clang__
142 #pragma clang diagnostic pop
145 BEGIN_CONNECTION_POINT_MAP(CSOActiveX
)
146 END_CONNECTION_POINT_MAP()
148 #if defined __clang__
149 #pragma clang diagnostic push
150 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
152 BEGIN_MSG_MAP(CSOActiveX
)
153 #if defined __clang__
154 #pragma clang diagnostic pop
156 CHAIN_MSG_MAP(CComControl
<CSOActiveX
>)
157 DEFAULT_REFLECTION_HANDLER()
159 // Handler prototypes:
160 // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
161 // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
162 // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
167 static DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND
| VIEWSTATUS_OPAQUE
)
172 STDMETHOD(SetClientSite
)( IOleClientSite
* aClientSite
) override
;
173 STDMETHOD(Invoke
)( DISPID dispidMember
,
177 DISPPARAMS
* pDispParams
,
179 EXCEPINFO
* pExcepInfo
,
180 UINT
* puArgErr
) override
;
181 STDMETHOD(Load
) ( LPPROPERTYBAG pPropBag
, LPERRORLOG pErrorLog
) override
;
182 STDMETHOD(Load
) ( LPSTREAM pStm
) override
;
183 STDMETHOD(InitNew
) () override
;
184 HRESULT
OnDrawAdvanced(ATL_DRAWINFO
& di
) override
;
185 HRESULT
OnDraw(ATL_DRAWINFO
& di
) override
;
187 HRESULT
SetLayoutManagerProps();
188 HRESULT
CreateFrameOldWay( HWND hwnd
, int width
, int height
);
189 HRESULT
GetUnoStruct( OLECHAR
const * sStructName
, CComPtr
<IDispatch
>& pdispResult
);
190 HRESULT
LoadURLToFrame();
191 HRESULT
CallDispatchMethod( OLECHAR
const * sUrl
, CComVariant
* sArgNames
, CComVariant
* sArgVal
, unsigned int count
);
192 HRESULT
CallLoadComponentFromURL1PBool( OLECHAR
const * sUrl
, OLECHAR
const * sArgName
, BOOL sArgVal
);
193 HRESULT
GetUrlStruct( OLECHAR
const * sUrl
, CComPtr
<IDispatch
>& pdispUrl
);
195 HRESULT
TerminateOffice();
196 HRESULT
GetURL( const OLECHAR
* url
,
197 const OLECHAR
* target
);
199 void CallbackCreateXInputStream( CBindStatusCallback
<CSOActiveX
>* pbsc
, BYTE
* pBytes
, DWORD dwSize
);
202 SOVersion
GetVersionConnected();
205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */