2010-10-12 15:51:52 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-27 16:10:40 +00: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-03-06 16:34:56 +00:00
|
|
|
|
|
|
|
#include "AccessiblePresentationGraphicShape.hxx"
|
|
|
|
|
|
|
|
#include "SdShapeTypes.hxx"
|
|
|
|
|
|
|
|
#include <svx/DescriptionGenerator.hxx>
|
2002-03-19 16:21:36 +00:00
|
|
|
#include <rtl/ustring.h>
|
2002-03-06 16:34:56 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
2003-04-24 16:03:54 +00:00
|
|
|
using namespace ::com::sun::star::accessibility;
|
2002-03-06 16:34:56 +00:00
|
|
|
|
|
|
|
namespace accessibility {
|
|
|
|
|
|
|
|
//===== internal ============================================================
|
|
|
|
|
|
|
|
AccessiblePresentationGraphicShape::AccessiblePresentationGraphicShape (
|
2002-05-06 08:46:54 +00:00
|
|
|
const AccessibleShapeInfo& rShapeInfo,
|
|
|
|
const AccessibleShapeTreeInfo& rShapeTreeInfo)
|
|
|
|
: AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo)
|
2002-03-06 16:34:56 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
AccessiblePresentationGraphicShape::~AccessiblePresentationGraphicShape()
|
2002-03-06 16:34:56 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-05-15 13:27:19 +02:00
|
|
|
// XServiceInfo
|
2002-03-06 16:34:56 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SAL_CALL
|
2015-04-14 12:44:47 +02:00
|
|
|
AccessiblePresentationGraphicShape::getImplementationName()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (::com::sun::star::uno::RuntimeException, std::exception)
|
2002-03-06 16:34:56 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
return OUString("AccessiblePresentationGraphicShape");
|
2002-03-06 16:34:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Set this object's name if is different to the current name.
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString
|
2015-04-14 12:44:47 +02:00
|
|
|
AccessiblePresentationGraphicShape::CreateAccessibleBaseName()
|
2002-03-06 16:34:56 +00:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sName;
|
2002-03-06 16:34:56 +00:00
|
|
|
|
2002-03-18 09:30:29 +00:00
|
|
|
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
|
2002-03-06 16:34:56 +00:00
|
|
|
switch (nShapeType)
|
|
|
|
{
|
|
|
|
case PRESENTATION_GRAPHIC_OBJECT:
|
2012-04-13 20:46:47 -03:00
|
|
|
sName = "ImpressGraphicObject";
|
2002-03-06 16:34:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
2012-04-13 20:46:47 -03:00
|
|
|
sName = "UnknownAccessibleImpressShape";
|
2002-03-06 16:34:56 +00:00
|
|
|
uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
|
|
|
|
if (xDescriptor.is())
|
2012-04-13 20:46:47 -03:00
|
|
|
sName += ": " + xDescriptor->getShapeType();
|
2002-03-06 16:34:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sName;
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString
|
2015-04-14 12:44:47 +02:00
|
|
|
AccessiblePresentationGraphicShape::CreateAccessibleDescription()
|
2002-03-06 16:34:56 +00:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// return createAccessibleName ();
|
|
|
|
DescriptionGenerator aDG (mxShape);
|
2002-03-18 09:30:29 +00:00
|
|
|
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
|
2002-03-06 16:34:56 +00:00
|
|
|
switch (nShapeType)
|
|
|
|
{
|
|
|
|
case PRESENTATION_GRAPHIC_OBJECT:
|
2012-04-13 20:46:47 -03:00
|
|
|
aDG.Initialize ("PresentationGraphicShape");
|
2002-03-06 16:34:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
2012-04-13 20:46:47 -03:00
|
|
|
aDG.Initialize ("Unknown accessible presentation graphic shape");
|
2002-03-06 16:34:56 +00:00
|
|
|
uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
|
|
|
|
if (xDescriptor.is())
|
|
|
|
{
|
2012-04-13 20:46:47 -03:00
|
|
|
aDG.AppendString ("service name=");
|
2002-03-18 09:30:29 +00:00
|
|
|
aDG.AppendString (xDescriptor->getShapeType());
|
2002-03-06 16:34:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return aDG();
|
|
|
|
}
|
|
|
|
|
2013-11-28 12:09:19 +00:00
|
|
|
sal_Int16 SAL_CALL AccessiblePresentationGraphicShape::getAccessibleRole ()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (::com::sun::star::uno::RuntimeException, std::exception)
|
2013-11-28 12:09:19 +00:00
|
|
|
{
|
|
|
|
return AccessibleRole::GRAPHIC ;
|
|
|
|
}
|
2002-03-06 16:34:56 +00:00
|
|
|
} // end of namespace accessibility
|
2010-10-12 15:51:52 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|