update dev300-m58
[ooovba.git] / extensions / source / activex / main / SOComWindowPeer.h
blob27c6f4037baad703460c6ead2da7b38341d75deb
1 // SOComWindowPeer.h: Definition of the SOComWindowPeer class
2 //
3 //////////////////////////////////////////////////////////////////////
5 #if !defined __SOCOMWINDOWPEER_H_
6 #define __SOCOMWINDOWPEER_H_
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
12 #include "resource.h" // main symbols
13 #include <ExDispID.h>
14 #include <ExDisp.h>
15 #include <shlguid.h>
17 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
18 #undef _DEBUG
19 #endif
20 #include <atlctl.h>
22 #include "so_activex.h"
24 /////////////////////////////////////////////////////////////////////////////
25 // SOComWindowPeer
27 class SOComWindowPeer :
28 public IDispatchImpl<ISOComWindowPeer, &IID_ISOComWindowPeer, &LIBID_SO_ACTIVEXLib>,
29 public ISupportErrorInfo,
30 public CComObjectRoot,
31 public CComCoClass<SOComWindowPeer,&CLSID_SOComWindowPeer>
33 HWND m_hwnd;
34 public:
35 SOComWindowPeer() : m_hwnd( NULL ) {}
36 virtual ~SOComWindowPeer() { }
38 BEGIN_COM_MAP(SOComWindowPeer)
39 COM_INTERFACE_ENTRY(IDispatch)
40 COM_INTERFACE_ENTRY(ISOComWindowPeer)
41 COM_INTERFACE_ENTRY(ISupportErrorInfo)
42 END_COM_MAP()
43 DECLARE_NOT_AGGREGATABLE(SOComWindowPeer)
44 // Remove the comment from the line above if you don't want your object to
45 // support aggregation.
47 DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
49 // ISupportsErrorInfo
50 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
52 // ISOComWindowPeer
53 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getWindowHandle(
54 /* [in] */ SAFEARRAY __RPC_FAR * /*procId*/,
55 /* [in] */ short /*s*/,
56 /* [retval][out] */ long __RPC_FAR *ret)
58 *ret = (long) m_hwnd;
59 return S_OK;
62 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getToolkit(
63 /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *retVal)
65 *retVal = NULL;
66 return S_OK;
69 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setPointer(
70 /* [in] */ IDispatch __RPC_FAR* /*xPointer*/)
72 return S_OK;
75 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setBackground(
76 /* [in] */ int /*nColor*/)
78 return S_OK;
81 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidate(
82 /* [in] */ short /*__MIDL_0015*/)
84 return S_OK;
87 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidateRect(
88 /* [in] */ IDispatch __RPC_FAR* /*aRect*/,
89 /* [in] */ short /*nFlags*/)
91 return S_OK;
94 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE dispose( void)
96 return S_OK;
99 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addEventListener(
100 /* [in] */ IDispatch __RPC_FAR* /*xListener*/)
102 return S_OK;
105 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeEventListener(
106 /* [in] */ IDispatch __RPC_FAR* /*xListener*/)
108 return S_OK;
111 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
112 /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
114 *pVal = SafeArrayCreateVector( VT_BSTR, 0, 2 );
116 if( !*pVal )
117 return E_FAIL;
119 long ix = 0;
120 CComBSTR aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
121 SafeArrayPutElement( *pVal, &ix, aInterface );
123 ix = 1;
124 aInterface = CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
125 SafeArrayPutElement( *pVal, &ix, aInterface );
127 return S_OK;
130 void SetHWNDInternally( HWND hwnd ) { m_hwnd = hwnd; }
133 #endif // __SOCOMWINDOWPEER_H_