fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccImage.cxx
blob55f0ec6d5b9816051e235df786ab4a7e482def25
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #include "stdafx.h"
21 #include "UAccCOM.h"
22 #include "AccImage.h"
24 #include <vcl/svapp.hxx>
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
29 using namespace com::sun::star::accessibility;
30 using namespace com::sun::star::uno;
32 /**
33 * Get description.
34 * @param description Variant to get description.
35 * @return Result.
37 STDMETHODIMP CAccImage::get_description(BSTR * description)
39 SolarMutexGuard g;
41 ENTER_PROTECTED_BLOCK
43 // #CHECK#
44 if (description == NULL)
45 return E_INVALIDARG;
46 if( !pRXImg.is() )
47 return E_FAIL;
49 ::rtl::OUString ouStr = GetXInterface()->getAccessibleImageDescription();
50 SAFE_SYSFREESTRING(*description);
51 *description = SysAllocString((OLECHAR*)ouStr.getStr());
53 return S_OK;
55 LEAVE_PROTECTED_BLOCK
58 STDMETHODIMP CAccImage::get_imagePosition(
59 /* [in] */ enum IA2CoordinateType,
60 /* [out] */ long __RPC_FAR *,
61 /* [retval][out] */ long __RPC_FAR *)
63 return E_NOTIMPL;
66 STDMETHODIMP CAccImage::get_imageSize(
67 /* [out] */ long __RPC_FAR *,
68 /* [retval][out] */ long __RPC_FAR *)
70 return E_NOTIMPL;
73 /**
74 * Put UNO interface.
75 * @param pXInterface UNO interface.
76 * @return Result.
78 STDMETHODIMP CAccImage::put_XInterface(hyper pXInterface)
80 // internal IUNOXWrapper - no mutex meeded
82 ENTER_PROTECTED_BLOCK
84 CUNOXWrapper::put_XInterface(pXInterface);
85 //special query.
86 if(pUNOInterface == NULL)
87 return E_FAIL;
89 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
90 if( !pRContext.is() )
92 return E_FAIL;
94 Reference<XAccessibleImage> pRXI(pRContext,UNO_QUERY);
95 if( !pRXI.is() )
96 pRXImg = NULL;
97 else
98 pRXImg = pRXI.get();
99 return S_OK;
101 LEAVE_PROTECTED_BLOCK
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */