/src/libreoffice/svx/source/accessibility/AccessibleGraphicShape.cxx
Line | Count | Source |
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 | | |
20 | | #include <svx/AccessibleGraphicShape.hxx> |
21 | | |
22 | | #include <svx/ShapeTypeHandler.hxx> |
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> |
28 | | #include <comphelper/sequence.hxx> |
29 | | #include <cppuhelper/queryinterface.hxx> |
30 | | |
31 | | using namespace ::accessibility; |
32 | | using namespace ::com::sun::star; |
33 | | using namespace ::com::sun::star::accessibility; |
34 | | |
35 | | // internal |
36 | | AccessibleGraphicShape::AccessibleGraphicShape(const AccessibleShapeInfo& rShapeInfo, |
37 | | const AccessibleShapeTreeInfo& rShapeTreeInfo) |
38 | 0 | : ImplInheritanceHelper(rShapeInfo, rShapeTreeInfo) |
39 | 0 | { |
40 | 0 | } |
41 | | |
42 | | |
43 | | AccessibleGraphicShape::~AccessibleGraphicShape() |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | | // XAccessibleImage |
48 | | OUString SAL_CALL AccessibleGraphicShape::getAccessibleImageDescription() |
49 | 0 | { |
50 | 0 | if (m_pShape) |
51 | 0 | return m_pShape->GetTitle(); |
52 | 0 | return AccessibleShape::getAccessibleDescription (); |
53 | 0 | } |
54 | | |
55 | | |
56 | | sal_Int32 SAL_CALL AccessibleGraphicShape::getAccessibleImageHeight() |
57 | 0 | { |
58 | 0 | return AccessibleShape::getSize().Height; |
59 | 0 | } |
60 | | |
61 | | |
62 | | sal_Int32 SAL_CALL AccessibleGraphicShape::getAccessibleImageWidth() |
63 | 0 | { |
64 | 0 | return AccessibleShape::getSize().Width; |
65 | 0 | } |
66 | | |
67 | | /// Create the base name of this object, i.e. the name without appended number. |
68 | | OUString |
69 | | AccessibleGraphicShape::CreateAccessibleBaseName() |
70 | 0 | { |
71 | 0 | OUString sName; |
72 | |
|
73 | 0 | ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape); |
74 | 0 | switch (nShapeType) |
75 | 0 | { |
76 | 0 | case DRAWING_GRAPHIC_OBJECT: |
77 | 0 | sName = "GraphicObjectShape"; |
78 | 0 | break; |
79 | | |
80 | 0 | default: |
81 | 0 | sName = "UnknownAccessibleGraphicShape"; |
82 | 0 | uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape); |
83 | 0 | if (xDescriptor.is()) |
84 | 0 | sName += ": " + xDescriptor->getShapeType(); |
85 | 0 | } |
86 | | |
87 | 0 | return sName; |
88 | 0 | } |
89 | | |
90 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |