LibreOffice Module svx (master) 1
AccessibleGraphicShape.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21
23#include <svx/SvxShapeTypes.hxx>
24#include <svx/svdobj.hxx>
25
26#include <com/sun/star/drawing/XShape.hpp>
27#include <com/sun/star/drawing/XShapeDescriptor.hpp>
30
31using namespace ::accessibility;
32using namespace ::com::sun::star;
33using namespace ::com::sun::star::accessibility;
34
35// internal
36AccessibleGraphicShape::AccessibleGraphicShape (
37 const AccessibleShapeInfo& rShapeInfo,
38 const AccessibleShapeTreeInfo& rShapeTreeInfo)
39 : AccessibleShape (rShapeInfo, rShapeTreeInfo)
40{
41}
42
43
45{
46}
47
48// XAccessibleImage
50{
51 if (m_pShape)
52 return m_pShape->GetTitle();
54}
55
56
58{
59 return AccessibleShape::getSize().Height;
60}
61
62
64{
65 return AccessibleShape::getSize().Width;
66}
67
68// XInterface
69css::uno::Any SAL_CALL
70 AccessibleGraphicShape::queryInterface (const css::uno::Type & rType)
71{
72 css::uno::Any aReturn = AccessibleShape::queryInterface (rType);
73 if ( ! aReturn.hasValue())
74 aReturn = ::cppu::queryInterface (rType,
75 static_cast<XAccessibleImage*>(this));
76 return aReturn;
77}
78
79
80void SAL_CALL
82 noexcept
83{
85}
86
87
88void SAL_CALL
90 noexcept
91{
93}
94
95// XServiceInfo
96OUString SAL_CALL
98{
99 return "AccessibleGraphicShape";
100}
101
102
103css::uno::Sequence< OUString> SAL_CALL
105{
107 const css::uno::Sequence<OUString> vals { "com.sun.star.drawing.AccessibleGraphicShape" };
109}
110
111// XTypeProvider
112uno::Sequence<uno::Type> SAL_CALL
114{
115 // Get list of types from the context base implementation...
117 uno::Sequence { cppu::UnoType<XAccessibleImage>::get() });
118}
119
120
122OUString
124{
125 OUString sName;
126
128 switch (nShapeType)
129 {
131 sName = "GraphicObjectShape";
132 break;
133
134 default:
135 sName = "UnknownAccessibleGraphicShape";
136 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape);
137 if (xDescriptor.is())
138 sName += ": " + xDescriptor->getShapeType();
139 }
140
141 return sName;
142}
143
144/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString GetTitle() const
Definition: svdobj.cxx:817
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
sal_Int32 SAL_CALL getAccessibleImageHeight() override
virtual void SAL_CALL release() noexcept override
sal_Int32 SAL_CALL getAccessibleImageWidth() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString CreateAccessibleBaseName() override
Create a name string that contains the accessible name.
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
OUString SAL_CALL getAccessibleImageDescription() override
@descr This class is a container for the information specific for a single shape that is passed to th...
This class bundles all information that is passed down the tree of accessible shapes so that each sha...
This base class provides a base implementation for all shapes.
css::uno::Reference< css::drawing::XShape > mxShape
Reference to the actual shape.
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL acquire() noexcept override
SdrObject * m_pShape
This object can be removed when we have an extra interface to ask if the shape is selected.
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getAccessibleDescription() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
ShapeTypeId GetTypeId(const OUString &aServiceName) const
Determines the type id of a shape with the given service name.
static ShapeTypeHandler & Instance()
This function returns a reference to the only instance of this class.
css::uno::Type const & get()
OUString sName
int ShapeTypeId
Use an integer to represent shape type ids.
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)