1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
7 * Copyright 2000, 2010 Oracle and/or its affiliates.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
29 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
31 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
32 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *************************************************************************/
36 // SOComWindowPeer.h: Definition of the SOComWindowPeer class
38 #ifndef INCLUDED_EXAMPLES_ACTIVEX_SOCOMWINDOWPEER_H
39 #define INCLUDED_EXAMPLES_ACTIVEX_SOCOMWINDOWPEER_H
47 #include "so_activex.h"
49 class SOComWindowPeer
:
50 public IDispatchImpl
<ISOComWindowPeer
, &IID_ISOComWindowPeer
, &LIBID_SO_ACTIVEXLib
>,
51 public ISupportErrorInfo
,
52 public CComObjectRoot
,
53 public CComCoClass
<SOComWindowPeer
,&CLSID_SOComWindowPeer
>
57 SOComWindowPeer() : m_hwnd( NULL
) {}
59 BEGIN_COM_MAP(SOComWindowPeer
)
60 COM_INTERFACE_ENTRY(IDispatch
)
61 COM_INTERFACE_ENTRY(ISOComWindowPeer
)
62 COM_INTERFACE_ENTRY(ISupportErrorInfo
)
64 DECLARE_NOT_AGGREGATABLE(SOComWindowPeer
)
65 // Remove the comment from the line above if you don't want your object to
66 // support aggregation.
68 DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER
)
71 STDMETHOD(InterfaceSupportsErrorInfo
)(REFIID riid
);
74 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getWindowHandle(
75 /* [in] */ SAFEARRAY __RPC_FAR
* procId
,
77 /* [retval][out] */ long __RPC_FAR
*ret
)
83 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getToolkit(
84 /* [retval][out] */ IDispatch __RPC_FAR
*__RPC_FAR
*retVal
)
90 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setPointer(
91 /* [in] */ IDispatch __RPC_FAR
*xPointer
)
96 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setBackground(
97 /* [in] */ int nColor
)
102 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidate(
103 /* [in] */ short __MIDL_0015
)
108 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidateRect(
109 /* [in] */ IDispatch __RPC_FAR
*aRect
,
110 /* [in] */ short nFlags
)
115 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
dispose( void)
120 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
addEventListener(
121 /* [in] */ IDispatch __RPC_FAR
*xListener
)
126 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
removeEventListener(
127 /* [in] */ IDispatch __RPC_FAR
*xListener
)
132 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Bridge_implementedInterfaces(
133 /* [retval][out] */ SAFEARRAY __RPC_FAR
* __RPC_FAR
*pVal
)
135 *pVal
= SafeArrayCreateVector( VT_BSTR
, 0, 2 );
141 CComBSTR
aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
142 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
145 aInterface
= CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
146 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
151 void SetHWNDInternally( HWND hwnd
) { m_hwnd
= hwnd
; }
154 #endif // INCLUDED_EXAMPLES_ACTIVEX_SOCOMWINDOWPEER_H
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */