1 /*************************************************************************
3 * $RCSfile: SOComWindowPeer.h,v $
7 * last change: $Author: hr $ $Date: 2003-06-30 15:50:08 $
9 * The Contents of this file are made available subject to the terms of
12 * Copyright (c) 2003 by Sun Microsystems, Inc.
13 * All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
34 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
36 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *************************************************************************/
41 // SOComWindowPeer.h: Definition of the SOComWindowPeer class
43 //////////////////////////////////////////////////////////////////////
45 #if !defined __SOCOMWINDOWPEER_H_
46 #define __SOCOMWINDOWPEER_H_
50 #endif // _MSC_VER > 1000
52 #include "resource.h" // main symbols
58 #include "so_activex.h"
60 /////////////////////////////////////////////////////////////////////////////
63 class SOComWindowPeer
:
64 public IDispatchImpl
<ISOComWindowPeer
, &IID_ISOComWindowPeer
, &LIBID_SO_ACTIVEXLib
>,
65 public ISupportErrorInfo
,
66 public CComObjectRoot
,
67 public CComCoClass
<SOComWindowPeer
,&CLSID_SOComWindowPeer
>
71 SOComWindowPeer() : m_hwnd( NULL
) {}
73 BEGIN_COM_MAP(SOComWindowPeer
)
74 COM_INTERFACE_ENTRY(IDispatch
)
75 COM_INTERFACE_ENTRY(ISOComWindowPeer
)
76 COM_INTERFACE_ENTRY(ISupportErrorInfo
)
78 DECLARE_NOT_AGGREGATABLE(SOComWindowPeer
)
79 // Remove the comment from the line above if you don't want your object to
80 // support aggregation.
82 DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER
)
85 STDMETHOD(InterfaceSupportsErrorInfo
)(REFIID riid
);
88 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getWindowHandle(
89 /* [in] */ SAFEARRAY __RPC_FAR
* procId
,
91 /* [retval][out] */ long __RPC_FAR
*ret
)
97 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getToolkit(
98 /* [retval][out] */ IDispatch __RPC_FAR
*__RPC_FAR
*retVal
)
104 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setPointer(
105 /* [in] */ IDispatch __RPC_FAR
*xPointer
)
110 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setBackground(
111 /* [in] */ int nColor
)
116 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidate(
117 /* [in] */ short __MIDL_0015
)
122 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidateRect(
123 /* [in] */ IDispatch __RPC_FAR
*aRect
,
124 /* [in] */ short nFlags
)
129 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
dispose( void)
134 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
addEventListener(
135 /* [in] */ IDispatch __RPC_FAR
*xListener
)
140 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
removeEventListener(
141 /* [in] */ IDispatch __RPC_FAR
*xListener
)
146 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Bridge_implementedInterfaces(
147 /* [retval][out] */ SAFEARRAY __RPC_FAR
* __RPC_FAR
*pVal
)
149 *pVal
= SafeArrayCreateVector( VT_BSTR
, 0, 2 );
155 CComBSTR
aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
156 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
159 aInterface
= CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
160 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
165 void SetHWNDInternally( HWND hwnd
) { m_hwnd
= hwnd
; }
168 #endif // __SOCOMWINDOWPEER_H_