LibreOffice Module sw (master) 1
unoparagraph.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_UNOPARAGRAPH_HXX
21#define INCLUDED_SW_INC_UNOPARAGRAPH_HXX
22
23#include <memory>
24
25#include <com/sun/star/lang/XUnoTunnel.hpp>
26#include <com/sun/star/lang/XServiceInfo.hpp>
27#include <com/sun/star/beans/XPropertySet.hpp>
28#include <com/sun/star/beans/XPropertyState.hpp>
29#include <com/sun/star/beans/XMultiPropertySet.hpp>
30#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
31#include <com/sun/star/container/XEnumerationAccess.hpp>
32#include <com/sun/star/container/XContentEnumerationAccess.hpp>
33#include <com/sun/star/text/XTextContent.hpp>
34#include <com/sun/star/text/XTextRange.hpp>
35
37
38#include <sfx2/Metadatable.hxx>
39
40#include "unobaseclass.hxx"
41
42class SwPaM;
43class SwUnoCursor;
44class SwStartNode;
45class SwTextNode;
46class SwTableBox;
47class SwXText;
49
50typedef ::cppu::ImplInheritanceHelper
52, css::lang::XUnoTunnel
53, css::lang::XServiceInfo
54, css::beans::XPropertySet
55, css::beans::XPropertyState
56, css::beans::XMultiPropertySet
57, css::beans::XTolerantMultiPropertySet
58, css::container::XEnumerationAccess
59, css::container::XContentEnumerationAccess
60, css::text::XTextContent
61, css::text::XTextRange
63
64class SwXParagraph final
65 : public SwXParagraph_Base
66{
67
68private:
69
70 class Impl;
72
73 virtual ~SwXParagraph() override;
74
75 SwXParagraph(css::uno::Reference< css::text::XText > const & xParent,
76 SwTextNode & rTextNode,
77 const sal_Int32 nSelStart, const sal_Int32 nSelEnd);
78
81
82public:
83
85 CreateXParagraph(SwDoc & rDoc, SwTextNode * pTextNode,
86 css::uno::Reference< css::text::XText>
87 const& xParentText = nullptr,
88 const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1);
89
90 const SwTextNode * GetTextNode() const;
91 bool IsDescriptor() const;
93 bool SelectPaM(SwPaM & rPaM);
95 void attachToText(SwXText & rParent, SwTextNode & rTextNode);
96
97 // MetadatableMixin
98 virtual ::sfx2::Metadatable* GetCoreObject() override;
99 virtual css::uno::Reference< css::frame::XModel >
100 GetModel() override;
101
102 static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
103
104 // XUnoTunnel
105 virtual sal_Int64 SAL_CALL getSomething(
106 const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
107
108 // XServiceInfo
109 virtual OUString SAL_CALL getImplementationName() override;
110 virtual sal_Bool SAL_CALL supportsService(
111 const OUString& rServiceName) override;
112 virtual css::uno::Sequence< OUString > SAL_CALL
113 getSupportedServiceNames() override;
114
115 // XComponent
116 virtual void SAL_CALL dispose() override;
117 virtual void SAL_CALL addEventListener(
118 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
119 virtual void SAL_CALL removeEventListener(
120 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
121
122 // XPropertySet
123 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
124 getPropertySetInfo() override;
125 virtual void SAL_CALL setPropertyValue(
126 const OUString& rPropertyName,
127 const css::uno::Any& rValue) override;
128 virtual css::uno::Any SAL_CALL getPropertyValue(
129 const OUString& rPropertyName) override;
130 virtual void SAL_CALL addPropertyChangeListener(
131 const OUString& rPropertyName,
132 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
133 virtual void SAL_CALL removePropertyChangeListener(
134 const OUString& rPropertyName,
135 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
136 virtual void SAL_CALL addVetoableChangeListener(
137 const OUString& rPropertyName,
138 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
139 virtual void SAL_CALL removeVetoableChangeListener(
140 const OUString& rPropertyName,
141 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
142
143 // XPropertyState
144 virtual css::beans::PropertyState SAL_CALL
145 getPropertyState(const OUString& rPropertyName) override;
146 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
148 const css::uno::Sequence< OUString >& rPropertyNames) override;
149 virtual void SAL_CALL setPropertyToDefault(
150 const OUString& rPropertyName) override;
151 virtual css::uno::Any SAL_CALL getPropertyDefault(
152 const OUString& rPropertyName) override;
153
154 // XMultiPropertySet
155 virtual void SAL_CALL setPropertyValues(
156 const css::uno::Sequence< OUString >& rPropertyNames,
157 const css::uno::Sequence< css::uno::Any >& rValues) override;
158 virtual css::uno::Sequence< css::uno::Any >
159 SAL_CALL getPropertyValues(
160 const css::uno::Sequence< OUString >& rPropertyNames) override;
161 virtual void SAL_CALL addPropertiesChangeListener(
162 const css::uno::Sequence< OUString >& rPropertyNames,
163 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
164 virtual void SAL_CALL removePropertiesChangeListener(
165 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
166 virtual void SAL_CALL firePropertiesChangeEvent(
167 const css::uno::Sequence< OUString >& rPropertyNames,
168 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
169
170 // XTolerantMultiPropertySet
171 virtual css::uno::Sequence< css::beans::SetPropertyTolerantFailed > SAL_CALL
173 const css::uno::Sequence< OUString >& rPropertyNames,
174 const css::uno::Sequence< css::uno::Any >& rValues) override;
175 virtual css::uno::Sequence< css::beans::GetPropertyTolerantResult > SAL_CALL
177 const css::uno::Sequence< OUString >& rPropertyNames) override;
178 virtual css::uno::Sequence<
179 css::beans::GetDirectPropertyTolerantResult > SAL_CALL
181 const css::uno::Sequence< OUString >& rPropertyNames) override;
182
183 // XElementAccess
184 virtual css::uno::Type SAL_CALL getElementType() override;
185 virtual sal_Bool SAL_CALL hasElements() override;
186
187 // XEnumerationAccess
188 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
189 createEnumeration() override;
190
191 // XContentEnumerationAccess
192 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
193 createContentEnumeration(const OUString& rServiceName) override;
194 virtual css::uno::Sequence< OUString > SAL_CALL
195 getAvailableServiceNames() override;
196
197 // XTextContent
198 virtual void SAL_CALL attach(
199 const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
200 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override;
201
202 // XTextRange
203 virtual css::uno::Reference< css::text::XText >
204 SAL_CALL getText() override;
205 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
206 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
207 virtual OUString SAL_CALL getString() override;
208 virtual void SAL_CALL setString(const OUString& rString) override;
209
212};
213
214
217{
219 css::uno::Reference< css::text::XText > const & xParent,
220 const std::shared_ptr<SwUnoCursor>& pCursor,
221 const CursorType eType,
223 SwTableBox const*const pTableBox = nullptr);
224};
225
226#endif // INCLUDED_SW_INC_UNOPARAGRAPH_HXX
227
228/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:192
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
Starts a section of nodes in the document model.
Definition: node.hxx:325
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:419
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:86
virtual css::uno::Reference< css::frame::XModel > GetModel() override
virtual void SAL_CALL setString(const OUString &rString) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
virtual ~SwXParagraph() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setPropertyToDefault(const OUString &rPropertyName) override
void attachToText(SwXText &rParent, SwTextNode &rTextNode)
for SwXText
virtual OUString SAL_CALL getString() override
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
virtual void SAL_CALL dispose() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
bool SelectPaM(SwPaM &rPaM)
make rPaM select the paragraph
virtual ::sfx2::Metadatable * GetCoreObject() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
::sw::UnoImplPtr< Impl > m_pImpl
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createContentEnumeration(const OUString &rServiceName) override
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
SwXParagraph()
descriptor
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
virtual css::uno::Sequence< css::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
const SwTextNode * GetTextNode() const
virtual sal_Bool SAL_CALL hasElements() override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &rPropertyName) override
SwXParagraph(css::uno::Reference< css::text::XText > const &xParent, SwTextNode &rTextNode, const sal_Int32 nSelStart, const sal_Int32 nSelEnd)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
bool IsDescriptor() const
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Sequence< css::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rValues) override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &rPropertyName) override
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
static rtl::Reference< SwXParagraph > CreateXParagraph(SwDoc &rDoc, SwTextNode *pTextNode, css::uno::Reference< css::text::XText > const &xParentText=nullptr, const sal_Int32 nSelStart=-1, const sal_Int32 nSelEnd=- 1)
virtual css::uno::Sequence< css::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rValues) override
rtl::Reference< SwXTextPortionEnumeration > createTextFieldsEnumeration()
tries to return less data, but may return more than just text fields
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
DocumentType eType
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
static rtl::Reference< SwXParagraphEnumeration > Create(css::uno::Reference< css::text::XText > const &xParent, const std::shared_ptr< SwUnoCursor > &pCursor, const CursorType eType, SwTableBox const *const pTableBox=nullptr)
Definition: unoobj2.cxx:448
unsigned char sal_Bool
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::container::XEnumeration > SwSimpleEnumeration_Base
CursorType
::cppu::ImplInheritanceHelper< ::sfx2::MetadatableMixin, css::lang::XUnoTunnel, css::lang::XServiceInfo, css::beans::XPropertySet, css::beans::XPropertyState, css::beans::XMultiPropertySet, css::beans::XTolerantMultiPropertySet, css::container::XEnumerationAccess, css::container::XContentEnumerationAccess, css::text::XTextContent, css::text::XTextRange > SwXParagraph_Base