2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2002-04-05 11:08:57 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
2003-04-24 15:11:31 +00:00
|
|
|
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
2002-04-05 11:08:57 +00:00
|
|
|
#include <com/sun/star/uno/RuntimeException.hpp>
|
2011-06-01 22:40:08 +01:00
|
|
|
#include <comphelper/servicehelper.hxx>
|
2013-12-05 19:17:18 -02:00
|
|
|
#include <cppuhelper/supportsservice.hxx>
|
2002-04-05 11:08:57 +00:00
|
|
|
#include <flyfrm.hxx>
|
2013-11-29 13:03:27 +00:00
|
|
|
#include <fmturl.hxx>
|
2002-04-05 11:08:57 +00:00
|
|
|
#include "accgraphic.hxx"
|
|
|
|
|
2007-09-27 07:21:20 +00:00
|
|
|
using namespace ::com::sun::star;
|
2002-04-05 11:08:57 +00:00
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::uno;
|
2003-04-24 15:11:31 +00:00
|
|
|
using namespace ::com::sun::star::accessibility;
|
2002-04-05 11:08:57 +00:00
|
|
|
|
|
|
|
SwAccessibleGraphic::SwAccessibleGraphic(
|
2007-09-27 07:21:20 +00:00
|
|
|
SwAccessibleMap* pInitMap,
|
|
|
|
const SwFlyFrm* pFlyFrm ) :
|
|
|
|
SwAccessibleNoTextFrame( pInitMap, AccessibleRole::GRAPHIC, pFlyFrm )
|
2002-04-05 11:08:57 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SwAccessibleGraphic::~SwAccessibleGraphic()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SwAccessibleGraphic::getImplementationName()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw( RuntimeException, std::exception )
|
2002-04-05 11:08:57 +00:00
|
|
|
{
|
2013-12-05 19:17:18 -02:00
|
|
|
return OUString("com.sun.star.comp.Writer.SwAccessibleGraphic");
|
2002-04-05 11:08:57 +00:00
|
|
|
}
|
|
|
|
|
2013-12-05 19:17:18 -02:00
|
|
|
sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(const OUString& sTestServiceName)
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (uno::RuntimeException, std::exception)
|
2002-04-05 11:08:57 +00:00
|
|
|
{
|
2013-12-05 19:17:18 -02:00
|
|
|
return cppu::supportsService(this, sTestServiceName);
|
2002-04-05 11:08:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw( uno::RuntimeException, std::exception )
|
2002-04-05 11:08:57 +00:00
|
|
|
{
|
2002-07-09 11:51:33 +00:00
|
|
|
Sequence< OUString > aRet(2);
|
2002-04-05 11:08:57 +00:00
|
|
|
OUString* pArray = aRet.getArray();
|
2013-12-05 19:17:18 -02:00
|
|
|
pArray[0] = "com.sun.star.text.AccessibleTextGraphicObject";
|
2014-12-18 13:35:13 +01:00
|
|
|
pArray[1] = sAccessibleServiceName;
|
2002-04-05 11:08:57 +00:00
|
|
|
return aRet;
|
|
|
|
}
|
2002-08-15 09:25:23 +00:00
|
|
|
|
|
|
|
Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw(RuntimeException, std::exception)
|
2002-08-15 09:25:23 +00:00
|
|
|
{
|
2014-03-10 16:24:57 +01:00
|
|
|
return css::uno::Sequence<sal_Int8>();
|
2002-08-15 09:25:23 +00:00
|
|
|
}
|
2010-10-14 08:30:41 +02:00
|
|
|
|
2013-11-29 13:03:27 +00:00
|
|
|
// Return this object's role.
|
2015-04-14 12:44:47 +02:00
|
|
|
sal_Int16 SAL_CALL SwAccessibleGraphic::getAccessibleRole()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (::com::sun::star::uno::RuntimeException, std::exception)
|
2013-11-29 13:03:27 +00:00
|
|
|
{
|
2013-12-13 23:33:21 +01:00
|
|
|
SolarMutexGuard g;
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatURL aURL( static_cast<const SwLayoutFrm*>(GetFrm())->GetFormat()->GetURL() );
|
2013-11-29 13:03:27 +00:00
|
|
|
|
|
|
|
if (aURL.GetMap())
|
2014-11-10 12:52:41 +02:00
|
|
|
return AccessibleRole::IMAGE_MAP;
|
|
|
|
return AccessibleRole::GRAPHIC;
|
2013-11-29 13:03:27 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|