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/XUnoTunnel.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/container/XEnumerationAccess.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <cppuhelper/implbase2.hxx>
30 #include <unotext.hxx>
36 typedef ::cppu::WeakAggImplHelper2
37 < css::lang::XServiceInfo
38 , css::container::XEnumerationAccess
42 : public SwXBodyText_Base
48 virtual ~SwXBodyText() override
;
52 SwXBodyText(SwDoc
*const pDoc
);
54 SwXTextCursor
* CreateTextCursor(const bool bIgnoreTables
= false);
57 virtual css::uno::Any SAL_CALL
queryInterface(
58 const css::uno::Type
& rType
) override
;
59 virtual void SAL_CALL
acquire() throw() override
{ OWeakObject::acquire(); }
60 virtual void SAL_CALL
release() throw() override
{ OWeakObject::release(); }
63 virtual css::uno::Any SAL_CALL
queryAggregation(
64 const css::uno::Type
& rType
) override
;
67 virtual css::uno::Sequence
< css::uno::Type
>
68 SAL_CALL
getTypes() override
;
69 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
70 getImplementationId() override
;
73 virtual OUString SAL_CALL
getImplementationName() override
;
74 virtual sal_Bool SAL_CALL
supportsService(
75 const OUString
& rServiceName
) override
;
76 virtual css::uno::Sequence
< OUString
> SAL_CALL
77 getSupportedServiceNames() override
;
80 virtual css::uno::Type SAL_CALL
getElementType() override
;
81 virtual sal_Bool SAL_CALL
hasElements() override
;
84 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
85 createEnumeration() override
;
88 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
89 createTextCursor() override
;
90 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
91 createTextCursorByRange(
92 const css::uno::Reference
< css::text::XTextRange
> & xTextPosition
) override
;
96 typedef ::cppu::WeakImplHelper
97 < css::lang::XServiceInfo
98 , css::container::XEnumerationAccess
99 > SwXHeadFootText_Base
;
101 class SwXHeadFootText
102 : public SwXHeadFootText_Base
109 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
113 virtual const SwStartNode
*GetStartNode() const override
;
114 virtual css::uno::Reference
< css::text::XTextCursor
>
115 CreateCursor() override
;
117 virtual ~SwXHeadFootText() override
;
119 SwXHeadFootText(SwFrameFormat
& rHeadFootFormat
, const bool bIsHeader
);
123 static css::uno::Reference
< css::text::XText
>
124 CreateXHeadFootText(SwFrameFormat
& rHeadFootFormat
, const bool bIsHeader
);
125 static bool IsXHeadFootText(SwClient
*const pClient
);
128 virtual css::uno::Any SAL_CALL
queryInterface(
129 const css::uno::Type
& rType
) override
;
130 virtual void SAL_CALL
acquire() throw() override
{ OWeakObject::acquire(); }
131 virtual void SAL_CALL
release() throw() override
{ OWeakObject::release(); }
134 virtual css::uno::Sequence
< css::uno::Type
>
135 SAL_CALL
getTypes() override
;
136 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
137 getImplementationId() override
;
140 virtual OUString SAL_CALL
getImplementationName() override
;
141 virtual sal_Bool SAL_CALL
supportsService(
142 const OUString
& rServiceName
) override
;
143 virtual css::uno::Sequence
< OUString
> SAL_CALL
144 getSupportedServiceNames() override
;
147 virtual css::uno::Type SAL_CALL
getElementType() override
;
148 virtual sal_Bool SAL_CALL
hasElements() override
;
150 // XEnumerationAccess
151 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
152 createEnumeration() override
;
155 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
156 createTextCursor() override
;
157 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
158 createTextCursorByRange(
159 const css::uno::Reference
< css::text::XTextRange
> & xTextPosition
) override
;
163 #endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */