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
27 #pragma warning (push,1)
28 #pragma warning (disable:4265)
37 #pragma clang diagnostic push
38 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
40 #include "so_activex.h"
42 #pragma clang diagnostic pop
47 class SODispatchInterceptor
;
62 class ATL_NO_VTABLE CSOActiveX
:
63 public CComObjectRootEx
<CComSingleThreadModel
>,
64 public IDispatchImpl
<ISOActiveX
, &IID_ISOActiveX
, &LIBID_SO_ACTIVEXLib
>,
65 public CComControl
<CSOActiveX
>,
66 public IPersistStreamInitImpl
<CSOActiveX
>,
67 public IOleControlImpl
<CSOActiveX
>,
68 public IOleObjectImpl
<CSOActiveX
>,
69 public IOleInPlaceActiveObjectImpl
<CSOActiveX
>,
70 public IViewObjectExImpl
<CSOActiveX
>,
71 public IOleInPlaceObjectWindowlessImpl
<CSOActiveX
>,
72 // public IConnectionPointContainerImpl<CSOActiveX>,
73 public CComCoClass
<CSOActiveX
, &CLSID_SOActiveX
>,
74 // public CProxy_ItryPluginEvents< CSOActiveX >,
75 public IPersistPropertyBagImpl
< CSOActiveX
>,
76 public IProvideClassInfo2Impl
< &CLSID_SOActiveX
,
77 &DIID__ISOActiveXEvents
,
78 &LIBID_SO_ACTIVEXLib
>,
79 public IObjectSafetyImpl
< CSOActiveX
,
80 INTERFACESAFE_FOR_UNTRUSTED_DATA
>
83 CComPtr
<IWebBrowser2
> mWebBrowser2
;
86 CComPtr
<IDispatch
> mpDispFactory
;
87 CComPtr
<IDispatch
> mpDispFrame
;
88 CComPtr
<IDispatch
> mpInstanceLocker
;
89 CComPtr
<IDispatch
> mpDispWin
;
90 OLECHAR
const * mCurFileUrl
;
97 SODispatchInterceptor
* mpDispatchInterceptor
;
100 BOOL mbReadyForActivation
;
101 CComPtr
<IDispatch
> mpDispTempFile
;
107 ~CSOActiveX() override
;
109 DECLARE_REGISTRY_RESOURCEID(IDR_SOACTIVEX
)
111 DECLARE_PROTECT_FINAL_CONSTRUCT()
113 BEGIN_COM_MAP(CSOActiveX
)
114 COM_INTERFACE_ENTRY(ISOActiveX
)
115 COM_INTERFACE_ENTRY(IDispatch
)
116 COM_INTERFACE_ENTRY(IViewObjectEx
)
117 COM_INTERFACE_ENTRY(IViewObject2
)
118 COM_INTERFACE_ENTRY(IViewObject
)
119 COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless
)
120 COM_INTERFACE_ENTRY(IOleInPlaceObject
)
121 COM_INTERFACE_ENTRY2(IOleWindow
, IOleInPlaceObjectWindowless
)
122 COM_INTERFACE_ENTRY(IOleInPlaceActiveObject
)
123 COM_INTERFACE_ENTRY(IOleControl
)
124 COM_INTERFACE_ENTRY(IOleObject
)
125 COM_INTERFACE_ENTRY(IPersistStreamInit
)
126 COM_INTERFACE_ENTRY2(IPersist
, IPersistStreamInit
)
127 // COM_INTERFACE_ENTRY(IConnectionPointContainer)
128 COM_INTERFACE_ENTRY(IProvideClassInfo
)
129 COM_INTERFACE_ENTRY(IProvideClassInfo2
)
130 COM_INTERFACE_ENTRY(IPersistPropertyBag
)
131 COM_INTERFACE_ENTRY(IObjectSafety
)
132 #if defined __clang__
133 #pragma clang diagnostic push
134 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
137 #if defined __clang__
138 #pragma clang diagnostic pop
141 #if defined __clang__
142 #pragma clang diagnostic push
143 #pragma clang diagnostic ignored "-Winvalid-offsetof"
144 // offset of on non-standard-layout type '_PropMapClass' (aka 'CSOActiveX'),
145 // expanded from macro 'PROP_DATA_ENTRY'
147 BEGIN_PROP_MAP(CSOActiveX
)
148 PROP_DATA_ENTRY("_cx", m_sizeExtent
.cx
, VT_UI4
)
149 PROP_DATA_ENTRY("_cy", m_sizeExtent
.cy
, VT_UI4
)
151 // PROP_ENTRY("Property Description", dispid, clsid)
152 // PROP_PAGE(CLSID_StockColorPage)
154 #if defined __clang__
155 #pragma clang diagnostic pop
158 BEGIN_CONNECTION_POINT_MAP(CSOActiveX
)
159 END_CONNECTION_POINT_MAP()
161 #if defined __clang__
162 #pragma clang diagnostic push
163 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
165 BEGIN_MSG_MAP(CSOActiveX
)
166 #if defined __clang__
167 #pragma clang diagnostic pop
169 CHAIN_MSG_MAP(CComControl
<CSOActiveX
>)
170 DEFAULT_REFLECTION_HANDLER()
172 // Handler prototypes:
173 // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
174 // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
175 // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
180 static DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND
| VIEWSTATUS_OPAQUE
)
185 STDMETHOD(SetClientSite
)( IOleClientSite
* aClientSite
) override
;
186 STDMETHOD(Invoke
)( DISPID dispidMember
,
190 DISPPARAMS
* pDispParams
,
192 EXCEPINFO
* pExcepInfo
,
193 UINT
* puArgErr
) override
;
194 STDMETHOD(Load
) ( LPPROPERTYBAG pPropBag
, LPERRORLOG pErrorLog
) override
;
195 STDMETHOD(Load
) ( LPSTREAM pStm
) override
;
196 STDMETHOD(InitNew
) () override
;
197 HRESULT
OnDrawAdvanced(ATL_DRAWINFO
& di
) override
;
198 HRESULT
OnDraw(ATL_DRAWINFO
& di
) override
;
200 HRESULT
SetLayoutManagerProps();
201 HRESULT
CreateFrameOldWay( HWND hwnd
, int width
, int height
);
202 HRESULT
GetUnoStruct( OLECHAR
const * sStructName
, CComPtr
<IDispatch
>& pdispResult
);
203 HRESULT
LoadURLToFrame();
204 HRESULT
CallDispatchMethod( OLECHAR
const * sUrl
, CComVariant
* sArgNames
, CComVariant
* sArgVal
, unsigned int count
);
205 HRESULT
CallLoadComponentFromURL1PBool( OLECHAR
* sUrl
, OLECHAR
* sArgName
, BOOL sArgVal
);
206 HRESULT
GetUrlStruct( OLECHAR
const * sUrl
, CComPtr
<IDispatch
>& pdispUrl
);
208 HRESULT
TerminateOffice();
209 HRESULT
GetURL( const OLECHAR
* url
,
210 const OLECHAR
* target
);
212 void CallbackCreateXInputStream( CBindStatusCallback
<CSOActiveX
>* pbsc
, BYTE
* pBytes
, DWORD dwSize
);
215 SOVersion
GetVersionConnected();
220 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */