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_
27 #pragma warning (push,1)
28 #pragma warning (disable:4265)
36 #include "so_activex.h"
40 class SODispatchInterceptor
;
55 class ATL_NO_VTABLE CSOActiveX
:
56 public CComObjectRootEx
<CComSingleThreadModel
>,
57 public IDispatchImpl
<ISOActiveX
, &IID_ISOActiveX
, &LIBID_SO_ACTIVEXLib
>,
58 public CComControl
<CSOActiveX
>,
59 public IPersistStreamInitImpl
<CSOActiveX
>,
60 public IOleControlImpl
<CSOActiveX
>,
61 public IOleObjectImpl
<CSOActiveX
>,
62 public IOleInPlaceActiveObjectImpl
<CSOActiveX
>,
63 public IViewObjectExImpl
<CSOActiveX
>,
64 public IOleInPlaceObjectWindowlessImpl
<CSOActiveX
>,
65 // public IConnectionPointContainerImpl<CSOActiveX>,
66 public CComCoClass
<CSOActiveX
, &CLSID_SOActiveX
>,
67 // public CProxy_ItryPluginEvents< CSOActiveX >,
68 public IPersistPropertyBagImpl
< CSOActiveX
>,
69 public IProvideClassInfo2Impl
< &CLSID_SOActiveX
,
70 &DIID__ISOActiveXEvents
,
71 &LIBID_SO_ACTIVEXLib
>,
72 public IObjectSafetyImpl
< CSOActiveX
,
73 INTERFACESAFE_FOR_UNTRUSTED_DATA
>
76 CComPtr
<IWebBrowser2
> mWebBrowser2
;
79 CComPtr
<IDispatch
> mpDispFactory
;
80 CComPtr
<IDispatch
> mpDispFrame
;
81 CComPtr
<IDispatch
> mpInstanceLocker
;
82 CComPtr
<IDispatch
> mpDispWin
;
90 SODispatchInterceptor
* mpDispatchInterceptor
;
93 BOOL mbReadyForActivation
;
94 CComPtr
<IDispatch
> mpDispTempFile
;
102 DECLARE_REGISTRY_RESOURCEID(IDR_SOACTIVEX
)
104 DECLARE_PROTECT_FINAL_CONSTRUCT()
106 BEGIN_COM_MAP(CSOActiveX
)
107 COM_INTERFACE_ENTRY(ISOActiveX
)
108 COM_INTERFACE_ENTRY(IDispatch
)
109 COM_INTERFACE_ENTRY(IViewObjectEx
)
110 COM_INTERFACE_ENTRY(IViewObject2
)
111 COM_INTERFACE_ENTRY(IViewObject
)
112 COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless
)
113 COM_INTERFACE_ENTRY(IOleInPlaceObject
)
114 COM_INTERFACE_ENTRY2(IOleWindow
, IOleInPlaceObjectWindowless
)
115 COM_INTERFACE_ENTRY(IOleInPlaceActiveObject
)
116 COM_INTERFACE_ENTRY(IOleControl
)
117 COM_INTERFACE_ENTRY(IOleObject
)
118 COM_INTERFACE_ENTRY(IPersistStreamInit
)
119 COM_INTERFACE_ENTRY2(IPersist
, IPersistStreamInit
)
120 // COM_INTERFACE_ENTRY(IConnectionPointContainer)
121 COM_INTERFACE_ENTRY(IProvideClassInfo
)
122 COM_INTERFACE_ENTRY(IProvideClassInfo2
)
123 COM_INTERFACE_ENTRY(IPersistPropertyBag
)
124 COM_INTERFACE_ENTRY(IObjectSafety
)
127 BEGIN_PROP_MAP(CSOActiveX
)
128 PROP_DATA_ENTRY("_cx", m_sizeExtent
.cx
, VT_UI4
)
129 PROP_DATA_ENTRY("_cy", m_sizeExtent
.cy
, VT_UI4
)
131 // PROP_ENTRY("Property Description", dispid, clsid)
132 // PROP_PAGE(CLSID_StockColorPage)
135 BEGIN_CONNECTION_POINT_MAP(CSOActiveX
)
136 END_CONNECTION_POINT_MAP()
138 BEGIN_MSG_MAP(CSOActiveX
)
139 CHAIN_MSG_MAP(CComControl
<CSOActiveX
>)
140 DEFAULT_REFLECTION_HANDLER()
142 // Handler prototypes:
143 // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
144 // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
145 // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
150 DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND
| VIEWSTATUS_OPAQUE
)
155 STDMETHOD(SetClientSite
)( IOleClientSite
* aClientSite
);
156 STDMETHOD(Invoke
)( DISPID dispidMember
,
160 DISPPARAMS
* pDispParams
,
162 EXCEPINFO
* pExcepInfo
,
164 STDMETHOD(Load
) ( LPPROPERTYBAG pPropBag
, LPERRORLOG pErrorLog
);
165 STDMETHOD(Load
) ( LPSTREAM pStm
);
166 STDMETHOD(InitNew
) ();
167 HRESULT
OnDrawAdvanced(ATL_DRAWINFO
& di
);
168 HRESULT
OnDraw(ATL_DRAWINFO
& di
);
170 HRESULT
SetLayoutManagerProps();
171 HRESULT
CreateFrameOldWay( HWND hwnd
, int width
, int height
);
172 HRESULT
GetUnoStruct( OLECHAR
* sStructName
, CComPtr
<IDispatch
>& pdispResult
);
173 HRESULT
LoadURLToFrame();
174 HRESULT
CallDispatchMethod( OLECHAR
* sUrl
, CComVariant
* sArgNames
, CComVariant
* sArgVal
, unsigned int count
);
175 HRESULT
CallLoadComponentFromURL1PBool( OLECHAR
* sUrl
, OLECHAR
* sArgName
, BOOL sArgVal
);
176 HRESULT
GetUrlStruct( OLECHAR
* sUrl
, CComPtr
<IDispatch
>& pdispUrl
);
178 HRESULT
TerminateOffice();
179 HRESULT
GetURL( const OLECHAR
* url
,
180 const OLECHAR
* target
);
182 void CallbackCreateXInputStream( CBindStatusCallback
<CSOActiveX
>* pbsc
, BYTE
* pBytes
, DWORD dwSize
);
185 SOVersion
GetVersionConnected();
188 #endif //__SOACTIVEX_H_
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */