LibreOffice Module sw (master) 1
accembedded.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
20#include <vcl/svapp.hxx>
21#include <com/sun/star/accessibility/AccessibleRole.hpp>
24#include <flyfrm.hxx>
25#include "accembedded.hxx"
26#include <cntfrm.hxx>
27#include <notxtfrm.hxx>
28#include <ndole.hxx>
29
30using namespace ::com::sun::star;
31using namespace ::com::sun::star::lang;
32using namespace ::com::sun::star::accessibility;
33
34constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
35
37 std::shared_ptr<SwAccessibleMap> const& pInitMap,
38 const SwFlyFrame* pFlyFrame ) :
39 SwAccessibleNoTextFrame( pInitMap, AccessibleRole::EMBEDDED_OBJECT, pFlyFrame )
40{
41}
42
44{
45}
46
47// XInterface
48css::uno::Any SAL_CALL
49 SwAccessibleEmbeddedObject::queryInterface (const css::uno::Type & rType)
50{
51 css::uno::Any aReturn = SwAccessibleNoTextFrame::queryInterface (rType);
52 if ( ! aReturn.hasValue())
53 aReturn = ::cppu::queryInterface (rType,
54 static_cast< css::accessibility::XAccessibleExtendedAttributes* >(this) );
55 return aReturn;
56}
57
58void SAL_CALL
60 noexcept
61{
63}
64
65void SAL_CALL
67 noexcept
68{
70}
71
73{
75}
76
77sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& sTestServiceName)
78{
79 return cppu::supportsService(this, sTestServiceName);
80}
81
82uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames()
83{
84 return { "com.sun.star.text.AccessibleTextEmbeddedObject", sAccessibleServiceName };
85}
86
87uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
88{
89 return css::uno::Sequence<sal_Int8>();
90}
91
92// XAccessibleExtendedAttributes
94{
96
97 css::uno::Any strRet;
98 OUString style;
99 SwFlyFrame* pFFrame = getFlyFrame();
100
101 if( pFFrame )
102 {
103 style = "style:";
104 SwContentFrame* pCFrame;
105 pCFrame = pFFrame->ContainsContent();
106 if( pCFrame )
107 {
108 assert(pCFrame->IsNoTextFrame());
109 SwContentNode *const pCNode = static_cast<SwNoTextFrame*>(pCFrame)->GetNode();
110 if( pCNode )
111 {
112 style += static_cast<SwOLENode*>(pCNode)->GetOLEObj().GetStyleString();
113 }
114 }
115 style += ";";
116 }
117 strRet <<= style;
118 return strRet;
119}
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral sAccessibleServiceName
Definition: acccontext.hxx:42
constexpr OUStringLiteral sImplementationName
Definition: accembedded.cxx:34
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: accembedded.cxx:87
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
Definition: accembedded.cxx:93
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: accembedded.cxx:82
virtual void SAL_CALL release() noexcept override
Definition: accembedded.cxx:66
virtual void SAL_CALL acquire() noexcept override
Definition: accembedded.cxx:59
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
Definition: accembedded.cxx:77
virtual ~SwAccessibleEmbeddedObject() override
Definition: accembedded.cxx:43
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: accembedded.cxx:49
SwAccessibleEmbeddedObject(std::shared_ptr< SwAccessibleMap > const &pInitMap, const SwFlyFrame *pFlyFrame)
Definition: accembedded.cxx:36
virtual OUString SAL_CALL getImplementationName() override
Definition: accembedded.cxx:72
SwFlyFrame * getFlyFrame() const
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL acquire() noexcept override
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
bool IsNoTextFrame() const
Definition: frame.hxx:1244
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:72
float u
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:1043
unsigned char sal_Bool