LibreOffice Module sw (master)  1
unotextbodyhf.hxx
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 #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 #include <cppuhelper/implbase2.hxx>
28 
29 #include "unotext.hxx"
30 
31 class SwDoc;
32 class SwFrameFormat;
34 
35 typedef ::cppu::WeakAggImplHelper2
36 < css::lang::XServiceInfo
37 , css::container::XEnumerationAccess
39 
41  : public SwXBodyText_Base
42  , public SwXText
43 {
44 
45 protected:
46 
47  virtual ~SwXBodyText() override;
48 
49 public:
50 
51  SwXBodyText(SwDoc *const pDoc);
52 
53  SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false);
54 
55  // XInterface
56  virtual css::uno::Any SAL_CALL queryInterface(
57  const css::uno::Type& rType) override;
58  virtual void SAL_CALL acquire() throw() override { OWeakObject::acquire(); }
59  virtual void SAL_CALL release() throw() override { OWeakObject::release(); }
60 
61  // XAggregation
62  virtual css::uno::Any SAL_CALL queryAggregation(
63  const css::uno::Type& rType) override;
64 
65  // XTypeProvider
66  virtual css::uno::Sequence< css::uno::Type >
67  SAL_CALL getTypes() override;
68  virtual css::uno::Sequence< sal_Int8 > SAL_CALL
69  getImplementationId() override;
70 
71  // XServiceInfo
72  virtual OUString SAL_CALL getImplementationName() override;
73  virtual sal_Bool SAL_CALL supportsService(
74  const OUString& rServiceName) override;
75  virtual css::uno::Sequence< OUString > SAL_CALL
76  getSupportedServiceNames() override;
77 
78  // XElementAccess
79  virtual css::uno::Type SAL_CALL getElementType() override;
80  virtual sal_Bool SAL_CALL hasElements() override;
81 
82  // XEnumerationAccess
83  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
84  createEnumeration() override;
85 
86  // XSimpleText
87  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
88  createTextCursor() override;
89  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
91  const css::uno::Reference< css::text::XTextRange > & xTextPosition) override;
92 
93 };
94 
95 typedef ::cppu::WeakImplHelper
96 < css::lang::XServiceInfo
97 , css::container::XEnumerationAccess
99 
100 class SwXHeadFootText final
101  : public SwXHeadFootText_Base
102  , public SwXText
103 {
104  class Impl;
106 
107  virtual const SwStartNode *GetStartNode() const override;
108  virtual css::uno::Reference< css::text::XTextCursor >
109  CreateCursor() override;
110 
111  virtual ~SwXHeadFootText() override;
112 
113  SwXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
114 
115 public:
116 
117  static css::uno::Reference< css::text::XText >
118  CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
119 
120  // XInterface
121  virtual css::uno::Any SAL_CALL queryInterface(
122  const css::uno::Type& rType) override;
123  virtual void SAL_CALL acquire() throw() override { OWeakObject::acquire(); }
124  virtual void SAL_CALL release() throw() override { OWeakObject::release(); }
125 
126  // XTypeProvider
127  virtual css::uno::Sequence< css::uno::Type >
128  SAL_CALL getTypes() override;
129  virtual css::uno::Sequence< sal_Int8 > SAL_CALL
130  getImplementationId() override;
131 
132  // XServiceInfo
133  virtual OUString SAL_CALL getImplementationName() override;
134  virtual sal_Bool SAL_CALL supportsService(
135  const OUString& rServiceName) override;
136  virtual css::uno::Sequence< OUString > SAL_CALL
137  getSupportedServiceNames() override;
138 
139  // XElementAccess
140  virtual css::uno::Type SAL_CALL getElementType() override;
141  virtual sal_Bool SAL_CALL hasElements() override;
142 
143  // XEnumerationAccess
144  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
145  createEnumeration() override;
146 
147  // XSimpleText
148  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
149  createTextCursor() override;
150  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
152  const css::uno::Reference< css::text::XTextRange > & xTextPosition) override;
153 
154 };
155 
156 #endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
157 
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Starts a section of nodes in the document model.
Definition: node.hxx:303
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotext.cxx:2509
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::container::XEnumerationAccess > SwXHeadFootText_Base
SwXHeadFootText(SwFrameFormat &rHeadFootFormat, const bool bIsHeader)
Definition: unotext.cxx:2486
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unotext.cxx:2301
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unotext.cxx:2295
static css::uno::Reference< css::text::XText > CreateXHeadFootText(SwFrameFormat &rHeadFootFormat, const bool bIsHeader)
Definition: unotext.cxx:2470
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unotext.cxx:2338
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unotext.cxx:2529
Definition: doc.hxx:185
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
Definition: unotext.cxx:2597
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotext.cxx:2534
virtual ~SwXHeadFootText() override
Definition: unotext.cxx:2494
SwXTextCursor * CreateTextCursor(const bool bIgnoreTables=false)
Definition: unotext.cxx:2309
virtual OUString SAL_CALL getImplementationName() override
Definition: unotext.cxx:2243
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotext.cxx:2649
virtual OUString SAL_CALL getImplementationName() override
Definition: unotext.cxx:2498
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unotext.cxx:2248
virtual const SwStartNode * GetStartNode() const override
Definition: unotext.cxx:2514
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotext.cxx:2652
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
virtual void SAL_CALL acquire() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unotext.cxx:2541
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotext.cxx:2254
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unotext.cxx:2503
Style of a layout element.
Definition: frmfmt.hxx:57
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unotext.cxx:2631
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unotext.cxx:2546
unsigned char sal_Bool
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotext.cxx:2418
virtual void SAL_CALL release() override
virtual ~SwXBodyText() override
Definition: unotext.cxx:2238
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
Definition: unotext.cxx:2354
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unotext.cxx:2260
virtual void SAL_CALL acquire() override
SwXBodyText(SwDoc *const pDoc)
Definition: unotext.cxx:2233
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unotext.cxx:2399
virtual void SAL_CALL release() override
::sw::UnoImplPtr< Impl > m_pImpl
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unotext.cxx:2555
::cppu::WeakAggImplHelper2< css::lang::XServiceInfo, css::container::XEnumerationAccess > SwXBodyText_Base
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotext.cxx:2424
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotext.cxx:2287