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 <vcl/svapp.hxx>
21 #include <com/sun/star/accessibility/AccessibleRole.hpp>
22 #include <cppuhelper/queryinterface.hxx>
23 #include <cppuhelper/supportsservice.hxx>
25 #include "accembedded.hxx"
27 #include <notxtfrm.hxx>
30 using namespace ::com::sun::star
;
31 using namespace ::com::sun::star::lang
;
32 using namespace ::com::sun::star::accessibility
;
34 constexpr OUStringLiteral sImplementationName
= u
"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
36 SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
37 std::shared_ptr
<SwAccessibleMap
> const& pInitMap
,
38 const SwFlyFrame
* pFlyFrame
) :
39 SwAccessibleNoTextFrame( pInitMap
, AccessibleRole::EMBEDDED_OBJECT
, pFlyFrame
)
43 SwAccessibleEmbeddedObject::~SwAccessibleEmbeddedObject()
48 css::uno::Any SAL_CALL
49 SwAccessibleEmbeddedObject::queryInterface (const css::uno::Type
& rType
)
51 css::uno::Any aReturn
= SwAccessibleNoTextFrame::queryInterface (rType
);
52 if ( ! aReturn
.hasValue())
53 aReturn
= ::cppu::queryInterface (rType
,
54 static_cast< css::accessibility::XAccessibleExtendedAttributes
* >(this) );
59 SwAccessibleEmbeddedObject::acquire()
62 SwAccessibleNoTextFrame::acquire ();
66 SwAccessibleEmbeddedObject::release()
69 SwAccessibleNoTextFrame::release ();
72 OUString SAL_CALL
SwAccessibleEmbeddedObject::getImplementationName()
74 return sImplementationName
;
77 sal_Bool SAL_CALL
SwAccessibleEmbeddedObject::supportsService(const OUString
& sTestServiceName
)
79 return cppu::supportsService(this, sTestServiceName
);
82 uno::Sequence
< OUString
> SAL_CALL
SwAccessibleEmbeddedObject::getSupportedServiceNames()
84 return { "com.sun.star.text.AccessibleTextEmbeddedObject", sAccessibleServiceName
};
87 uno::Sequence
< sal_Int8
> SAL_CALL
SwAccessibleEmbeddedObject::getImplementationId()
89 return css::uno::Sequence
<sal_Int8
>();
92 // XAccessibleExtendedAttributes
93 css::uno::Any SAL_CALL
SwAccessibleEmbeddedObject::getExtendedAttributes()
99 SwFlyFrame
* pFFrame
= getFlyFrame();
104 SwContentFrame
* pCFrame
;
105 pCFrame
= pFFrame
->ContainsContent();
108 assert(pCFrame
->IsNoTextFrame());
109 SwContentNode
*const pCNode
= static_cast<SwNoTextFrame
*>(pCFrame
)->GetNode();
112 style
+= static_cast<SwOLENode
*>(pCNode
)->GetOLEObj().GetStyleString();
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */