1*5fdc4257SSteve Yin /*************************************************************************
2*5fdc4257SSteve Yin  *
3*5fdc4257SSteve Yin  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*5fdc4257SSteve Yin  *
5*5fdc4257SSteve Yin  * Copyright IBM Corporation 2010.
6*5fdc4257SSteve Yin  * Copyright 2000, 2010 Oracle and/or its affiliates.
7*5fdc4257SSteve Yin  *
8*5fdc4257SSteve Yin  * OpenOffice.org - a multi-platform office productivity suite
9*5fdc4257SSteve Yin  *
10*5fdc4257SSteve Yin  * This file is part of OpenOffice.org.
11*5fdc4257SSteve Yin  *
12*5fdc4257SSteve Yin  * OpenOffice.org is free software: you can redistribute it and/or modify
13*5fdc4257SSteve Yin  * it under the terms of the GNU Lesser General Public License version 3
14*5fdc4257SSteve Yin  * only, as published by the Free Software Foundation.
15*5fdc4257SSteve Yin  *
16*5fdc4257SSteve Yin  * OpenOffice.org is distributed in the hope that it will be useful,
17*5fdc4257SSteve Yin  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18*5fdc4257SSteve Yin  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19*5fdc4257SSteve Yin  * GNU Lesser General Public License version 3 for more details
20*5fdc4257SSteve Yin  * (a copy is included in the LICENSE file that accompanied this code).
21*5fdc4257SSteve Yin  *
22*5fdc4257SSteve Yin  * You should have received a copy of the GNU Lesser General Public License
23*5fdc4257SSteve Yin  * version 3 along with OpenOffice.org.  If not, see
24*5fdc4257SSteve Yin  * <http://www.openoffice.org/license.html>
25*5fdc4257SSteve Yin  * for a copy of the LGPLv3 License.
26*5fdc4257SSteve Yin  *
27*5fdc4257SSteve Yin  ************************************************************************/
28*5fdc4257SSteve Yin 
29*5fdc4257SSteve Yin #if !defined(AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_)
30*5fdc4257SSteve Yin #define AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_
31*5fdc4257SSteve Yin 
32*5fdc4257SSteve Yin #if _MSC_VER > 1000
33*5fdc4257SSteve Yin #pragma once
34*5fdc4257SSteve Yin #endif // _MSC_VER > 1000
35*5fdc4257SSteve Yin 
36*5fdc4257SSteve Yin #include "resource.h"        // main symbols
37*5fdc4257SSteve Yin 
38*5fdc4257SSteve Yin 
39*5fdc4257SSteve Yin #include <com/sun/star/uno/reference.hxx>
40*5fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleImage.hpp>
41*5fdc4257SSteve Yin #include "UNOXWrapper.h"
42*5fdc4257SSteve Yin 
43*5fdc4257SSteve Yin /**
44*5fdc4257SSteve Yin  * CAccImage implements IAccessibleImage interface.
45*5fdc4257SSteve Yin  */
46*5fdc4257SSteve Yin class ATL_NO_VTABLE CAccImage :
47*5fdc4257SSteve Yin             public CComObjectRoot,
48*5fdc4257SSteve Yin             public CComCoClass<CAccImage,&CLSID_AccImage>,
49*5fdc4257SSteve Yin             public IAccessibleImage,
50*5fdc4257SSteve Yin             public CUNOXWrapper
51*5fdc4257SSteve Yin {
52*5fdc4257SSteve Yin public:
53*5fdc4257SSteve Yin     CAccImage()
54*5fdc4257SSteve Yin     {
55*5fdc4257SSteve Yin             }
56*5fdc4257SSteve Yin     virtual ~CAccImage()
57*5fdc4257SSteve Yin     {
58*5fdc4257SSteve Yin             }
59*5fdc4257SSteve Yin     BEGIN_COM_MAP(CAccImage)
60*5fdc4257SSteve Yin     COM_INTERFACE_ENTRY(IAccessibleImage)
61*5fdc4257SSteve Yin     COM_INTERFACE_ENTRY(IUNOXWrapper)
62*5fdc4257SSteve Yin     COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
63*5fdc4257SSteve Yin     END_COM_MAP()
64*5fdc4257SSteve Yin 
65*5fdc4257SSteve Yin     static HRESULT WINAPI _SmartQI(void* pv,
66*5fdc4257SSteve Yin                                    REFIID iid, void** ppvObject, DWORD)
67*5fdc4257SSteve Yin     {
68*5fdc4257SSteve Yin         return ((CAccImage*)pv)->SmartQI(iid,ppvObject);
69*5fdc4257SSteve Yin     }
70*5fdc4257SSteve Yin 
71*5fdc4257SSteve Yin     HRESULT SmartQI(REFIID iid, void** ppvObject)
72*5fdc4257SSteve Yin     {
73*5fdc4257SSteve Yin         if( m_pOuterUnknown )
74*5fdc4257SSteve Yin             return OuterQueryInterface(iid,ppvObject);
75*5fdc4257SSteve Yin         return E_FAIL;
76*5fdc4257SSteve Yin     }
77*5fdc4257SSteve Yin 
78*5fdc4257SSteve Yin     DECLARE_REGISTRY_RESOURCEID(IDR_AccImage)
79*5fdc4257SSteve Yin 
80*5fdc4257SSteve Yin     // IAccessibleImage
81*5fdc4257SSteve Yin public:
82*5fdc4257SSteve Yin     // IAccessibleImage
83*5fdc4257SSteve Yin 
84*5fdc4257SSteve Yin     // Gets the description of the image.
85*5fdc4257SSteve Yin     STDMETHOD(get_description)(BSTR * description);
86*5fdc4257SSteve Yin 
87*5fdc4257SSteve Yin     STDMETHOD(get_imagePosition)( enum IA2CoordinateType coordinateType,
88*5fdc4257SSteve Yin                                   long __RPC_FAR *x,
89*5fdc4257SSteve Yin                                   long __RPC_FAR *y);
90*5fdc4257SSteve Yin 
91*5fdc4257SSteve Yin     STDMETHOD(get_imageSize)(
92*5fdc4257SSteve Yin         long __RPC_FAR *height,
93*5fdc4257SSteve Yin         long __RPC_FAR *width);
94*5fdc4257SSteve Yin 
95*5fdc4257SSteve Yin     // Overide of IUNOXWrapper.
96*5fdc4257SSteve Yin     STDMETHOD(put_XInterface)(long pXInterface);
97*5fdc4257SSteve Yin 
98*5fdc4257SSteve Yin private:
99*5fdc4257SSteve Yin 
100*5fdc4257SSteve Yin     com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleImage> pRXImg;
101*5fdc4257SSteve Yin 
102*5fdc4257SSteve Yin     inline com::sun::star::accessibility::XAccessibleImage* GetXInterface()
103*5fdc4257SSteve Yin     {
104*5fdc4257SSteve Yin         return pRXImg.get();
105*5fdc4257SSteve Yin     }
106*5fdc4257SSteve Yin };
107*5fdc4257SSteve Yin 
108*5fdc4257SSteve Yin #endif // !defined(AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_)
109