Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / editeng / unotext.hxx
bloba027e331ae004a80e4bdde6054a472cef7934a89
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_EDITENG_UNOTEXT_HXX
21 #define INCLUDED_EDITENG_UNOTEXT_HXX
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>
45 #include <comphelper/interfacecontainer4.hxx>
46 #include <cppuhelper/implbase1.hxx>
47 #include <cppuhelper/weakagg.hxx>
48 #include <osl/diagnose.hxx>
49 #include <o3tl/span.hxx>
50 #include <mutex>
51 #include <comphelper/servicehelper.hxx>
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>
57 #include <editeng/editengdllapi.h>
58 #include <editeng/memberids.h>
60 class SvxItemPropertySet;
61 struct SfxItemPropertyMapEntry;
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
68 #define SVX_UNOEDIT_NUMBERING_PROPERTY \
69 { UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 }, \
70 { UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 }
72 #define SVX_UNOEDIT_OUTLINER_PROPERTIES \
73 SVX_UNOEDIT_NUMBERING_PROPERTY, \
74 { UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
75 {u"NumberingStartValue", WID_NUMBERINGSTARTVALUE, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
76 {u"ParaIsNumberingRestart", WID_PARAISNUMBERINGRESTART, cppu::UnoType<bool>::get(), 0, 0 }
78 #define SVX_UNOEDIT_CHAR_PROPERTIES \
79 { UNO_NAME_EDIT_CHAR_HEIGHT, EE_CHAR_FONTHEIGHT, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
80 { u"CharScaleWidth", EE_CHAR_FONTWIDTH, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
81 { UNO_NAME_EDIT_CHAR_FONTNAME, EE_CHAR_FONTINFO, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
82 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME,EE_CHAR_FONTINFO, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
83 { UNO_NAME_EDIT_CHAR_FONTFAMILY, EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
84 { UNO_NAME_EDIT_CHAR_FONTCHARSET, EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
85 { UNO_NAME_EDIT_CHAR_FONTPITCH, EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
86 { UNO_NAME_EDIT_CHAR_POSTURE, EE_CHAR_ITALIC, ::cppu::UnoType<css::awt::FontSlant>::get(),0, MID_POSTURE }, \
87 { UNO_NAME_EDIT_CHAR_WEIGHT, EE_CHAR_WEIGHT, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
88 { UNO_NAME_EDIT_CHAR_LOCALE, EE_CHAR_LANGUAGE, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
89 { UNO_NAME_EDIT_CHAR_COLOR, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, MID_COLOR_RGB }, \
90 { UNO_NAME_EDIT_CHAR_TRANSPARENCE,EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_ALPHA }, \
91 { UNO_NAME_EDIT_CHAR_COLOR_THEME, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_THEME_INDEX }, \
92 { UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_TINT_OR_SHADE }, \
93 { UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_MOD }, \
94 { UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_OFF }, \
95 { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, EE_CHAR_COLOR, ::cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR }, \
96 { UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR, EE_CHAR_BKGCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, MID_COLOR_RGB }, \
97 { UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR, EE_CHAR_BKGCOLOR, ::cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR }, \
98 { UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT, EE_CHAR_BKGCOLOR, ::cppu::UnoType<bool>::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
99 { UNO_NAME_EDIT_CHAR_ESCAPEMENT, EE_CHAR_ESCAPEMENT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_ESC }, \
100 { UNO_NAME_EDIT_CHAR_UNDERLINE, EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
101 { u"CharUnderlineColor", EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
102 { u"CharUnderlineHasColor", EE_CHAR_UNDERLINE, cppu::UnoType<bool>::get(), 0, MID_TL_HASCOLOR } , \
103 { UNO_NAME_EDIT_CHAR_OVERLINE, EE_CHAR_OVERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
104 { u"CharOverlineColor", EE_CHAR_OVERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
105 { u"CharOverlineHasColor", EE_CHAR_OVERLINE, cppu::UnoType<bool>::get(), 0, MID_TL_HASCOLOR } , \
106 { UNO_NAME_EDIT_CHAR_CROSSEDOUT, EE_CHAR_STRIKEOUT, cppu::UnoType<bool>::get(), 0, MID_CROSSED_OUT }, \
107 { UNO_NAME_EDIT_CHAR_STRIKEOUT, EE_CHAR_STRIKEOUT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_CROSS_OUT}, \
108 { UNO_NAME_EDIT_CHAR_CASEMAP, EE_CHAR_CASEMAP, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
109 { UNO_NAME_EDIT_CHAR_SHADOWED, EE_CHAR_SHADOW, cppu::UnoType<bool>::get(), 0, 0 }, \
110 { u"CharContoured", EE_CHAR_OUTLINE, cppu::UnoType<bool>::get(), 0, 0 }, \
111 { u"CharEscapementHeight", EE_CHAR_ESCAPEMENT, cppu::UnoType<sal_Int8>::get(), 0, MID_ESC_HEIGHT },\
112 { u"CharAutoKerning", EE_CHAR_PAIRKERNING,cppu::UnoType<bool>::get(), 0, 0 } , \
113 { u"CharKerning", EE_CHAR_KERNING, ::cppu::UnoType<sal_Int16>::get() , 0, 0 }, \
114 { u"CharWordMode", EE_CHAR_WLM, cppu::UnoType<bool>::get(), 0, 0 }, \
115 { u"CharEmphasis", EE_CHAR_EMPHASISMARK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_EMPHASIS},\
116 { UNO_NAME_EDIT_CHAR_HEIGHT_ASIAN, EE_CHAR_FONTHEIGHT_CJK, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
117 { UNO_NAME_EDIT_CHAR_FONTNAME_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
118 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
119 { UNO_NAME_EDIT_CHAR_FONTFAMILY_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
120 { UNO_NAME_EDIT_CHAR_FONTCHARSET_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
121 { UNO_NAME_EDIT_CHAR_FONTPITCH_ASIAN, EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
122 { UNO_NAME_EDIT_CHAR_POSTURE_ASIAN, EE_CHAR_ITALIC_CJK, ::cppu::UnoType<css::awt::FontSlant>::get(),0, MID_POSTURE }, \
123 { UNO_NAME_EDIT_CHAR_WEIGHT_ASIAN, EE_CHAR_WEIGHT_CJK, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
124 { UNO_NAME_EDIT_CHAR_LOCALE_ASIAN, EE_CHAR_LANGUAGE_CJK, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
125 { UNO_NAME_EDIT_CHAR_HEIGHT_COMPLEX, EE_CHAR_FONTHEIGHT_CTL, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
126 { UNO_NAME_EDIT_CHAR_FONTNAME_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
127 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME_COMPLEX,EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
128 { UNO_NAME_EDIT_CHAR_FONTFAMILY_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
129 { UNO_NAME_EDIT_CHAR_FONTCHARSET_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
130 { UNO_NAME_EDIT_CHAR_FONTPITCH_COMPLEX, EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
131 { UNO_NAME_EDIT_CHAR_POSTURE_COMPLEX, EE_CHAR_ITALIC_CTL, ::cppu::UnoType<css::awt::FontSlant>::get(),0, MID_POSTURE }, \
132 { UNO_NAME_EDIT_CHAR_WEIGHT_COMPLEX, EE_CHAR_WEIGHT_CTL, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
133 { UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX, EE_CHAR_LANGUAGE_CTL, ::cppu::UnoType<css::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
134 { u"CharRelief", EE_CHAR_RELIEF, ::cppu::UnoType<sal_Int16>::get(), 0, MID_RELIEF }, \
135 { u"CharInteropGrabBag", EE_CHAR_GRABBAG, cppu::UnoType<css::uno::Sequence<css::beans::PropertyValue >>::get(), 0, 0}
138 #define SVX_UNOEDIT_FONT_PROPERTIES \
139 { UNO_NAME_EDIT_FONT_DESCRIPTOR, WID_FONTDESC, cppu::UnoType<css::awt::FontDescriptor>::get(), 0, MID_FONT_FAMILY_NAME }
141 #define SVX_UNOEDIT_PARA_PROPERTIES \
142 { UNO_NAME_EDIT_PARA_ADJUST, EE_PARA_JUST, ::cppu::UnoType<sal_Int16>::get(), 0, MID_PARA_ADJUST }, \
143 { UNO_NAME_EDIT_PARA_BMARGIN, EE_PARA_ULSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_LO_MARGIN, PropertyMoreFlags::METRIC_ITEM }, \
144 { UNO_NAME_EDIT_PARA_IS_HYPHEN, EE_PARA_HYPHENATE, ::cppu::UnoType<bool>::get(), 0, 0 }, \
145 {u"ParaHyphenationNoCaps", EE_PARA_HYPHENATE_NO_CAPS, ::cppu::UnoType<bool>::get(), 0, 0 }, \
146 {u"ParaHyphenationNoLastWord", EE_PARA_HYPHENATE_NO_LAST_WORD, ::cppu::UnoType<bool>::get(), 0, 0 }, \
147 { UNO_NAME_EDIT_PARA_LASTLINEADJ, EE_PARA_JUST, ::cppu::UnoType<sal_Int16>::get(), 0, MID_LAST_LINE_ADJUST }, \
148 { UNO_NAME_EDIT_PARA_LMARGIN, EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TXT_LMARGIN, PropertyMoreFlags::METRIC_ITEM }, \
149 { UNO_NAME_EDIT_PARA_LINESPACING, EE_PARA_SBL, cppu::UnoType<css::style::LineSpacing>::get(), 0, CONVERT_TWIPS}, \
150 { UNO_NAME_EDIT_PARA_RMARGIN, EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_R_MARGIN, PropertyMoreFlags::METRIC_ITEM }, \
151 { UNO_NAME_EDIT_PARA_TABSTOPS, EE_PARA_TABS, cppu::UnoType<css::uno::Sequence< css::style::TabStop >>::get(), 0, 0 }, \
152 { UNO_NAME_EDIT_PARA_TABSTOP_DEFAULT_DISTANCE, EE_PARA_TABS, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TABSTOP_DEFAULT_DISTANCE }, \
153 { UNO_NAME_EDIT_PARA_TMARGIN, EE_PARA_ULSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_UP_MARGIN, PropertyMoreFlags::METRIC_ITEM },\
154 { UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT, EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_FIRST_LINE_INDENT, PropertyMoreFlags::METRIC_ITEM}, \
155 { UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION,EE_PARA_HANGINGPUNCTUATION, cppu::UnoType<bool>::get(), 0 ,0 }, \
156 { UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE, EE_PARA_ASIANCJKSPACING, cppu::UnoType<bool>::get(), 0 ,0 }, \
157 { UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES, EE_PARA_FORBIDDENRULES, cppu::UnoType<bool>::get(), 0 ,0 },\
158 {u"WritingMode", EE_PARA_WRITINGDIR, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }
160 class SvxFieldItem;
161 class SvxFieldData;
163 EDITENG_DLLPUBLIC void GetSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarder ) noexcept;
164 EDITENG_DLLPUBLIC void CheckSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarder ) noexcept;
167 // This class implements a SvxEditSource and SvxTextForwarder and does
168 // nothing otherwise
171 class SvxDummyTextSource final : public SvxEditSource, public SvxTextForwarder
173 public:
175 // SvxEditSource
176 virtual ~SvxDummyTextSource() override;
177 virtual std::unique_ptr<SvxEditSource> Clone() const override;
178 virtual SvxTextForwarder* GetTextForwarder() override;
179 virtual void UpdateData() override;
181 // SvxTextForwarder
182 virtual sal_Int32 GetParagraphCount() const override;
183 virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override;
184 virtual OUString GetText( const ESelection& rSel ) const override;
185 virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override;
186 virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override;
187 virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override;
188 virtual void RemoveAttribs( const ESelection& rSelection ) override;
189 virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const override;
191 SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override;
192 SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const override;
194 virtual SfxItemPool* GetPool() const override;
196 virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) override;
197 virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) override;
198 virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) override;
199 virtual void QuickInsertLineBreak( const ESelection& rSel ) override;
201 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;
202 virtual void FieldClicked( const SvxFieldItem& rField ) override;
204 virtual bool IsValid() const override;
206 virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override;
207 virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override;
208 virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override;
209 virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override;
210 virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override;
211 virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override;
212 virtual MapMode GetMapMode() const override;
213 virtual OutputDevice* GetRefDevice() const override;
214 virtual bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_Int32& nIndex ) const override;
215 virtual bool GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const override;
216 virtual bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell = false ) const override;
217 virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const override;
218 virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const override;
219 virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const override;
220 virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const override;
221 virtual bool Delete( const ESelection& ) override;
222 virtual bool InsertText( const OUString&, const ESelection& ) override;
223 virtual bool QuickFormatDoc( bool bFull = false ) override;
224 virtual sal_Int16 GetDepth( sal_Int32 nPara ) const override;
225 virtual bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) override;
227 virtual const SfxItemSet* GetEmptyItemSetPtr() override;
229 // implementation functions for XParagraphAppend and XTextPortionAppend
230 virtual void AppendParagraph() override;
231 virtual sal_Int32 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) override;
232 //XTextCopy
233 virtual void CopyText(const SvxTextForwarder& rSource) override;
236 namespace accessibility
238 class AccessibleEditableTextPara;
242 class EDITENG_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") SvxUnoTextRangeBase :
243 public css::text::XTextRange,
244 public css::beans::XPropertySet,
245 public css::beans::XMultiPropertySet,
246 public css::beans::XMultiPropertyStates,
247 public css::beans::XPropertyState,
248 public css::lang::XServiceInfo,
249 public css::text::XTextRangeCompare,
250 public css::lang::XUnoTunnel,
251 private osl::DebugBase<SvxUnoTextRangeBase>
254 friend class SvxUnoTextRangeEnumeration;
255 friend class ::accessibility::AccessibleEditableTextPara;
256 const SvxItemPropertySet* mpPropSet;
258 protected:
259 std::unique_ptr<SvxEditSource> mpEditSource;
260 ESelection maSelection;
262 /// @throws css::beans::UnknownPropertyException
263 /// @throws css::beans::PropertyVetoException
264 /// @throws css::lang::IllegalArgumentException
265 /// @throws css::lang::WrappedTargetException
266 /// @throws css::uno::RuntimeException
267 void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue, sal_Int32 nPara = -1 );
268 /// @throws css::beans::UnknownPropertyException
269 /// @throws css::lang::WrappedTargetException
270 /// @throws css::uno::RuntimeException
271 css::uno::Any _getPropertyValue( const OUString& PropertyName, sal_Int32 nPara = -1 );
273 /// @throws css::beans::PropertyVetoException
274 /// @throws css::lang::IllegalArgumentException
275 /// @throws css::lang::WrappedTargetException
276 /// @throws css::uno::RuntimeException
277 void _setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues, sal_Int32 nPara = -1 );
278 /// @throws css::uno::RuntimeException
279 css::uno::Sequence< css::uno::Any > _getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, sal_Int32 nPara = -1 );
281 /// @throws css::beans::UnknownPropertyException
282 /// @throws css::uno::RuntimeException
283 css::beans::PropertyState _getPropertyState( const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara = -1 );
284 /// @throws css::beans::UnknownPropertyException
285 /// @throws css::uno::RuntimeException
286 css::beans::PropertyState _getPropertyState( std::u16string_view PropertyName, sal_Int32 nPara = -1 );
287 /// @throws css::beans::UnknownPropertyException
288 /// @throws css::uno::RuntimeException
289 css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 );
290 // returns true if property found or false if unknown property
291 static bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertyMapEntry* pMap, css::beans::PropertyState& rState);
293 /// @throws css::beans::UnknownPropertyException
294 /// @throws css::uno::RuntimeException
295 void _setPropertyToDefault( const OUString& PropertyName, sal_Int32 nPara = -1 );
296 /// @throws css::beans::UnknownPropertyException
297 /// @throws css::uno::RuntimeException
298 void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara );
299 void SetEditSource( SvxEditSource* _pEditSource ) noexcept;
301 /// @throws css::beans::UnknownPropertyException
302 /// @throws css::uno::RuntimeException
303 void getPropertyValue( const SfxItemPropertyMapEntry* pMap, css::uno::Any& rAny, const SfxItemSet& rSet );
304 /// @throws css::beans::UnknownPropertyException
305 /// @throws css::lang::IllegalArgumentException
306 void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet );
308 SvxUnoTextRangeBase(const SvxItemPropertySet* _pSet);
309 SvxUnoTextRangeBase(const SvxEditSource* pSource, const SvxItemPropertySet* _pSet);
310 SvxUnoTextRangeBase(const SvxUnoTextRangeBase& rRange);
311 virtual ~SvxUnoTextRangeBase() noexcept;
313 public:
314 // Internal
315 const ESelection& GetSelection() const noexcept
317 const SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
318 CheckSelection(const_cast<SvxUnoTextRangeBase*>(this)->maSelection, pForwarder);
319 return maSelection;
321 void SetSelection( const ESelection& rSelection ) noexcept;
323 void CollapseToStart() noexcept;
324 void CollapseToEnd() noexcept;
325 bool IsCollapsed() noexcept;
326 bool GoLeft(sal_Int32 nCount, bool Expand) noexcept;
327 bool GoRight(sal_Int32 nCount, bool Expand) noexcept;
328 void GotoStart(bool Expand) noexcept;
329 void GotoEnd(bool Expand) noexcept;
331 //const SfxItemPropertyMapEntry* getPropertyMapEntries() const throw() { return maPropSet.getPropertyMapEntries(); }
332 const SvxItemPropertySet* getPropertySet() const noexcept { return mpPropSet; }
333 SvxEditSource* GetEditSource() const noexcept { return mpEditSource.get(); }
335 static bool SetPropertyValueHelper( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr );
336 /// @throws css::uno::RuntimeException
337 static bool GetPropertyValueHelper( SfxItemSet const & rSet, const SfxItemPropertyMapEntry* pMap, css::uno::Any& aAny, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr );
339 void attachField( std::unique_ptr<SvxFieldData> pData ) noexcept;
341 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextRangeBase )
343 // css::text::XTextRange
344 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
345 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
346 virtual OUString SAL_CALL getString() override;
347 virtual void SAL_CALL setString( const OUString& aString ) override;
349 // css::beans::XPropertySet
350 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
351 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
352 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
353 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
354 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
355 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
356 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
358 // XMultiPropertySet
359 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
360 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
361 virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
362 virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
363 virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
365 // css::beans::XPropertyState
366 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
367 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
368 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
369 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
371 // css::beans::XMultiPropertyStates
372 //virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
373 virtual void SAL_CALL setAllPropertiesToDefault() override;
374 virtual void SAL_CALL setPropertiesToDefault( const css::uno::Sequence< OUString >& aPropertyNames ) override;
375 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults( const css::uno::Sequence< OUString >& aPropertyNames ) override;
377 // XTextRangeCompare
378 virtual ::sal_Int16 SAL_CALL compareRegionStarts( const css::uno::Reference< css::text::XTextRange >& xR1, const css::uno::Reference< css::text::XTextRange >& xR2 ) override;
379 virtual ::sal_Int16 SAL_CALL compareRegionEnds( const css::uno::Reference< css::text::XTextRange >& xR1, const css::uno::Reference< css::text::XTextRange >& xR2 ) override;
381 // css::lang::XServiceInfo
382 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
383 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
384 static css::uno::Sequence< OUString > getSupportedServiceNames_Static( );
388 class SvxUnoTextBase;
389 class EDITENG_DLLPUBLIC SvxUnoTextRange final : public SvxUnoTextRangeBase,
390 public css::lang::XTypeProvider,
391 public ::cppu::OWeakAggObject
393 friend class SvxUnoTextRangeEnumeration;
394 private:
395 css::uno::Reference< css::text::XText > xParentText;
396 bool mbPortion;
398 public:
399 SvxUnoTextRange(const SvxUnoTextBase& rParent, bool bPortion = false);
400 virtual ~SvxUnoTextRange() noexcept override;
402 // css::uno::XInterface
403 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
404 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
405 virtual void SAL_CALL acquire() noexcept override;
406 virtual void SAL_CALL release() noexcept override;
408 // css::text::XTextRange
409 virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override;
411 // css::lang::XServiceInfo
412 virtual OUString SAL_CALL getImplementationName() override;
414 // css::lang::XTypeProvider
415 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
416 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
419 class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextRangeBase,
420 public css::text::XTextAppend,
421 public css::text::XTextCopy,
422 public css::container::XEnumerationAccess,
423 public css::text::XTextRangeMover,
424 public css::lang::XTypeProvider
426 css::uno::Reference< css::text::XText > xParentText;
428 protected:
429 SvxUnoTextBase(const SvxItemPropertySet* _pSet);
430 SvxUnoTextBase(const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, css::uno::Reference < css::text::XText > const & xParent);
431 SvxUnoTextBase(const SvxUnoTextBase& rText);
432 virtual ~SvxUnoTextBase() noexcept override;
434 public:
435 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
437 css::uno::Reference< css::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
439 // css::uno::XInterface
440 /// @throws css::uno::RuntimeException
441 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType );
443 // css::text::XSimpleText
444 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor( ) override;
445 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
446 virtual void SAL_CALL insertString( const css::uno::Reference< css::text::XTextRange >& xRange, const OUString& aString, sal_Bool bAbsorb ) override;
447 virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
449 // css::text::XText
450 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;
451 virtual void SAL_CALL removeTextContent( const css::uno::Reference< css::text::XTextContent >& xContent ) override;
452 virtual OUString SAL_CALL getString() override;
453 virtual void SAL_CALL setString( const OUString& aString ) override;
455 // css::text::XTextRange
456 virtual css::uno::Reference< css::text::XText > SAL_CALL getText( ) override;
457 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
458 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
460 // css::container::XEnumerationAccess
461 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
463 // css::container::XElementAccess
464 virtual css::uno::Type SAL_CALL getElementType( ) override;
465 virtual sal_Bool SAL_CALL hasElements( ) override;
467 // css::text::XTextRangeMover
468 virtual void SAL_CALL moveTextRange( const css::uno::Reference< css::text::XTextRange >& xRange, sal_Int16 nParagraphs ) override;
470 // css::text::XParagraphAppend (new import API)
471 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL finishParagraph( const css::uno::Sequence< css::beans::PropertyValue >& CharacterAndParagraphProperties ) override;
472 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;
474 // css::text::XTextPortionAppend (new import API)
475 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL appendTextPortion( const OUString& Text, const css::uno::Sequence< css::beans::PropertyValue >& CharacterAndParagraphProperties ) override;
477 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;
479 // css::text::XTextCopy
480 virtual void SAL_CALL copyText( const css::uno::Reference< css::text::XTextCopy >& xSource ) override;
482 // css::lang::XServiceInfo
483 virtual OUString SAL_CALL getImplementationName() override;
484 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
485 static css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( );
487 // css::lang::XTypeProvider
488 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
489 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
493 class EDITENG_DLLPUBLIC SvxUnoText : public SvxUnoTextBase,
494 public ::cppu::OWeakAggObject
496 public:
497 SvxUnoText( const SvxItemPropertySet* _pSet ) noexcept;
498 SvxUnoText( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, css::uno::Reference < css::text::XText > const & xParent ) noexcept;
499 SvxUnoText( const SvxUnoText& rText ) noexcept;
500 virtual ~SvxUnoText() noexcept override;
502 // Internal
503 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept;
504 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
506 // css::uno::XInterface
507 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
508 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
509 virtual void SAL_CALL acquire() noexcept override;
510 virtual void SAL_CALL release() noexcept override;
512 // css::lang::XTypeProvider
513 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
514 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
518 class SvxUnoTextContent final : public SvxUnoTextRangeBase,
519 public css::text::XTextContent,
520 public css::container::XEnumerationAccess,
521 public css::lang::XTypeProvider,
522 public ::cppu::OWeakAggObject
524 friend class SvxUnoTextContentEnumeration;
525 private:
526 css::uno::Reference< css::text::XText > mxParentText;
527 sal_Int32 mnParagraph;
528 const SvxUnoTextBase& mrParentText;
530 // for xComponent
531 std::mutex maDisposeContainerMutex;
532 ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> maDisposeListeners;
533 bool mbDisposing;
535 protected:
536 using SvxUnoTextRangeBase::setPropertyValue;
537 using SvxUnoTextRangeBase::getPropertyValue;
539 public:
540 SvxUnoTextContent( const SvxUnoTextBase& rText, sal_Int32 nPara ) noexcept;
541 SvxUnoTextContent( const SvxUnoTextContent& rContent ) noexcept;
542 virtual ~SvxUnoTextContent() noexcept override;
544 // css::uno::XInterface
545 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
546 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
547 virtual void SAL_CALL acquire() noexcept override;
548 virtual void SAL_CALL release() noexcept override;
550 // css::text::XTextRange
551 virtual css::uno::Reference< css::text::XText > SAL_CALL getText( ) override;
553 // css::text::XTextContent -> css::lang::XComponent
554 virtual void SAL_CALL attach( const css::uno::Reference< css::text::XTextRange >& xTextRange ) override;
555 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor( ) override;
557 // css::lang::XComponent
558 virtual void SAL_CALL dispose() override;
559 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
560 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
562 // css::container::XEnumerationAccess
563 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
565 // css::container::XElementAccess
566 virtual css::uno::Type SAL_CALL getElementType() override;
567 virtual sal_Bool SAL_CALL hasElements() override;
569 // css::beans::XPropertySet
570 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
571 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
573 // XMultiPropertySet
574 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
575 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
577 // css::beans::XPropertyState
578 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
579 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
580 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
582 // css::lang::XServiceInfo
583 virtual OUString SAL_CALL getImplementationName() override;
584 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
586 // css::lang::XTypeProvider
587 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
588 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
592 class SvxUnoTextContentEnumeration final : public ::cppu::WeakAggImplHelper1< css::container::XEnumeration >
594 private:
595 css::uno::Reference< css::text::XText > mxParentText;
596 std::unique_ptr<SvxEditSource> mpEditSource;
597 sal_Int32 mnNextParagraph;
598 std::vector< rtl::Reference<SvxUnoTextContent> > maContents;
600 public:
601 SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText, const ESelection& rSel ) noexcept;
602 virtual ~SvxUnoTextContentEnumeration() noexcept override;
604 // css::container::XEnumeration
605 virtual sal_Bool SAL_CALL hasMoreElements( ) override;
606 virtual css::uno::Any SAL_CALL nextElement( ) override;
610 class SvxUnoTextRangeEnumeration final : public ::cppu::WeakAggImplHelper1< css::container::XEnumeration >
612 private:
613 std::unique_ptr<SvxEditSource> mpEditSource;
614 css::uno::Reference< css::text::XText > mxParentText;
615 std::vector< rtl::Reference<SvxUnoTextRange> > maPortions;
616 sal_uInt16 mnNextPortion;
618 public:
619 SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rText, sal_Int32 nPara, const ESelection& rSel);
620 virtual ~SvxUnoTextRangeEnumeration() noexcept override;
622 // css::container::XEnumeration
623 virtual sal_Bool SAL_CALL hasMoreElements( ) override;
624 virtual css::uno::Any SAL_CALL nextElement( ) override;
628 class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextRangeBase,
629 public css::text::XTextCursor,
630 public css::lang::XTypeProvider,
631 public ::cppu::OWeakAggObject
633 private:
634 css::uno::Reference< css::text::XText > mxParentText;
636 public:
637 SvxUnoTextCursor( const SvxUnoTextBase& rText ) noexcept;
638 SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) noexcept;
639 virtual ~SvxUnoTextCursor() noexcept override;
641 // css::uno::XInterface
642 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
643 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
644 virtual void SAL_CALL acquire() noexcept override;
645 virtual void SAL_CALL release() noexcept override;
647 // css::text::XTextRange
648 virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override;
649 virtual OUString SAL_CALL getString() override;
650 virtual void SAL_CALL setString( const OUString& aString ) override;
651 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
652 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
654 // css::text::XTextCursor -> css::text::XTextRange
655 virtual void SAL_CALL collapseToStart( ) override;
656 virtual void SAL_CALL collapseToEnd( ) override;
657 virtual sal_Bool SAL_CALL isCollapsed( ) override;
658 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) override;
659 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) override;
660 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) override;
661 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) override;
662 virtual void SAL_CALL gotoRange( const css::uno::Reference< css::text::XTextRange >& xRange, sal_Bool bExpand ) override;
664 // css::lang::XServiceInfo
665 virtual OUString SAL_CALL getImplementationName() override;
666 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
667 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
669 // css::lang::XTypeProvider
670 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
671 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
675 EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
676 o3tl::span<const SfxItemPropertyMapEntry> ImplGetSvxUnoOutlinerTextCursorPropertyMap();
677 const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
678 o3tl::span<const SfxItemPropertyMapEntry> ImplGetSvxTextPortionPropertyMap();
680 #endif
682 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */