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 #ifndef INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
21 #define INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/container/XEnumerationAccess.hpp>
26 #include <cppuhelper/implbase.hxx>
28 #include "unotext.hxx"
33 struct SwXParagraphEnumeration
;
34 class SwUnoInternalPaM
;
36 typedef ::cppu::WeakImplHelper
37 < css::lang::XServiceInfo
38 , css::container::XEnumerationAccess
41 class SW_DLLPUBLIC SwXBodyText final
42 : public SwXBodyText_Base
46 virtual ~SwXBodyText() override
;
50 SwXBodyText(SwDoc
*const pDoc
);
52 rtl::Reference
<SwXTextCursor
> CreateTextCursor(const bool bIgnoreTables
= false);
55 virtual css::uno::Any SAL_CALL
queryInterface(
56 const css::uno::Type
& rType
) override
;
57 virtual void SAL_CALL
acquire() noexcept override
{ OWeakObject::acquire(); }
58 virtual void SAL_CALL
release() noexcept override
{ OWeakObject::release(); }
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
;
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
;
74 virtual css::uno::Type SAL_CALL
getElementType() override
;
75 virtual sal_Bool SAL_CALL
hasElements() override
;
78 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
79 createEnumeration() override
;
80 rtl::Reference
< SwXParagraphEnumeration
> createParagraphEnumeration();
83 virtual rtl::Reference
< SwXTextCursor
> createXTextCursor() override
;
84 virtual rtl::Reference
< SwXTextCursor
> createXTextCursorByRange(
85 const ::css::uno::Reference
< ::css::text::XTextRange
>& aTextPosition
) override
;
88 rtl::Reference
< SwXTextCursor
> createXTextCursorByRangeImpl(SwUnoInternalPaM
& rPam
);
91 typedef ::cppu::WeakImplHelper
92 < css::lang::XServiceInfo
93 , css::container::XEnumerationAccess
94 > SwXHeadFootText_Base
;
96 class SwXHeadFootText final
97 : public SwXHeadFootText_Base
101 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
103 virtual const SwStartNode
*GetStartNode() const override
;
105 virtual ~SwXHeadFootText() override
;
107 SwXHeadFootText(SwFrameFormat
& rHeadFootFormat
, const bool bIsHeader
);
111 static rtl::Reference
< SwXHeadFootText
>
112 CreateXHeadFootText(SwFrameFormat
& rHeadFootFormat
, const bool bIsHeader
);
114 rtl::Reference
< SwXTextCursor
> CreateTextCursor(const bool bIgnoreTables
= false);
117 virtual css::uno::Any SAL_CALL
queryInterface(
118 const css::uno::Type
& rType
) override
;
119 virtual void SAL_CALL
acquire() noexcept override
{ OWeakObject::acquire(); }
120 virtual void SAL_CALL
release() noexcept override
{ OWeakObject::release(); }
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
;
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
;
136 virtual css::uno::Type SAL_CALL
getElementType() override
;
137 virtual sal_Bool SAL_CALL
hasElements() override
;
139 // XEnumerationAccess
140 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
141 createEnumeration() override
;
144 virtual rtl::Reference
< SwXTextCursor
> createXTextCursor() override
;
145 virtual rtl::Reference
< SwXTextCursor
> createXTextCursorByRange(
146 const ::css::uno::Reference
< ::css::text::XTextRange
>& aTextPosition
) override
;
148 rtl::Reference
< SwXTextCursor
> createXTextCursorByRangeImpl(SwUnoInternalPaM
& rPam
);
151 #endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */