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/XServiceInfo.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/beans/XPropertyState.hpp>
28#include <com/sun/star/beans/XMultiPropertySet.hpp>
29#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
30#include <com/sun/star/container/XEnumerationAccess.hpp>
31#include <com/sun/star/container/XContentEnumerationAccess.hpp>
32#include <com/sun/star/text/XTextContent.hpp>
33#include <com/sun/star/text/XTextRange.hpp>
34
36
37#include <sfx2/Metadatable.hxx>
38
39#include "unobaseclass.hxx"
40
41class SwPaM;
42class SwUnoCursor;
43class SwStartNode;
44class SwTextNode;
45class SwTableBox;
46class SwXText;
48
49typedef ::cppu::ImplInheritanceHelper
51, css::lang::XServiceInfo
52, css::beans::XPropertySet
53, css::beans::XPropertyState
54, css::beans::XMultiPropertySet
55, css::beans::XTolerantMultiPropertySet
56, css::container::XEnumerationAccess
57, css::container::XContentEnumerationAccess
58, css::text::XTextContent
59, css::text::XTextRange
61
62class SwXParagraph final
63 : public SwXParagraph_Base
64{
65
66private:
67
68 class Impl;
70
71 virtual ~SwXParagraph() override;
72
73 SwXParagraph(css::uno::Reference< css::text::XText > const & xParent,
74 SwTextNode & rTextNode,
75 const sal_Int32 nSelStart, const sal_Int32 nSelEnd);
76
79
80public:
81
83 CreateXParagraph(SwDoc & rDoc, SwTextNode * pTextNode,
84 css::uno::Reference< css::text::XText>
85 const& xParentText = nullptr,
86 const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1);
87
88 const SwTextNode * GetTextNode() const;
89 bool IsDescriptor() const;
91 bool SelectPaM(SwPaM & rPaM);
93 void attachToText(SwXText & rParent, SwTextNode & rTextNode);
94
95 // MetadatableMixin
96 virtual ::sfx2::Metadatable* GetCoreObject() override;
97 virtual css::uno::Reference< css::frame::XModel >
98 GetModel() override;
99
100 // XServiceInfo
101 virtual OUString SAL_CALL getImplementationName() override;
102 virtual sal_Bool SAL_CALL supportsService(
103 const OUString& rServiceName) override;
104 virtual css::uno::Sequence< OUString > SAL_CALL
105 getSupportedServiceNames() override;
106
107 // XComponent
108 virtual void SAL_CALL dispose() override;
109 virtual void SAL_CALL addEventListener(
110 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
111 virtual void SAL_CALL removeEventListener(
112 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
113
114 // XPropertySet
115 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
116 getPropertySetInfo() override;
117 virtual void SAL_CALL setPropertyValue(
118 const OUString& rPropertyName,
119 const css::uno::Any& rValue) override;
120 virtual css::uno::Any SAL_CALL getPropertyValue(
121 const OUString& rPropertyName) override;
122 virtual void SAL_CALL addPropertyChangeListener(
123 const OUString& rPropertyName,
124 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
125 virtual void SAL_CALL removePropertyChangeListener(
126 const OUString& rPropertyName,
127 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
128 virtual void SAL_CALL addVetoableChangeListener(
129 const OUString& rPropertyName,
130 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
131 virtual void SAL_CALL removeVetoableChangeListener(
132 const OUString& rPropertyName,
133 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
134
135 // XPropertyState
136 virtual css::beans::PropertyState SAL_CALL
137 getPropertyState(const OUString& rPropertyName) override;
138 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
140 const css::uno::Sequence< OUString >& rPropertyNames) override;
141 virtual void SAL_CALL setPropertyToDefault(
142 const OUString& rPropertyName) override;
143 virtual css::uno::Any SAL_CALL getPropertyDefault(
144 const OUString& rPropertyName) override;
145
146 // XMultiPropertySet
147 virtual void SAL_CALL setPropertyValues(
148 const css::uno::Sequence< OUString >& rPropertyNames,
149 const css::uno::Sequence< css::uno::Any >& rValues) override;
150 virtual css::uno::Sequence< css::uno::Any >
151 SAL_CALL getPropertyValues(
152 const css::uno::Sequence< OUString >& rPropertyNames) override;
153 virtual void SAL_CALL addPropertiesChangeListener(
154 const css::uno::Sequence< OUString >& rPropertyNames,
155 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
156 virtual void SAL_CALL removePropertiesChangeListener(
157 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
158 virtual void SAL_CALL firePropertiesChangeEvent(
159 const css::uno::Sequence< OUString >& rPropertyNames,
160 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
161
162 // XTolerantMultiPropertySet
163 virtual css::uno::Sequence< css::beans::SetPropertyTolerantFailed > SAL_CALL
165 const css::uno::Sequence< OUString >& rPropertyNames,
166 const css::uno::Sequence< css::uno::Any >& rValues) override;
167 virtual css::uno::Sequence< css::beans::GetPropertyTolerantResult > SAL_CALL
169 const css::uno::Sequence< OUString >& rPropertyNames) override;
170 virtual css::uno::Sequence<
171 css::beans::GetDirectPropertyTolerantResult > SAL_CALL
173 const css::uno::Sequence< OUString >& rPropertyNames) override;
174
175 // XElementAccess
176 virtual css::uno::Type SAL_CALL getElementType() override;
177 virtual sal_Bool SAL_CALL hasElements() override;
178
179 // XEnumerationAccess
180 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
181 createEnumeration() override;
182
183 // XContentEnumerationAccess
184 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
185 createContentEnumeration(const OUString& rServiceName) override;
186 virtual css::uno::Sequence< OUString > SAL_CALL
187 getAvailableServiceNames() override;
188
189 // XTextContent
190 virtual void SAL_CALL attach(
191 const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
192 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override;
193
194 // XTextRange
195 virtual css::uno::Reference< css::text::XText >
196 SAL_CALL getText() override;
197 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
198 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
199 virtual OUString SAL_CALL getString() override;
200 virtual void SAL_CALL setString(const OUString& rString) override;
201
204};
205
206
209{
211 css::uno::Reference< css::text::XText > const & xParent,
212 const std::shared_ptr<SwUnoCursor>& pCursor,
213 const CursorType eType,
215 SwTableBox const*const pTableBox = nullptr);
216};
217
218#endif // INCLUDED_SW_INC_UNOPARAGRAPH_HXX
219
220/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
Starts a section of nodes in the document model.
Definition: node.hxx:348
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
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 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
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:445
unsigned char sal_Bool
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::container::XEnumeration > SwSimpleEnumeration_Base
CursorType
::cppu::ImplInheritanceHelper< ::sfx2::MetadatableMixin, 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