1*3a700b0aSSteve Yin /************************************************************** 25fdc4257SSteve Yin * 3*3a700b0aSSteve Yin * Licensed to the Apache Software Foundation (ASF) under one 4*3a700b0aSSteve Yin * or more contributor license agreements. See the NOTICE file 5*3a700b0aSSteve Yin * distributed with this work for additional information 6*3a700b0aSSteve Yin * regarding copyright ownership. The ASF licenses this file 7*3a700b0aSSteve Yin * to you under the Apache License, Version 2.0 (the 8*3a700b0aSSteve Yin * "License"); you may not use this file except in compliance 9*3a700b0aSSteve Yin * with the License. You may obtain a copy of the License at 105fdc4257SSteve Yin * 11*3a700b0aSSteve Yin * http://www.apache.org/licenses/LICENSE-2.0 125fdc4257SSteve Yin * 13*3a700b0aSSteve Yin * Unless required by applicable law or agreed to in writing, 14*3a700b0aSSteve Yin * software distributed under the License is distributed on an 15*3a700b0aSSteve Yin * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3a700b0aSSteve Yin * KIND, either express or implied. See the License for the 17*3a700b0aSSteve Yin * specific language governing permissions and limitations 18*3a700b0aSSteve Yin * under the License. 195fdc4257SSteve Yin * 20*3a700b0aSSteve Yin *************************************************************/ 215fdc4257SSteve Yin 225fdc4257SSteve Yin #include "stdafx.h" 235fdc4257SSteve Yin #include "UAccCOM2.h" 245fdc4257SSteve Yin #include "AccImage.h" 255fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessible.hpp> 265fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleContext.hpp> 275fdc4257SSteve Yin 285fdc4257SSteve Yin using namespace com::sun::star::accessibility; 295fdc4257SSteve Yin using namespace com::sun::star::uno; 305fdc4257SSteve Yin 315fdc4257SSteve Yin /** 325fdc4257SSteve Yin * Get description. 335fdc4257SSteve Yin * @param description Variant to get description. 345fdc4257SSteve Yin * @return Result. 355fdc4257SSteve Yin */ 365fdc4257SSteve Yin STDMETHODIMP CAccImage::get_description(BSTR * description) 375fdc4257SSteve Yin { 385fdc4257SSteve Yin 395fdc4257SSteve Yin CHECK_ENABLE_INF 405fdc4257SSteve Yin 415fdc4257SSteve Yin ENTER_PROTECTED_BLOCK 425fdc4257SSteve Yin 435fdc4257SSteve Yin // #CHECK# 445fdc4257SSteve Yin if (description == NULL) 455fdc4257SSteve Yin return E_INVALIDARG; 465fdc4257SSteve Yin if( !pRXImg.is() ) 475fdc4257SSteve Yin return E_FAIL; 485fdc4257SSteve Yin 495fdc4257SSteve Yin ::rtl::OUString ouStr = GetXInterface()->getAccessibleImageDescription(); 505fdc4257SSteve Yin SAFE_SYSFREESTRING(*description); 515fdc4257SSteve Yin *description = SysAllocString((OLECHAR*)ouStr.getStr()); 525fdc4257SSteve Yin 535fdc4257SSteve Yin return S_OK; 545fdc4257SSteve Yin 555fdc4257SSteve Yin LEAVE_PROTECTED_BLOCK 565fdc4257SSteve Yin } 575fdc4257SSteve Yin 585fdc4257SSteve Yin STDMETHODIMP CAccImage::get_imagePosition( 595fdc4257SSteve Yin /* [in] */ enum IA2CoordinateType, 605fdc4257SSteve Yin /* [out] */ long __RPC_FAR *, 615fdc4257SSteve Yin /* [retval][out] */ long __RPC_FAR *) 625fdc4257SSteve Yin { 635fdc4257SSteve Yin return E_NOTIMPL; 645fdc4257SSteve Yin } 655fdc4257SSteve Yin 665fdc4257SSteve Yin STDMETHODIMP CAccImage::get_imageSize( 675fdc4257SSteve Yin /* [out] */ long __RPC_FAR *, 685fdc4257SSteve Yin /* [retval][out] */ long __RPC_FAR *) 695fdc4257SSteve Yin { 705fdc4257SSteve Yin return E_NOTIMPL; 715fdc4257SSteve Yin } 725fdc4257SSteve Yin 735fdc4257SSteve Yin /** 745fdc4257SSteve Yin * Put UNO interface. 755fdc4257SSteve Yin * @param pXInterface UNO interface. 765fdc4257SSteve Yin * @return Result. 775fdc4257SSteve Yin */ 785fdc4257SSteve Yin STDMETHODIMP CAccImage::put_XInterface(long pXInterface) 795fdc4257SSteve Yin { 805fdc4257SSteve Yin 815fdc4257SSteve Yin 825fdc4257SSteve Yin ENTER_PROTECTED_BLOCK 835fdc4257SSteve Yin 845fdc4257SSteve Yin CUNOXWrapper::put_XInterface(pXInterface); 855fdc4257SSteve Yin //special query. 865fdc4257SSteve Yin if(pUNOInterface == NULL) 875fdc4257SSteve Yin return E_FAIL; 885fdc4257SSteve Yin 895fdc4257SSteve Yin Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext(); 905fdc4257SSteve Yin if( !pRContext.is() ) 915fdc4257SSteve Yin { 925fdc4257SSteve Yin return E_FAIL; 935fdc4257SSteve Yin } 945fdc4257SSteve Yin Reference<XAccessibleImage> pRXI(pRContext,UNO_QUERY); 955fdc4257SSteve Yin if( !pRXI.is() ) 965fdc4257SSteve Yin pRXImg = NULL; 975fdc4257SSteve Yin else 985fdc4257SSteve Yin pRXImg = pRXI.get(); 995fdc4257SSteve Yin return S_OK; 1005fdc4257SSteve Yin 1015fdc4257SSteve Yin LEAVE_PROTECTED_BLOCK 1025fdc4257SSteve Yin } 103