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 
40 class SwXBodyText final
41  : public SwXBodyText_Base
42  , public SwXText
43 {
44 
45  virtual ~SwXBodyText() override;
46 
47 public:
48 
49  SwXBodyText(SwDoc *const pDoc);
50 
51  SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false);
52 
53  // XInterface
54  virtual css::uno::Any SAL_CALL queryInterface(
55  const css::uno::Type& rType) override;
56  virtual void SAL_CALL acquire() throw() override { OWeakObject::acquire(); }
57  virtual void SAL_CALL release() throw() override { OWeakObject::release(); }
58 
59  // XAggregation
60  virtual css::uno::Any SAL_CALL queryAggregation(
61  const css::uno::Type& rType) override;
62 
63  // XTypeProvider
64  virtual css::uno::Sequence< css::uno::Type >
65  SAL_CALL getTypes() override;
66  virtual css::uno::Sequence< sal_Int8 > SAL_CALL
67  getImplementationId() override;
68 
69  // XServiceInfo
70  virtual OUString SAL_CALL getImplementationName() override;
71  virtual sal_Bool SAL_CALL supportsService(
72  const OUString& rServiceName) override;
73  virtual css::uno::Sequence< OUString > SAL_CALL
74  getSupportedServiceNames() override;
75 
76  // XElementAccess
77  virtual css::uno::Type SAL_CALL getElementType() override;
78  virtual sal_Bool SAL_CALL hasElements() override;
79 
80  // XEnumerationAccess
81  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
82  createEnumeration() override;
83 
84  // XSimpleText
85  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
86  createTextCursor() override;
87  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
89  const css::uno::Reference< css::text::XTextRange > & xTextPosition) override;
90 
91 };
92 
93 typedef ::cppu::WeakImplHelper
94 < css::lang::XServiceInfo
95 , css::container::XEnumerationAccess
97 
98 class SwXHeadFootText final
99  : public SwXHeadFootText_Base
100  , public SwXText
101 {
102  class Impl;
104 
105  virtual const SwStartNode *GetStartNode() const override;
106  virtual css::uno::Reference< css::text::XTextCursor >
107  CreateCursor() override;
108 
109  virtual ~SwXHeadFootText() override;
110 
111  SwXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
112 
113 public:
114 
115  static css::uno::Reference< css::text::XText >
116  CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
117 
118  // XInterface
119  virtual css::uno::Any SAL_CALL queryInterface(
120  const css::uno::Type& rType) override;
121  virtual void SAL_CALL acquire() throw() override { OWeakObject::acquire(); }
122  virtual void SAL_CALL release() throw() override { OWeakObject::release(); }
123 
124  // XTypeProvider
125  virtual css::uno::Sequence< css::uno::Type >
126  SAL_CALL getTypes() override;
127  virtual css::uno::Sequence< sal_Int8 > SAL_CALL
128  getImplementationId() override;
129 
130  // XServiceInfo
131  virtual OUString SAL_CALL getImplementationName() override;
132  virtual sal_Bool SAL_CALL supportsService(
133  const OUString& rServiceName) override;
134  virtual css::uno::Sequence< OUString > SAL_CALL
135  getSupportedServiceNames() override;
136 
137  // XElementAccess
138  virtual css::uno::Type SAL_CALL getElementType() override;
139  virtual sal_Bool SAL_CALL hasElements() override;
140 
141  // XEnumerationAccess
142  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
143  createEnumeration() override;
144 
145  // XSimpleText
146  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
147  createTextCursor() override;
148  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
150  const css::uno::Reference< css::text::XTextRange > & xTextPosition) override;
151 
152 };
153 
154 #endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
155 
156 /* 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:2498
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::container::XEnumerationAccess > SwXHeadFootText_Base
SwXHeadFootText(SwFrameFormat &rHeadFootFormat, const bool bIsHeader)
Definition: unotext.cxx:2475
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unotext.cxx:2290
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unotext.cxx:2284
static css::uno::Reference< css::text::XText > CreateXHeadFootText(SwFrameFormat &rHeadFootFormat, const bool bIsHeader)
Definition: unotext.cxx:2459
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unotext.cxx:2327
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unotext.cxx:2518
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:2586
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotext.cxx:2523
virtual ~SwXHeadFootText() override
Definition: unotext.cxx:2483
SwXTextCursor * CreateTextCursor(const bool bIgnoreTables=false)
Definition: unotext.cxx:2298
virtual OUString SAL_CALL getImplementationName() override
Definition: unotext.cxx:2232
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotext.cxx:2638
virtual OUString SAL_CALL getImplementationName() override
Definition: unotext.cxx:2487
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unotext.cxx:2237
virtual const SwStartNode * GetStartNode() const override
Definition: unotext.cxx:2503
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotext.cxx:2641
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:2530
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotext.cxx:2243
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unotext.cxx:2492
Style of a layout element.
Definition: frmfmt.hxx:57
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unotext.cxx:2620
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unotext.cxx:2535
unsigned char sal_Bool
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotext.cxx:2407
virtual void SAL_CALL release() override
virtual ~SwXBodyText() override
Definition: unotext.cxx:2227
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
Definition: unotext.cxx:2343
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unotext.cxx:2249
virtual void SAL_CALL acquire() override
SwXBodyText(SwDoc *const pDoc)
Definition: unotext.cxx:2222
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unotext.cxx:2388
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:2544
::cppu::WeakAggImplHelper2< css::lang::XServiceInfo, css::container::XEnumerationAccess > SwXBodyText_Base
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotext.cxx:2413
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotext.cxx:2276