LibreOffice Module editeng (master) 1
unotext.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_EDITENG_UNOTEXT_HXX
21#define INCLUDED_EDITENG_UNOTEXT_HXX
22
23#include <memory>
24#include <com/sun/star/text/XTextRange.hpp>
25#include <com/sun/star/text/XTextContent.hpp>
26#include <com/sun/star/container/XEnumerationAccess.hpp>
27#include <com/sun/star/text/XTextRangeMover.hpp>
28#include <com/sun/star/text/XTextCursor.hpp>
29#include <com/sun/star/lang/XTypeProvider.hpp>
30#include <com/sun/star/lang/XServiceInfo.hpp>
31#include <com/sun/star/beans/XPropertySet.hpp>
32#include <com/sun/star/beans/XPropertyState.hpp>
33#include <com/sun/star/beans/XMultiPropertySet.hpp>
34#include <com/sun/star/text/XTextRangeCompare.hpp>
35#include <com/sun/star/beans/XMultiPropertyStates.hpp>
36#include <com/sun/star/text/XTextAppend.hpp>
37#include <com/sun/star/text/XTextCopy.hpp>
38#include <com/sun/star/container/XIndexReplace.hpp>
39#include <com/sun/star/awt/FontSlant.hpp>
40#include <com/sun/star/awt/FontDescriptor.hpp>
41#include <com/sun/star/style/LineSpacing.hpp>
42#include <com/sun/star/style/TabStop.hpp>
43#include <com/sun/star/lang/XUnoTunnel.hpp>
44#include <com/sun/star/util/XComplexColor.hpp>
48#include <osl/diagnose.hxx>
49#include <o3tl/span.hxx>
50#include <mutex>
52#include <svl/itemset.hxx>
53#include <svl/solar.hrc>
54#include <editeng/editdata.hxx>
55#include <editeng/unoedsrc.hxx>
56#include <editeng/eeitem.hxx>
58#include <editeng/memberids.h>
59
62
63#define WID_FONTDESC OWN_ATTR_VALUE_START
64#define WID_PORTIONTYPE OWN_ATTR_VALUE_START+2
65#define WID_NUMBERINGSTARTVALUE OWN_ATTR_VALUE_START+3
66#define WID_PARAISNUMBERINGRESTART OWN_ATTR_VALUE_START+4
67#define WID_PARASTYLENAME OWN_ATTR_VALUE_START+5
68
69#define SVX_UNOEDIT_NUMBERING_PROPERTY \
70 { UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 }, \
71 { UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 }
72
73#define SVX_UNOEDIT_OUTLINER_PROPERTIES \
74 SVX_UNOEDIT_NUMBERING_PROPERTY, \
75 { UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
76 {u"NumberingStartValue", WID_NUMBERINGSTARTVALUE, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
77 {u"ParaIsNumberingRestart", WID_PARAISNUMBERINGRESTART, cppu::UnoType<bool>::get(), 0, 0 }
78
79#define SVX_UNOEDIT_CHAR_PROPERTIES \
80 { UNO_NAME_EDIT_CHAR_HEIGHT, EE_CHAR_FONTHEIGHT, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
81 { u"CharScaleWidth", EE_CHAR_FONTWIDTH, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
82 { UNO_NAME_EDIT_CHAR_FONTNAME, EE_CHAR_FONTINFO, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
83 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME,EE_CHAR_FONTINFO, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
84 { UNO_NAME_EDIT_CHAR_FONTFAMILY, EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
85 { UNO_NAME_EDIT_CHAR_FONTCHARSET, EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
86 { UNO_NAME_EDIT_CHAR_FONTPITCH, EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
87 { UNO_NAME_EDIT_CHAR_POSTURE, EE_CHAR_ITALIC, ::cppu::UnoType<css::awt::FontSlant>::get(),0, MID_POSTURE }, \
88 { UNO_NAME_EDIT_CHAR_WEIGHT, EE_CHAR_WEIGHT, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
89 { UNO_NAME_EDIT_CHAR_LOCALE, EE_CHAR_LANGUAGE, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
90 { UNO_NAME_EDIT_CHAR_COLOR, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, MID_COLOR_RGB }, \
91 { UNO_NAME_EDIT_CHAR_TRANSPARENCE,EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_ALPHA }, \
92 { UNO_NAME_EDIT_CHAR_COLOR_THEME, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_THEME_INDEX }, \
93 { UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_TINT_OR_SHADE }, \
94 { UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_MOD }, \
95 { UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_OFF }, \
96 { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, EE_CHAR_COLOR, ::cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR }, \
97 { UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR, EE_CHAR_BKGCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, MID_COLOR_RGB }, \
98 { UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR, EE_CHAR_BKGCOLOR, ::cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR }, \
99 { UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT, EE_CHAR_BKGCOLOR, ::cppu::UnoType<bool>::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
100 { UNO_NAME_EDIT_CHAR_ESCAPEMENT, EE_CHAR_ESCAPEMENT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_ESC }, \
101 { UNO_NAME_EDIT_CHAR_UNDERLINE, EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
102 { u"CharUnderlineColor", EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
103 { u"CharUnderlineHasColor", EE_CHAR_UNDERLINE, cppu::UnoType<bool>::get(), 0, MID_TL_HASCOLOR } , \
104 { UNO_NAME_EDIT_CHAR_OVERLINE, EE_CHAR_OVERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
105 { u"CharOverlineColor", EE_CHAR_OVERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
106 { u"CharOverlineHasColor", EE_CHAR_OVERLINE, cppu::UnoType<bool>::get(), 0, MID_TL_HASCOLOR } , \
107 { UNO_NAME_EDIT_CHAR_CROSSEDOUT, EE_CHAR_STRIKEOUT, cppu::UnoType<bool>::get(), 0, MID_CROSSED_OUT }, \
108 { UNO_NAME_EDIT_CHAR_STRIKEOUT, EE_CHAR_STRIKEOUT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_CROSS_OUT}, \
109 { UNO_NAME_EDIT_CHAR_CASEMAP, EE_CHAR_CASEMAP, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
110 { UNO_NAME_EDIT_CHAR_SHADOWED, EE_CHAR_SHADOW, cppu::UnoType<bool>::get(), 0, 0 }, \
111 { u"CharContoured", EE_CHAR_OUTLINE, cppu::UnoType<bool>::get(), 0, 0 }, \
112 { u"CharEscapementHeight", EE_CHAR_ESCAPEMENT, cppu::UnoType<sal_Int8>::get(), 0, MID_ESC_HEIGHT },\
113 { u"CharAutoKerning", EE_CHAR_PAIRKERNING,cppu::UnoType<bool>::get(), 0, 0 } , \
114 { u"CharKerning", EE_CHAR_KERNING, ::cppu::UnoType<sal_Int16>::get() , 0, 0 }, \
115 { u"CharWordMode", EE_CHAR_WLM, cppu::UnoType<bool>::get(), 0, 0 }, \
116 { u"CharEmphasis", EE_CHAR_EMPHASISMARK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_EMPHASIS},\
117 { UNO_NAME_EDIT_CHAR_HEIGHT_ASIAN, EE_CHAR_FONTHEIGHT_CJK, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
118 { UNO_NAME_EDIT_CHAR_FONTNAME_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
119 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
120 { UNO_NAME_EDIT_CHAR_FONTFAMILY_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
121 { UNO_NAME_EDIT_CHAR_FONTCHARSET_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
122 { UNO_NAME_EDIT_CHAR_FONTPITCH_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
123 { UNO_NAME_EDIT_CHAR_POSTURE_ASIAN, EE_CHAR_ITALIC_CJK, ::cppu::UnoType<css::awt::FontSlant>::get(),0, MID_POSTURE }, \
124 { UNO_NAME_EDIT_CHAR_WEIGHT_ASIAN, EE_CHAR_WEIGHT_CJK, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
125 { UNO_NAME_EDIT_CHAR_LOCALE_ASIAN, EE_CHAR_LANGUAGE_CJK, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
126 { UNO_NAME_EDIT_CHAR_HEIGHT_COMPLEX, EE_CHAR_FONTHEIGHT_CTL, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
127 { UNO_NAME_EDIT_CHAR_FONTNAME_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
128 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME_COMPLEX,EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
129 { UNO_NAME_EDIT_CHAR_FONTFAMILY_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
130 { UNO_NAME_EDIT_CHAR_FONTCHARSET_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
131 { UNO_NAME_EDIT_CHAR_FONTPITCH_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
132 { UNO_NAME_EDIT_CHAR_POSTURE_COMPLEX, EE_CHAR_ITALIC_CTL, ::cppu::UnoType<css::awt::FontSlant>::get(),0, MID_POSTURE }, \
133 { UNO_NAME_EDIT_CHAR_WEIGHT_COMPLEX, EE_CHAR_WEIGHT_CTL, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
134 { UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX, EE_CHAR_LANGUAGE_CTL, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
135 { u"CharRelief", EE_CHAR_RELIEF, ::cppu::UnoType<sal_Int16>::get(), 0, MID_RELIEF }, \
136 { u"CharInteropGrabBag", EE_CHAR_GRABBAG, cppu::UnoType<css::uno::Sequence<css::beans::PropertyValue >>::get(), 0, 0}
137
138
139#define SVX_UNOEDIT_FONT_PROPERTIES \
140 { UNO_NAME_EDIT_FONT_DESCRIPTOR, WID_FONTDESC, cppu::UnoType<css::awt::FontDescriptor>::get(), 0, MID_FONT_FAMILY_NAME }
141
142#define SVX_UNOEDIT_PARA_PROPERTIES \
143 { UNO_NAME_EDIT_PARA_ADJUST, EE_PARA_JUST, ::cppu::UnoType<sal_Int16>::get(), 0, MID_PARA_ADJUST }, \
144 { UNO_NAME_EDIT_PARA_BMARGIN, EE_PARA_ULSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_LO_MARGIN, PropertyMoreFlags::METRIC_ITEM }, \
145 { UNO_NAME_EDIT_PARA_IS_HYPHEN, EE_PARA_HYPHENATE, ::cppu::UnoType<bool>::get(), 0, 0 }, \
146 {u"ParaHyphenationNoCaps", EE_PARA_HYPHENATE_NO_CAPS, ::cppu::UnoType<bool>::get(), 0, 0 }, \
147 {u"ParaHyphenationNoLastWord", EE_PARA_HYPHENATE_NO_LAST_WORD, ::cppu::UnoType<bool>::get(), 0, 0 }, \
148 { UNO_NAME_EDIT_PARA_LASTLINEADJ, EE_PARA_JUST, ::cppu::UnoType<sal_Int16>::get(), 0, MID_LAST_LINE_ADJUST }, \
149 { UNO_NAME_EDIT_PARA_LMARGIN, EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TXT_LMARGIN, PropertyMoreFlags::METRIC_ITEM }, \
150 { UNO_NAME_EDIT_PARA_LINESPACING, EE_PARA_SBL, cppu::UnoType<css::style::LineSpacing>::get(), 0, CONVERT_TWIPS}, \
151 { UNO_NAME_EDIT_PARA_RMARGIN, EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_R_MARGIN, PropertyMoreFlags::METRIC_ITEM }, \
152 { UNO_NAME_EDIT_PARA_TABSTOPS, EE_PARA_TABS, cppu::UnoType<css::uno::Sequence< css::style::TabStop >>::get(), 0, 0 }, \
153 { UNO_NAME_EDIT_PARA_TABSTOP_DEFAULT_DISTANCE, EE_PARA_TABS, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TABSTOP_DEFAULT_DISTANCE }, \
154 { UNO_NAME_EDIT_PARA_TMARGIN, EE_PARA_ULSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_UP_MARGIN, PropertyMoreFlags::METRIC_ITEM },\
155 { UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT, EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_FIRST_LINE_INDENT, PropertyMoreFlags::METRIC_ITEM}, \
156 { UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION,EE_PARA_HANGINGPUNCTUATION, cppu::UnoType<bool>::get(), 0 ,0 }, \
157 { UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE, EE_PARA_ASIANCJKSPACING, cppu::UnoType<bool>::get(), 0 ,0 }, \
158 { UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES, EE_PARA_FORBIDDENRULES, cppu::UnoType<bool>::get(), 0 ,0 },\
159 {u"WritingMode", EE_PARA_WRITINGDIR, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }
160
161class SvxFieldItem;
162class SvxFieldData;
163
164EDITENG_DLLPUBLIC void GetSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarder ) noexcept;
165EDITENG_DLLPUBLIC void CheckSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarder ) noexcept;
166
167
168// This class implements a SvxEditSource and SvxTextForwarder and does
169// nothing otherwise
170
171
173{
174public:
175
176 // SvxEditSource
177 virtual ~SvxDummyTextSource() override;
178 virtual std::unique_ptr<SvxEditSource> Clone() const override;
179 virtual SvxTextForwarder* GetTextForwarder() override;
180 virtual void UpdateData() override;
181
182 // SvxTextForwarder
183 virtual sal_Int32 GetParagraphCount() const override;
184 virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
185 virtual OUString GetText( const ESelection& rSel ) const override;
186 virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
187 virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
188 virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
189 virtual void RemoveAttribs( const ESelection& rSelection ) override;
190 virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
191
192 virtual OUString GetStyleSheet(sal_Int32 nPara) const override;
193 virtual void SetStyleSheet(sal_Int32 nPara, const OUString& rStyleName) override;
194
195 SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override;
196 SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const override;
197
198 virtual SfxItemPool* GetPool() const override;
199
200 virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) override;
201 virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) override;
202 virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) override;
203 virtual void QuickInsertLineBreak( const ESelection& rSel ) override;
204
205 virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, std::optional<FontLineStyle>& rpFldLineStyle ) override;
206 virtual void FieldClicked( const SvxFieldItem& rField ) override;
207
208 virtual bool IsValid() const override;
209
210 virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override;
211 virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override;
212 virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override;
213 virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override;
214 virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override;
215 virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override;
216 virtual MapMode GetMapMode() const override;
217 virtual OutputDevice* GetRefDevice() const override;
218 virtual bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_Int32& nIndex ) const override;
219 virtual bool GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const override;
220 virtual bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell = false ) const override;
221 virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const override;
222 virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const override;
223 virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const override;
224 virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const override;
225 virtual bool Delete( const ESelection& ) override;
226 virtual bool InsertText( const OUString&, const ESelection& ) override;
227 virtual bool QuickFormatDoc( bool bFull = false ) override;
228 virtual sal_Int16 GetDepth( sal_Int32 nPara ) const override;
229 virtual bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) override;
230
231 virtual const SfxItemSet* GetEmptyItemSetPtr() override;
232
233 // implementation functions for XParagraphAppend and XTextPortionAppend
234 virtual void AppendParagraph() override;
235 virtual sal_Int32 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) override;
236 //XTextCopy
237 virtual void CopyText(const SvxTextForwarder& rSource) override;
238};
239
240namespace accessibility
241{
242 class AccessibleEditableTextPara;
243}
244
245
246class EDITENG_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") SvxUnoTextRangeBase :
247 public css::text::XTextRange,
248 public css::beans::XPropertySet,
249 public css::beans::XMultiPropertySet,
250 public css::beans::XMultiPropertyStates,
251 public css::beans::XPropertyState,
252 public css::lang::XServiceInfo,
253 public css::text::XTextRangeCompare,
254 public css::lang::XUnoTunnel,
255 private osl::DebugBase<SvxUnoTextRangeBase>
256
257{
258 friend class SvxUnoTextRangeEnumeration;
259 friend class ::accessibility::AccessibleEditableTextPara;
260 const SvxItemPropertySet* mpPropSet;
261
262protected:
263 std::unique_ptr<SvxEditSource> mpEditSource;
264 ESelection maSelection;
265
271 void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue, sal_Int32 nPara = -1 );
275 css::uno::Any _getPropertyValue( const OUString& PropertyName, sal_Int32 nPara = -1 );
276
281 void _setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues, sal_Int32 nPara = -1 );
283 css::uno::Sequence< css::uno::Any > _getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, sal_Int32 nPara = -1 );
284
287 css::beans::PropertyState _getPropertyState( const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara = -1 );
290 css::beans::PropertyState _getPropertyState( std::u16string_view PropertyName, sal_Int32 nPara = -1 );
293 css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 );
294 // returns true if property found or false if unknown property
295 static bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertyMapEntry* pMap, css::beans::PropertyState& rState);
296
299 void _setPropertyToDefault( const OUString& PropertyName, sal_Int32 nPara = -1 );
302 void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara );
303 void SetEditSource( SvxEditSource* _pEditSource ) noexcept;
304
307 void getPropertyValue( const SfxItemPropertyMapEntry* pMap, css::uno::Any& rAny, const SfxItemSet& rSet );
310 void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet );
311
312 SvxUnoTextRangeBase(const SvxItemPropertySet* _pSet);
313 SvxUnoTextRangeBase(const SvxEditSource* pSource, const SvxItemPropertySet* _pSet);
314 SvxUnoTextRangeBase(const SvxUnoTextRangeBase& rRange);
315 virtual ~SvxUnoTextRangeBase() noexcept;
316
317public:
318 // Internal
319 const ESelection& GetSelection() const noexcept
320 {
321 const SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
322 CheckSelection(const_cast<SvxUnoTextRangeBase*>(this)->maSelection, pForwarder);
323 return maSelection;
324 }
325 void SetSelection( const ESelection& rSelection ) noexcept;
326
327 void CollapseToStart() noexcept;
328 void CollapseToEnd() noexcept;
329 bool IsCollapsed() noexcept;
330 bool GoLeft(sal_Int32 nCount, bool Expand) noexcept;
331 bool GoRight(sal_Int32 nCount, bool Expand) noexcept;
332 void GotoStart(bool Expand) noexcept;
333 void GotoEnd(bool Expand) noexcept;
334
335 //const SfxItemPropertyMapEntry* getPropertyMapEntries() const throw() { return maPropSet.getPropertyMapEntries(); }
336 const SvxItemPropertySet* getPropertySet() const noexcept { return mpPropSet; }
337 SvxEditSource* GetEditSource() const noexcept { return mpEditSource.get(); }
338
339 static bool SetPropertyValueHelper( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr );
341 static bool GetPropertyValueHelper( SfxItemSet const & rSet, const SfxItemPropertyMapEntry* pMap, css::uno::Any& aAny, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr );
342
343 void attachField( std::unique_ptr<SvxFieldData> pData ) noexcept;
344
345 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextRangeBase )
346
347 // css::text::XTextRange
348 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
349 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
350 virtual OUString SAL_CALL getString() override;
351 virtual void SAL_CALL setString( const OUString& aString ) override;
352
353 // css::beans::XPropertySet
354 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
355 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
356 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
357 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
358 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
359 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
360 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
361
362 // XMultiPropertySet
363 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
364 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
365 virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
366 virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
367 virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
368
369 // css::beans::XPropertyState
370 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
371 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
372 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
373 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
374
375 // css::beans::XMultiPropertyStates
376 //virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
377 virtual void SAL_CALL setAllPropertiesToDefault() override;
378 virtual void SAL_CALL setPropertiesToDefault( const css::uno::Sequence< OUString >& aPropertyNames ) override;
379 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults( const css::uno::Sequence< OUString >& aPropertyNames ) override;
380
381 // XTextRangeCompare
382 virtual ::sal_Int16 SAL_CALL compareRegionStarts( const css::uno::Reference< css::text::XTextRange >& xR1, const css::uno::Reference< css::text::XTextRange >& xR2 ) override;
383 virtual ::sal_Int16 SAL_CALL compareRegionEnds( const css::uno::Reference< css::text::XTextRange >& xR1, const css::uno::Reference< css::text::XTextRange >& xR2 ) override;
384
385 // css::lang::XServiceInfo
386 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
387 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
388 static css::uno::Sequence< OUString > getSupportedServiceNames_Static( );
389};
390
391
392class SvxUnoTextBase;
393class EDITENG_DLLPUBLIC SvxUnoTextRange final : public SvxUnoTextRangeBase,
394 public css::lang::XTypeProvider,
396{
398private:
399 css::uno::Reference< css::text::XText > xParentText;
401
402public:
403 SvxUnoTextRange(const SvxUnoTextBase& rParent, bool bPortion = false);
404 virtual ~SvxUnoTextRange() noexcept override;
405
406 // css::uno::XInterface
407 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
408 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
409 virtual void SAL_CALL acquire() noexcept override;
410 virtual void SAL_CALL release() noexcept override;
411
412 // css::text::XTextRange
413 virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override;
414
415 // css::lang::XServiceInfo
416 virtual OUString SAL_CALL getImplementationName() override;
417
418 // css::lang::XTypeProvider
419 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
420 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
421};
422
423class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextRangeBase,
424 public css::text::XTextAppend,
425 public css::text::XTextCopy,
426 public css::container::XEnumerationAccess,
427 public css::text::XTextRangeMover,
428 public css::lang::XTypeProvider
429{
430 css::uno::Reference< css::text::XText > xParentText;
431
432protected:
434 SvxUnoTextBase(const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, css::uno::Reference < css::text::XText > const & xParent);
435 SvxUnoTextBase(const SvxUnoTextBase& rText);
436 virtual ~SvxUnoTextBase() noexcept override;
437
438public:
439 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
440
441 css::uno::Reference< css::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
442
443 // css::uno::XInterface
445 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType );
446
447 // css::text::XSimpleText
448 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor( ) override;
449 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
450 virtual void SAL_CALL insertString( const css::uno::Reference< css::text::XTextRange >& xRange, const OUString& aString, sal_Bool bAbsorb ) override;
451 virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
452
453 // css::text::XText
454 virtual void SAL_CALL insertTextContent( const css::uno::Reference< css::text::XTextRange >& xRange, const css::uno::Reference< css::text::XTextContent >& xContent, sal_Bool bAbsorb ) override;
455 virtual void SAL_CALL removeTextContent( const css::uno::Reference< css::text::XTextContent >& xContent ) override;
456 virtual OUString SAL_CALL getString() override;
457 virtual void SAL_CALL setString( const OUString& aString ) override;
458
459 // css::text::XTextRange
460 virtual css::uno::Reference< css::text::XText > SAL_CALL getText( ) override;
461 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
462 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
463
464 // css::container::XEnumerationAccess
465 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
466
467 // css::container::XElementAccess
468 virtual css::uno::Type SAL_CALL getElementType( ) override;
469 virtual sal_Bool SAL_CALL hasElements( ) override;
470
471 // css::text::XTextRangeMover
472 virtual void SAL_CALL moveTextRange( const css::uno::Reference< css::text::XTextRange >& xRange, sal_Int16 nParagraphs ) override;
473
474 // css::text::XParagraphAppend (new import API)
475 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL finishParagraph( const css::uno::Sequence< css::beans::PropertyValue >& CharacterAndParagraphProperties ) override;
476 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL finishParagraphInsert( const css::uno::Sequence< css::beans::PropertyValue >& CharacterAndParagraphProperties, const css::uno::Reference< css::text::XTextRange >& xInsertPosition ) override;
477
478 // css::text::XTextPortionAppend (new import API)
479 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL appendTextPortion( const OUString& Text, const css::uno::Sequence< css::beans::PropertyValue >& CharacterAndParagraphProperties ) override;
480
481 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL insertTextPortion( const OUString& Text, const css::uno::Sequence< css::beans::PropertyValue >& CharacterAndParagraphProperties, const css::uno::Reference< css::text::XTextRange>& rTextRange ) override;
482
483 // css::text::XTextCopy
484 virtual void SAL_CALL copyText( const css::uno::Reference< css::text::XTextCopy >& xSource ) override;
485
486 // css::lang::XServiceInfo
487 virtual OUString SAL_CALL getImplementationName() override;
488 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
489 static css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( );
490
491 // css::lang::XTypeProvider
492 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
493 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
494};
495
496
498 public ::cppu::OWeakAggObject
499{
500public:
501 SvxUnoText( const SvxItemPropertySet* _pSet ) noexcept;
502 SvxUnoText( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, css::uno::Reference < css::text::XText > const & xParent ) noexcept;
503 SvxUnoText( const SvxUnoText& rText ) noexcept;
504 virtual ~SvxUnoText() noexcept override;
505
506 // Internal
507 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept;
508 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
509
510 // css::uno::XInterface
511 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
512 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
513 virtual void SAL_CALL acquire() noexcept override;
514 virtual void SAL_CALL release() noexcept override;
515
516 // css::lang::XTypeProvider
517 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
518 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
519};
520
521
522class SvxUnoTextContent final : public SvxUnoTextRangeBase,
523 public css::text::XTextContent,
524 public css::container::XEnumerationAccess,
525 public css::lang::XTypeProvider,
526 public ::cppu::OWeakAggObject
527{
529private:
530 css::uno::Reference< css::text::XText > mxParentText;
531 sal_Int32 mnParagraph;
533
534 // for xComponent
538
539protected:
540 using SvxUnoTextRangeBase::setPropertyValue;
541 using SvxUnoTextRangeBase::getPropertyValue;
542
543public:
544 SvxUnoTextContent( const SvxUnoTextBase& rText, sal_Int32 nPara ) noexcept;
545 SvxUnoTextContent( const SvxUnoTextContent& rContent ) noexcept;
546 virtual ~SvxUnoTextContent() noexcept override;
547
548 // css::uno::XInterface
549 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
550 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
551 virtual void SAL_CALL acquire() noexcept override;
552 virtual void SAL_CALL release() noexcept override;
553
554 // css::text::XTextRange
555 virtual css::uno::Reference< css::text::XText > SAL_CALL getText( ) override;
556
557 // css::text::XTextContent -> css::lang::XComponent
558 virtual void SAL_CALL attach( const css::uno::Reference< css::text::XTextRange >& xTextRange ) override;
559 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor( ) override;
560
561 // css::lang::XComponent
562 virtual void SAL_CALL dispose() override;
563 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
564 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
565
566 // css::container::XEnumerationAccess
567 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
568
569 // css::container::XElementAccess
570 virtual css::uno::Type SAL_CALL getElementType() override;
571 virtual sal_Bool SAL_CALL hasElements() override;
572
573 // css::beans::XPropertySet
574 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
575 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
576
577 // XMultiPropertySet
578 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
579 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
580
581 // css::beans::XPropertyState
582 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
583 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
584 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
585
586 // css::lang::XServiceInfo
587 virtual OUString SAL_CALL getImplementationName() override;
588 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
589
590 // css::lang::XTypeProvider
591 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
592 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
593};
594
595
596class SvxUnoTextContentEnumeration final : public ::cppu::WeakAggImplHelper1< css::container::XEnumeration >
597{
598private:
599 css::uno::Reference< css::text::XText > mxParentText;
600 std::unique_ptr<SvxEditSource> mpEditSource;
602 std::vector< rtl::Reference<SvxUnoTextContent> > maContents;
603
604public:
605 SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText, const ESelection& rSel ) noexcept;
606 virtual ~SvxUnoTextContentEnumeration() noexcept override;
607
608 // css::container::XEnumeration
609 virtual sal_Bool SAL_CALL hasMoreElements( ) override;
610 virtual css::uno::Any SAL_CALL nextElement( ) override;
611};
612
613
614class SvxUnoTextRangeEnumeration final : public ::cppu::WeakAggImplHelper1< css::container::XEnumeration >
615{
616private:
617 std::unique_ptr<SvxEditSource> mpEditSource;
618 css::uno::Reference< css::text::XText > mxParentText;
619 std::vector< rtl::Reference<SvxUnoTextRange> > maPortions;
620 sal_uInt16 mnNextPortion;
621
622public:
623 SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rText, sal_Int32 nPara, const ESelection& rSel);
624 virtual ~SvxUnoTextRangeEnumeration() noexcept override;
625
626 // css::container::XEnumeration
627 virtual sal_Bool SAL_CALL hasMoreElements( ) override;
628 virtual css::uno::Any SAL_CALL nextElement( ) override;
629};
630
631
632class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextRangeBase,
633 public css::text::XTextCursor,
634 public css::lang::XTypeProvider,
635 public ::cppu::OWeakAggObject
636{
637private:
638 css::uno::Reference< css::text::XText > mxParentText;
639
640public:
641 SvxUnoTextCursor( const SvxUnoTextBase& rText ) noexcept;
642 SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) noexcept;
643 virtual ~SvxUnoTextCursor() noexcept override;
644
645 // css::uno::XInterface
646 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
647 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
648 virtual void SAL_CALL acquire() noexcept override;
649 virtual void SAL_CALL release() noexcept override;
650
651 // css::text::XTextRange
652 virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override;
653 virtual OUString SAL_CALL getString() override;
654 virtual void SAL_CALL setString( const OUString& aString ) override;
655 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
656 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
657
658 // css::text::XTextCursor -> css::text::XTextRange
659 virtual void SAL_CALL collapseToStart( ) override;
660 virtual void SAL_CALL collapseToEnd( ) override;
661 virtual sal_Bool SAL_CALL isCollapsed( ) override;
662 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) override;
663 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) override;
664 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) override;
665 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) override;
666 virtual void SAL_CALL gotoRange( const css::uno::Reference< css::text::XTextRange >& xRange, sal_Bool bExpand ) override;
667
668 // css::lang::XServiceInfo
669 virtual OUString SAL_CALL getImplementationName() override;
670 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
671 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
672
673 // css::lang::XTypeProvider
674 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
675 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
676
677};
678
683
684#endif
685
686/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual tools::Rectangle GetCharBounds(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the bounding rectangle of the given character.
Definition: unotext.cxx:2458
virtual void UpdateData() override
Write back data to model.
Definition: unotext.cxx:2340
virtual EBulletInfo GetBulletInfo(sal_Int32 nPara) const override
Query information regarding bullets for given paragraph on the underlying edit engine.
Definition: unotext.cxx:2453
virtual bool SetDepth(sal_Int32 nPara, sal_Int16 nNewDepth) override
Set the outline depth of given paragraph.
Definition: unotext.cxx:2523
virtual bool GetWordIndices(sal_Int32 nPara, sal_Int32 nIndex, sal_Int32 &nStart, sal_Int32 &nEnd) const override
Get the start and the end index of the word at the given index.
Definition: unotext.cxx:2483
virtual OUString GetText(const ESelection &rSel) const override
Definition: unotext.cxx:2354
virtual sal_Int32 GetFieldCount(sal_Int32 nPara) const override
Query number of fields in the underlying edit engine.
Definition: unotext.cxx:2443
virtual sal_Int32 GetLineCount(sal_Int32 nPara) const override
Query number of lines in the formatted paragraph.
Definition: unotext.cxx:2493
virtual MapMode GetMapMode() const override
Query the map mode of the underlying EditEngine/Outliner.
Definition: unotext.cxx:2468
virtual sal_Int32 AppendTextPortion(sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet) override
Definition: unotext.cxx:2547
virtual sal_Int16 GetDepth(sal_Int32 nPara) const override
Get the outline depth of given paragraph.
Definition: unotext.cxx:2518
virtual OutputDevice * GetRefDevice() const override
Query the reference output device of the underlying EditEngine/Outliner.
Definition: unotext.cxx:2473
virtual void AppendParagraph() override
Definition: unotext.cxx:2543
virtual void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList) const override
Definition: unotext.cxx:2380
virtual void QuickInsertLineBreak(const ESelection &rSel) override
Definition: unotext.cxx:2420
virtual bool Delete(const ESelection &) override
Delete given text range and reformat text.
Definition: unotext.cxx:2528
virtual const SfxItemSet * GetEmptyItemSetPtr() override
Definition: unotext.cxx:2538
virtual ~SvxDummyTextSource() override
Definition: unotext.cxx:2326
SfxItemState GetItemState(const ESelection &rSel, sal_uInt16 nWhich) const override
Definition: unotext.cxx:2393
virtual sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the line number for an index in the paragraphs text.
Definition: unotext.cxx:2508
virtual OUString GetStyleSheet(sal_Int32 nPara) const override
Definition: unotext.cxx:2384
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet) override
Definition: unotext.cxx:2372
virtual sal_Int32 GetTextLen(sal_Int32 nParagraph) const override
Definition: unotext.cxx:2349
virtual tools::Rectangle GetParaBounds(sal_Int32 nPara) const override
Query the bounding rectangle of the given paragraph.
Definition: unotext.cxx:2463
virtual SfxItemSet GetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib=EditEngineAttribs::All) const override
Definition: unotext.cxx:2359
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rpTxtColor, std::optional< Color > &rpFldColor, std::optional< FontLineStyle > &rpFldLineStyle) override
Definition: unotext.cxx:2424
virtual void FieldClicked(const SvxFieldItem &rField) override
Definition: unotext.cxx:2429
virtual bool IsValid() const override
Query state of forwarder.
Definition: unotext.cxx:2433
virtual bool InsertText(const OUString &, const ESelection &) override
Insert/Replace given text in given range and reformat text.
Definition: unotext.cxx:2533
virtual void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel) override
Definition: unotext.cxx:2416
virtual sal_Int32 GetParagraphCount() const override
Definition: unotext.cxx:2344
virtual void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel) override
Definition: unotext.cxx:2412
virtual bool GetIndexAtPoint(const Point &, sal_Int32 &nPara, sal_Int32 &nIndex) const override
Query paragraph and character index of the character at the given point.
Definition: unotext.cxx:2478
virtual void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const override
Query bounds of line in paragraph.
Definition: unotext.cxx:2503
virtual bool GetAttributeRun(sal_Int32 &nStartIndex, sal_Int32 &nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell=false) const override
Query range of similar attributes.
Definition: unotext.cxx:2488
virtual std::unique_ptr< SvxEditSource > Clone() const override
Returns a new reference to the same object. This is a shallow copy.
Definition: unotext.cxx:2330
virtual void QuickInsertText(const OUString &rText, const ESelection &rSel) override
Definition: unotext.cxx:2408
virtual bool QuickFormatDoc(bool bFull=false) override
Updates the formatting.
Definition: unotext.cxx:2513
virtual void RemoveAttribs(const ESelection &rSelection) override
Definition: unotext.cxx:2376
virtual void SetStyleSheet(sal_Int32 nPara, const OUString &rStyleName) override
Definition: unotext.cxx:2389
virtual sal_Int32 GetLineLen(sal_Int32 nPara, sal_Int32 nLine) const override
Query line length.
Definition: unotext.cxx:2498
virtual void CopyText(const SvxTextForwarder &rSource) override
Definition: unotext.cxx:2552
virtual LanguageType GetLanguage(sal_Int32, sal_Int32) const override
Query language of character at given position on the underlying edit engine.
Definition: unotext.cxx:2438
virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const override
Definition: unotext.cxx:2367
virtual SfxItemPool * GetPool() const override
Definition: unotext.cxx:2403
virtual SvxTextForwarder * GetTextForwarder() override
Query the text forwarder.
Definition: unotext.cxx:2335
virtual EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const override
Query information for given field number in the underlying edit engine.
Definition: unotext.cxx:2448
Wrapper class for unified EditEngine/Outliner access.
Definition: unoedsrc.hxx:56
This item stores a field (SvxFieldData).
Definition: flditem.hxx:70
Contains an EditEngine or an Outliner and unifies access to them.
Definition: unoedsrc.hxx:142
css::uno::Reference< css::text::XText > xParentText
Definition: unotext.hxx:430
SvxUnoTextBase(const SvxEditSource *pSource, const SvxItemPropertySet *_pSet, css::uno::Reference< css::text::XText > const &xParent)
SvxUnoTextContentEnumeration(const SvxUnoTextBase &_rText, const ESelection &rSel) noexcept
Definition: unotext2.cxx:43
std::vector< rtl::Reference< SvxUnoTextContent > > maContents
Definition: unotext.hxx:602
std::unique_ptr< SvxEditSource > mpEditSource
Definition: unotext.hxx:600
virtual css::uno::Any SAL_CALL nextElement() override
Definition: unotext2.cxx:105
virtual sal_Bool SAL_CALL hasMoreElements() override
Definition: unotext2.cxx:96
virtual ~SvxUnoTextContentEnumeration() noexcept override
Definition: unotext2.cxx:91
css::uno::Reference< css::text::XText > mxParentText
Definition: unotext.hxx:599
const SvxUnoTextBase & mrParentText
Definition: unotext.hxx:532
sal_Int32 mnParagraph
Definition: unotext.hxx:531
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maDisposeListeners
Definition: unotext.hxx:536
css::uno::Reference< css::text::XText > mxParentText
Definition: unotext.hxx:530
std::mutex maDisposeContainerMutex
Definition: unotext.hxx:535
css::uno::Reference< css::text::XText > mxParentText
Definition: unotext.hxx:638
std::vector< rtl::Reference< SvxUnoTextRange > > maPortions
Definition: unotext.hxx:619
css::uno::Reference< css::text::XText > mxParentText
Definition: unotext.hxx:618
std::unique_ptr< SvxEditSource > mpEditSource
Definition: unotext.hxx:617
css::uno::Reference< css::text::XText > xParentText
Definition: unotext.hxx:399
SvxUnoText(const SvxEditSource *pSource, const SvxItemPropertySet *_pSet, css::uno::Reference< css::text::XText > const &xParent) noexcept
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
class SAL_WARN_UNUSED SAL_LOPLUGIN_ANNOTATE("crosscast") SwContentIndexReg
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
EditEngineAttribs
values for: SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEn...
sal_Int32 nIndex
sal_uInt16 nPos
OUString getString(const Any &_rAny)
css::uno::Sequence< OUString > getSupportedServiceNames()
Type
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
SfxItemState
#define UNO3_GETIMPLEMENTATION_DECL(classname)
static SfxItemSet & rSet
unsigned char sal_Bool
signed char sal_Int8
o3tl::span< const SfxItemPropertyMapEntry > ImplGetSvxTextPortionPropertyMap()
Definition: unotext.cxx:82
EDITENG_DLLPUBLIC const SvxItemPropertySet * ImplGetSvxUnoOutlinerTextCursorSvxPropertySet()
Definition: unotext.cxx:76
const SvxItemPropertySet * ImplGetSvxTextPortionSvxPropertySet()
Definition: unotext.cxx:98
EDITENG_DLLPUBLIC void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept
Definition: unotext.cxx:135
EDITENG_DLLPUBLIC void CheckSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept
Definition: unotext.cxx:148
o3tl::span< const SfxItemPropertyMapEntry > ImplGetSvxUnoOutlinerTextCursorPropertyMap()
Definition: unotext.cxx:110