Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sw/inc/unotextbodyhf.hxx
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
#ifndef INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
21
#define INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
22
23
#include <com/sun/star/lang/XServiceInfo.hpp>
24
#include <com/sun/star/container/XEnumerationAccess.hpp>
25
26
#include <cppuhelper/implbase.hxx>
27
28
#include "unotext.hxx"
29
30
class SwDoc;
31
class SwFrameFormat;
32
class SwXTextCursor;
33
struct SwXParagraphEnumeration;
34
class SwUnoInternalPaM;
35
36
typedef ::cppu::WeakImplHelper
37
<   css::lang::XServiceInfo
38
,   css::container::XEnumerationAccess
39
> SwXBodyText_Base;
40
41
class SW_DLLPUBLIC SwXBodyText final
42
    : public SwXBodyText_Base
43
    , public SwXText
44
{
45
46
    virtual ~SwXBodyText() override;
47
48
public:
49
50
    SwXBodyText(SwDoc *const pDoc);
51
52
    rtl::Reference<SwXTextCursor> CreateTextCursor(const bool bIgnoreTables = false);
53
54
    // XInterface
55
    virtual css::uno::Any SAL_CALL queryInterface(
56
            const css::uno::Type& rType) override;
57
3.13M
    virtual void SAL_CALL acquire() noexcept override { OWeakObject::acquire(); }
58
3.13M
    virtual void SAL_CALL release() noexcept override { OWeakObject::release(); }
59
60
    // XTypeProvider
61
    virtual css::uno::Sequence< css::uno::Type >
62
        SAL_CALL getTypes() override;
63
    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
64
        getImplementationId() override;
65
66
    // XServiceInfo
67
    virtual OUString SAL_CALL getImplementationName() override;
68
    virtual sal_Bool SAL_CALL supportsService(
69
            const OUString& rServiceName) override;
70
    virtual css::uno::Sequence< OUString > SAL_CALL
71
        getSupportedServiceNames() override;
72
73
    // XElementAccess
74
    virtual css::uno::Type SAL_CALL getElementType() override;
75
    virtual sal_Bool SAL_CALL hasElements() override;
76
77
    // XEnumerationAccess
78
    virtual css::uno::Reference< css::container::XEnumeration >  SAL_CALL
79
        createEnumeration() override;
80
    rtl::Reference< SwXParagraphEnumeration > createParagraphEnumeration();
81
82
    // XSimpleText
83
    virtual rtl::Reference< SwXTextCursor > createXTextCursor() override;
84
    virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(
85
            const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override;
86
87
private:
88
    rtl::Reference< SwXTextCursor > createXTextCursorByRangeImpl(SwUnoInternalPaM& rPam);
89
};
90
91
typedef ::cppu::WeakImplHelper
92
<   css::lang::XServiceInfo
93
,   css::container::XEnumerationAccess
94
> SwXHeadFootText_Base;
95
96
class SwXHeadFootText final
97
    : public SwXHeadFootText_Base
98
    , public SwXText
99
{
100
    class Impl;
101
    ::sw::UnoImplPtr<Impl> m_pImpl;
102
103
    virtual const SwStartNode *GetStartNode() const override;
104
105
    virtual ~SwXHeadFootText() override;
106
107
    SwXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
108
109
public:
110
111
    static rtl::Reference< SwXHeadFootText >
112
        CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
113
114
    rtl::Reference< SwXTextCursor > CreateTextCursor(const bool bIgnoreTables = false);
115
116
    // XInterface
117
    virtual css::uno::Any SAL_CALL queryInterface(
118
            const css::uno::Type& rType) override;
119
501k
    virtual void SAL_CALL acquire() noexcept override { OWeakObject::acquire(); }
120
501k
    virtual void SAL_CALL release() noexcept override { OWeakObject::release(); }
121
122
    // XTypeProvider
123
    virtual css::uno::Sequence< css::uno::Type >
124
        SAL_CALL getTypes() override;
125
    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
126
        getImplementationId() override;
127
128
    // XServiceInfo
129
    virtual OUString SAL_CALL getImplementationName() override;
130
    virtual sal_Bool SAL_CALL supportsService(
131
            const OUString& rServiceName) override;
132
    virtual css::uno::Sequence< OUString > SAL_CALL
133
        getSupportedServiceNames() override;
134
135
    // XElementAccess
136
    virtual css::uno::Type SAL_CALL getElementType() override;
137
    virtual sal_Bool SAL_CALL hasElements() override;
138
139
    // XEnumerationAccess
140
    virtual css::uno::Reference< css::container::XEnumeration >  SAL_CALL
141
        createEnumeration() override;
142
143
    // XSimpleText
144
    virtual rtl::Reference< SwXTextCursor > createXTextCursor() override;
145
    virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(
146
            const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override;
147
private:
148
    rtl::Reference< SwXTextCursor > createXTextCursorByRangeImpl(SwUnoInternalPaM& rPam);
149
};
150
151
#endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
152
153
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */