tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sw / inc / unotextbodyhf.hxx
blob4d9eeea48b296f597c1a286d5e397a3e0d80ebef
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
30 class SwDoc;
31 class SwFrameFormat;
32 class SwXTextCursor;
33 struct SwXParagraphEnumeration;
34 class SwUnoInternalPaM;
36 typedef ::cppu::WeakImplHelper
37 < css::lang::XServiceInfo
38 , css::container::XEnumerationAccess
39 > SwXBodyText_Base;
41 class SW_DLLPUBLIC SwXBodyText final
42 : public SwXBodyText_Base
43 , public SwXText
46 virtual ~SwXBodyText() override;
48 public:
50 SwXBodyText(SwDoc *const pDoc);
52 rtl::Reference<SwXTextCursor> CreateTextCursor(const bool bIgnoreTables = false);
54 // XInterface
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(); }
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;
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;
73 // XElementAccess
74 virtual css::uno::Type SAL_CALL getElementType() override;
75 virtual sal_Bool SAL_CALL hasElements() override;
77 // XEnumerationAccess
78 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
79 createEnumeration() override;
80 rtl::Reference< SwXParagraphEnumeration > createParagraphEnumeration();
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;
87 private:
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
98 , public SwXText
100 class Impl;
101 ::sw::UnoImplPtr<Impl> m_pImpl;
103 virtual const SwStartNode *GetStartNode() const override;
105 virtual ~SwXHeadFootText() override;
107 SwXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
109 public:
111 static rtl::Reference< SwXHeadFootText >
112 CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
114 rtl::Reference< SwXTextCursor > CreateTextCursor(const bool bIgnoreTables = false);
116 // XInterface
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(); }
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;
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;
135 // XElementAccess
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;
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);
151 #endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */