1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svx/AccessibleOLEShape.hxx>
22 #include <svx/ShapeTypeHandler.hxx>
23 #include <svx/SvxShapeTypes.hxx>
24 #include <svx/svdoole2.hxx>
26 #include <comphelper/sequence.hxx>
27 #include <cppuhelper/queryinterface.hxx>
29 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30 #include <com/sun/star/drawing/XShape.hpp>
31 #include <com/sun/star/drawing/XShapeDescriptor.hpp>
33 using namespace ::accessibility
;
34 using namespace ::com::sun::star
;
35 using namespace ::com::sun::star::uno
;
36 using namespace ::com::sun::star::accessibility
;
39 AccessibleOLEShape::AccessibleOLEShape (
40 const AccessibleShapeInfo
& rShapeInfo
,
41 const AccessibleShapeTreeInfo
& rShapeTreeInfo
)
42 : AccessibleShape (rShapeInfo
, rShapeTreeInfo
)
47 AccessibleOLEShape::~AccessibleOLEShape()
52 sal_Int32 SAL_CALL
AccessibleOLEShape::getAccessibleActionCount()
58 sal_Bool SAL_CALL
AccessibleOLEShape::doAccessibleAction (sal_Int32
/*nIndex*/)
60 throw lang::IndexOutOfBoundsException();
64 OUString SAL_CALL
AccessibleOLEShape::getAccessibleActionDescription (sal_Int32
/*nIndex*/)
66 throw lang::IndexOutOfBoundsException();
70 Reference
<XAccessibleKeyBinding
> SAL_CALL
AccessibleOLEShape::getAccessibleActionKeyBinding (sal_Int32
/*nIndex*/)
72 throw lang::IndexOutOfBoundsException();
76 css::uno::Any SAL_CALL
77 AccessibleOLEShape::queryInterface (const css::uno::Type
& rType
)
79 css::uno::Any aReturn
= AccessibleShape::queryInterface (rType
);
80 if ( ! aReturn
.hasValue())
81 aReturn
= ::cppu::queryInterface (rType
,
82 static_cast<XAccessibleAction
*>(this));
88 AccessibleOLEShape::acquire()
91 AccessibleShape::acquire ();
96 AccessibleOLEShape::release()
99 AccessibleShape::release ();
104 AccessibleOLEShape::getImplementationName()
106 return "AccessibleOLEShape";
110 css::uno::Sequence
< OUString
> SAL_CALL
111 AccessibleOLEShape::getSupportedServiceNames()
114 const css::uno::Sequence
<OUString
> vals
{ "com.sun.star.drawing.AccessibleOLEShape" };
115 return comphelper::concatSequences(AccessibleShape::getSupportedServiceNames(), vals
);
119 uno::Sequence
<uno::Type
> SAL_CALL
AccessibleOLEShape::getTypes()
121 // Get list of types from the context base implementation...
122 return comphelper::concatSequences(AccessibleShape::getTypes(),
123 uno::Sequence
{ cppu::UnoType
<XAccessibleAction
>::get() } );
126 // XAccessibleExtendedAttributes
127 uno::Any SAL_CALL
AccessibleOLEShape::getExtendedAttributes()
133 style
= "style:" + static_cast<SdrOle2Obj
*>(m_pShape
)->GetStyleString();
140 /// Set this object's name if is different to the current name.
142 AccessibleOLEShape::CreateAccessibleBaseName()
146 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
150 sName
= "AppletOLEShape";
153 sName
= "FrameOLEShape";
159 sName
= "PluginOLEShape";
163 sName
= "UnknownAccessibleOLEShape";
164 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
);
165 if (xDescriptor
.is())
166 sName
+= ": " + xDescriptor
->getShapeType();
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */