Branch libreoffice-5-0-4
[LibreOffice.git] / include / editeng / unotext.hxx
blob2bc45c24e28ebc032224bb0a9f802e5d2be4faca
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 <com/sun/star/container/XNameContainer.hpp>
24 #include <com/sun/star/text/XTextRange.hpp>
25 #include <com/sun/star/text/XText.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/PropertyAttribute.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/beans/XPropertyState.hpp>
34 #include <com/sun/star/beans/XMultiPropertySet.hpp>
35 #include <com/sun/star/text/XTextRangeCompare.hpp>
36 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
37 #include <com/sun/star/text/XTextAppend.hpp>
38 #include <com/sun/star/text/XTextCopy.hpp>
39 #include <com/sun/star/text/XTextField.hpp>
40 #include <com/sun/star/container/XIndexReplace.hpp>
41 #include <com/sun/star/awt/FontSlant.hpp>
42 #include <com/sun/star/awt/FontDescriptor.hpp>
43 #include <com/sun/star/style/LineSpacing.hpp>
44 #include <com/sun/star/style/TabStop.hpp>
45 #include <com/sun/star/lang/XUnoTunnel.hpp>
46 #include <cppuhelper/interfacecontainer.h>
47 #include <cppuhelper/weak.hxx>
48 #include <cppuhelper/weakagg.hxx>
49 #include <osl/diagnose.hxx>
50 #include <osl/mutex.hxx>
51 #include <comphelper/servicehelper.hxx>
52 #include <tools/link.hxx>
53 #include <svl/itemprop.hxx>
54 #include <svl/itemset.hxx>
55 #include <svl/itempool.hxx>
56 #include <svl/solar.hrc>
57 #include <editeng/editdata.hxx>
58 #include <editeng/unoedsrc.hxx>
59 #include <editeng/eeitem.hxx>
60 #include <editeng/editengdllapi.h>
61 #include <editeng/memberids.hrc>
63 class SvxItemPropertySet;
65 #define WID_FONTDESC OWN_ATTR_VALUE_START
66 #define WID_NUMLEVEL OWN_ATTR_VALUE_START+1
67 #define WID_PORTIONTYPE OWN_ATTR_VALUE_START+2
68 #define WID_NUMBERINGSTARTVALUE OWN_ATTR_VALUE_START+3
69 #define WID_PARAISNUMBERINGRESTART OWN_ATTR_VALUE_START+4
71 #define SVX_UNOEDIT_NUMBERING_PROPERTIE \
72 {OUString(UNO_NAME_NUMBERING_RULES), EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 }, \
73 {OUString(UNO_NAME_NUMBERING), EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 }
75 #define SVX_UNOEDIT_OUTLINER_PROPERTIES \
76 SVX_UNOEDIT_NUMBERING_PROPERTIE, \
77 {OUString(UNO_NAME_NUMBERING_LEVEL), WID_NUMLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
78 {OUString("NumberingStartValue"), WID_NUMBERINGSTARTVALUE, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
79 {OUString("ParaIsNumberingRestart"), WID_PARAISNUMBERINGRESTART, cppu::UnoType<bool>::get(), 0, 0 }
81 #define SVX_UNOEDIT_CHAR_PROPERTIES \
82 { OUString(UNO_NAME_EDIT_CHAR_HEIGHT), EE_CHAR_FONTHEIGHT, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
83 { OUString("CharScaleWidth"), EE_CHAR_FONTWIDTH, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
84 { OUString(UNO_NAME_EDIT_CHAR_FONTNAME), EE_CHAR_FONTINFO, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
85 { OUString(UNO_NAME_EDIT_CHAR_FONTSTYLENAME),EE_CHAR_FONTINFO, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
86 { OUString(UNO_NAME_EDIT_CHAR_FONTFAMILY), EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
87 { OUString(UNO_NAME_EDIT_CHAR_FONTCHARSET), EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
88 { OUString(UNO_NAME_EDIT_CHAR_FONTPITCH), EE_CHAR_FONTINFO, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
89 { OUString(UNO_NAME_EDIT_CHAR_POSTURE), EE_CHAR_ITALIC, ::cppu::UnoType<com::sun::star::awt::FontSlant>::get(),0, MID_POSTURE }, \
90 { OUString(UNO_NAME_EDIT_CHAR_WEIGHT), EE_CHAR_WEIGHT, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
91 { OUString(UNO_NAME_EDIT_CHAR_LOCALE), EE_CHAR_LANGUAGE, ::cppu::UnoType<com::sun::star::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
92 { OUString(UNO_NAME_EDIT_CHAR_COLOR), EE_CHAR_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, \
93 { OUString("CharBackColor"), EE_CHAR_BKGCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, \
94 { OUString("CharBackTransparent"), EE_CHAR_BKGCOLOR, ::cppu::UnoType<bool>::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
95 { OUString(UNO_NAME_EDIT_CHAR_ESCAPEMENT), EE_CHAR_ESCAPEMENT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_ESC }, \
96 { OUString(UNO_NAME_EDIT_CHAR_UNDERLINE), EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
97 { OUString("CharUnderlineColor"), EE_CHAR_UNDERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
98 { OUString("CharUnderlineHasColor"), EE_CHAR_UNDERLINE, cppu::UnoType<bool>::get(), 0, MID_TL_HASCOLOR } , \
99 { OUString(UNO_NAME_EDIT_CHAR_OVERLINE), EE_CHAR_OVERLINE, ::cppu::UnoType<sal_Int16>::get(), 0, MID_TL_STYLE }, \
100 { OUString("CharOverlineColor"), EE_CHAR_OVERLINE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TL_COLOR }, \
101 { OUString("CharOverlineHasColor"), EE_CHAR_OVERLINE, cppu::UnoType<bool>::get(), 0, MID_TL_HASCOLOR } , \
102 { OUString(UNO_NAME_EDIT_CHAR_CROSSEDOUT), EE_CHAR_STRIKEOUT, cppu::UnoType<bool>::get(), 0, MID_CROSSED_OUT }, \
103 { OUString(UNO_NAME_EDIT_CHAR_STRIKEOUT), EE_CHAR_STRIKEOUT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_CROSS_OUT}, \
104 { OUString(UNO_NAME_EDIT_CHAR_CASEMAP), EE_CHAR_CASEMAP, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }, \
105 { OUString(UNO_NAME_EDIT_CHAR_SHADOWED), EE_CHAR_SHADOW, cppu::UnoType<bool>::get(), 0, 0 }, \
106 { OUString("CharContoured"), EE_CHAR_OUTLINE, cppu::UnoType<bool>::get(), 0, 0 }, \
107 { OUString("CharEscapementHeight"), EE_CHAR_ESCAPEMENT, cppu::UnoType<sal_Int8>::get(), 0, MID_ESC_HEIGHT },\
108 { OUString("CharAutoKerning"), EE_CHAR_PAIRKERNING,cppu::UnoType<bool>::get(), 0, 0 } , \
109 { OUString("CharKerning"), EE_CHAR_KERNING, ::cppu::UnoType<sal_Int16>::get() , 0, 0 }, \
110 { OUString("CharWordMode"), EE_CHAR_WLM, cppu::UnoType<bool>::get(), 0, 0 }, \
111 { OUString("CharEmphasis"), EE_CHAR_EMPHASISMARK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_EMPHASIS},\
112 { OUString(UNO_NAME_EDIT_CHAR_HEIGHT_ASIAN), EE_CHAR_FONTHEIGHT_CJK, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
113 { OUString(UNO_NAME_EDIT_CHAR_FONTNAME_ASIAN), EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
114 { OUString(UNO_NAME_EDIT_CHAR_FONTSTYLENAME_ASIAN), EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
115 { OUString(UNO_NAME_EDIT_CHAR_FONTFAMILY_ASIAN), EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
116 { OUString(UNO_NAME_EDIT_CHAR_FONTCHARSET_ASIAN), EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
117 { OUString(UNO_NAME_EDIT_CHAR_FONTPITCH_ASIAN), EE_CHAR_FONTINFO_CJK, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
118 { OUString(UNO_NAME_EDIT_CHAR_POSTURE_ASIAN), EE_CHAR_ITALIC_CJK, ::cppu::UnoType<com::sun::star::awt::FontSlant>::get(),0, MID_POSTURE }, \
119 { OUString(UNO_NAME_EDIT_CHAR_WEIGHT_ASIAN), EE_CHAR_WEIGHT_CJK, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
120 { OUString(UNO_NAME_EDIT_CHAR_LOCALE_ASIAN), EE_CHAR_LANGUAGE_CJK, ::cppu::UnoType<com::sun::star::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
121 { OUString(UNO_NAME_EDIT_CHAR_HEIGHT_COMPLEX), EE_CHAR_FONTHEIGHT_CTL, cppu::UnoType<float>::get(), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
122 { OUString(UNO_NAME_EDIT_CHAR_FONTNAME_COMPLEX), EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_FAMILY_NAME },\
123 { OUString(UNO_NAME_EDIT_CHAR_FONTSTYLENAME_COMPLEX),EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<OUString>::get(), 0, MID_FONT_STYLE_NAME }, \
124 { OUString(UNO_NAME_EDIT_CHAR_FONTFAMILY_COMPLEX), EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_FAMILY }, \
125 { OUString(UNO_NAME_EDIT_CHAR_FONTCHARSET_COMPLEX), EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_CHAR_SET }, \
126 { OUString(UNO_NAME_EDIT_CHAR_FONTPITCH_COMPLEX), EE_CHAR_FONTINFO_CTL, ::cppu::UnoType<sal_Int16>::get(), 0, MID_FONT_PITCH }, \
127 { OUString(UNO_NAME_EDIT_CHAR_POSTURE_COMPLEX), EE_CHAR_ITALIC_CTL, ::cppu::UnoType<com::sun::star::awt::FontSlant>::get(),0, MID_POSTURE }, \
128 { OUString(UNO_NAME_EDIT_CHAR_WEIGHT_COMPLEX), EE_CHAR_WEIGHT_CTL, cppu::UnoType<float>::get(), 0, MID_WEIGHT }, \
129 { OUString(UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX), EE_CHAR_LANGUAGE_CTL, ::cppu::UnoType<com::sun::star::lang::Locale>::get(),0, MID_LANG_LOCALE }, \
130 { OUString("CharRelief"), EE_CHAR_RELIEF, ::cppu::UnoType<sal_Int16>::get(), 0, MID_RELIEF }, \
131 { OUString("CharInteropGrabBag"), EE_CHAR_GRABBAG, cppu::UnoType<css::uno::Sequence<css::beans::PropertyValue >>::get(), 0, 0}
134 #define SVX_UNOEDIT_FONT_PROPERTIES \
135 {OUString(UNO_NAME_EDIT_FONT_DESCRIPTOR), WID_FONTDESC, cppu::UnoType<css::awt::FontDescriptor>::get(), 0, MID_FONT_FAMILY_NAME }
137 #define SVX_UNOEDIT_PARA_PROPERTIES \
138 {OUString(UNO_NAME_EDIT_PARA_ADJUST), EE_PARA_JUST, ::cppu::UnoType<sal_Int16>::get(), 0, MID_PARA_ADJUST }, \
139 {OUString(UNO_NAME_EDIT_PARA_BMARGIN), EE_PARA_ULSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_LO_MARGIN|SFX_METRIC_ITEM }, \
140 {OUString(UNO_NAME_EDIT_PARA_IS_HYPHEN), EE_PARA_HYPHENATE, cppu::UnoType<bool>::get(), 0, 0 }, \
141 {OUString(UNO_NAME_EDIT_PARA_LASTLINEADJ), EE_PARA_JUST, ::cppu::UnoType<sal_Int16>::get(), 0, MID_LAST_LINE_ADJUST }, \
142 {OUString(UNO_NAME_EDIT_PARA_LMARGIN), EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_TXT_LMARGIN|SFX_METRIC_ITEM }, \
143 {OUString(UNO_NAME_EDIT_PARA_LINESPACING), EE_PARA_SBL, cppu::UnoType<css::style::LineSpacing>::get(), 0, CONVERT_TWIPS}, \
144 {OUString(UNO_NAME_EDIT_PARA_RMARGIN), EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_R_MARGIN|SFX_METRIC_ITEM }, \
145 {OUString(UNO_NAME_EDIT_PARA_TAPSTOPS), EE_PARA_TABS, cppu::UnoType<css::uno::Sequence< ::com::sun::star::style::TabStop >>::get(), 0, 0 }, \
146 {OUString(UNO_NAME_EDIT_PARA_TMARGIN), EE_PARA_ULSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_UP_MARGIN|SFX_METRIC_ITEM },\
147 {OUString(UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT), EE_PARA_LRSPACE, ::cppu::UnoType<sal_Int32>::get(), 0, MID_FIRST_LINE_INDENT|SFX_METRIC_ITEM}, \
148 {OUString(UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION),EE_PARA_HANGINGPUNCTUATION, cppu::UnoType<bool>::get(), 0 ,0 }, \
149 {OUString(UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE), EE_PARA_ASIANCJKSPACING, cppu::UnoType<bool>::get(), 0 ,0 }, \
150 {OUString(UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES), EE_PARA_FORBIDDENRULES, cppu::UnoType<bool>::get(), 0 ,0 },\
151 {OUString("WritingMode"), EE_PARA_WRITINGDIR, ::cppu::UnoType<sal_Int16>::get(), 0, 0 }
153 class SvxEditSource;
154 class SvxTextForwarder;
155 class SvxFieldItem;
156 class SvxTextEditSource;
157 class SvxFieldData;
158 struct ESelection;
160 EDITENG_DLLPUBLIC void GetSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw();
161 EDITENG_DLLPUBLIC void CheckSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw();
164 // This class implements a SvxEditSource and SvxTextForwarder and does
165 // nothing otherwise
168 class SvxDummyTextSource : public SvxEditSource, public SvxTextForwarder
170 public:
172 // SvxEditSource
173 virtual ~SvxDummyTextSource();
174 virtual SvxEditSource* Clone() const SAL_OVERRIDE;
175 virtual SvxTextForwarder* GetTextForwarder() SAL_OVERRIDE;
176 virtual void UpdateData() SAL_OVERRIDE;
178 // SvxTextForwarder
179 virtual sal_Int32 GetParagraphCount() const SAL_OVERRIDE;
180 virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const SAL_OVERRIDE;
181 virtual OUString GetText( const ESelection& rSel ) const SAL_OVERRIDE;
182 virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE;
183 virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const SAL_OVERRIDE;
184 virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE;
185 virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
186 virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
188 SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
189 SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
191 virtual SfxItemPool* GetPool() const SAL_OVERRIDE;
193 virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) SAL_OVERRIDE;
194 virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) SAL_OVERRIDE;
195 virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) SAL_OVERRIDE;
196 virtual void QuickInsertLineBreak( const ESelection& rSel ) SAL_OVERRIDE;
198 virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor ) SAL_OVERRIDE;
199 virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos ) SAL_OVERRIDE;
201 virtual bool IsValid() const SAL_OVERRIDE;
203 virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const SAL_OVERRIDE;
204 virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const SAL_OVERRIDE;
205 virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const SAL_OVERRIDE;
206 virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const SAL_OVERRIDE;
207 virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const SAL_OVERRIDE;
208 virtual Rectangle GetParaBounds( sal_Int32 nPara ) const SAL_OVERRIDE;
209 virtual MapMode GetMapMode() const SAL_OVERRIDE;
210 virtual OutputDevice* GetRefDevice() const SAL_OVERRIDE;
211 virtual bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_Int32& nIndex ) const SAL_OVERRIDE;
212 virtual bool GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const SAL_OVERRIDE;
213 virtual bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell = false ) const SAL_OVERRIDE;
214 virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const SAL_OVERRIDE;
215 virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const SAL_OVERRIDE;
216 virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const SAL_OVERRIDE;
217 virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const SAL_OVERRIDE;
218 virtual bool Delete( const ESelection& ) SAL_OVERRIDE;
219 virtual bool InsertText( const OUString&, const ESelection& ) SAL_OVERRIDE;
220 virtual bool QuickFormatDoc( bool bFull = false ) SAL_OVERRIDE;
221 virtual sal_Int16 GetDepth( sal_Int32 nPara ) const SAL_OVERRIDE;
222 virtual bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) SAL_OVERRIDE;
224 virtual const SfxItemSet* GetEmptyItemSetPtr() SAL_OVERRIDE;
226 // implementation functions for XParagraphAppend and XTextPortionAppend
227 virtual void AppendParagraph() SAL_OVERRIDE;
228 virtual sal_Int32 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) SAL_OVERRIDE;
229 //XTextCopy
230 virtual void CopyText(const SvxTextForwarder& rSource) SAL_OVERRIDE;
233 namespace accessibility
235 class AccessibleEditableTextPara;
239 class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public ::com::sun::star::text::XTextRange,
240 public ::com::sun::star::beans::XPropertySet,
241 public ::com::sun::star::beans::XMultiPropertySet,
242 public ::com::sun::star::beans::XMultiPropertyStates,
243 public ::com::sun::star::beans::XPropertyState,
244 public ::com::sun::star::lang::XServiceInfo,
245 public ::com::sun::star::text::XTextRangeCompare,
246 public ::com::sun::star::lang::XUnoTunnel,
247 private osl::DebugBase<SvxUnoTextRangeBase>
250 friend class SvxUnoTextRangeEnumeration;
251 friend class ::accessibility::AccessibleEditableTextPara;
253 protected:
254 SvxEditSource* mpEditSource;
255 ESelection maSelection;
256 const SvxItemPropertySet* mpPropSet;
258 void SAL_CALL _setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
259 ::com::sun::star::uno::Any SAL_CALL _getPropertyValue( const OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
261 void SAL_CALL _setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues, sal_Int32 nPara = -1 ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
262 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL _getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, sal_Int32 nPara = -1 ) throw (::com::sun::star::uno::RuntimeException);
264 ::com::sun::star::beans::PropertyState SAL_CALL _getPropertyState( const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
265 ::com::sun::star::beans::PropertyState SAL_CALL _getPropertyState( const OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
266 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL _getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
267 // returns true if property found or false if unknown property
268 static bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertySimpleEntry* pMap, ::com::sun::star::beans::PropertyState& rState);
270 void SAL_CALL _setPropertyToDefault( const OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
271 void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara ) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
272 void SetEditSource( SvxEditSource* _pEditSource ) throw();
274 void getPropertyValue( const SfxItemPropertySimpleEntry* pMap, com::sun::star::uno::Any& rAny, const SfxItemSet& rSet )
275 throw(css::beans::UnknownPropertyException, css::uno::RuntimeException);
276 void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const com::sun::star::uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException );
278 SvxUnoTextRangeBase( const SvxItemPropertySet* _pSet ) throw();
279 SvxUnoTextRangeBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet ) throw();
280 SvxUnoTextRangeBase( const SvxUnoTextRangeBase& rRange ) throw();
281 virtual ~SvxUnoTextRangeBase() throw();
283 public:
284 // Internal
285 const ESelection& GetSelection() const throw() { CheckSelection( const_cast<SvxUnoTextRangeBase*>(this)->maSelection, mpEditSource->GetTextForwarder() ); return maSelection; };
286 void SetSelection( const ESelection& rSelection ) throw();
288 void CollapseToStart() throw();
289 void CollapseToEnd() throw();
290 bool IsCollapsed() throw();
291 bool GoLeft(sal_Int16 nCount, bool Expand) throw();
292 bool GoRight(sal_Int16 nCount, bool Expand) throw();
293 void GotoStart(bool Expand) throw();
294 void GotoEnd(bool Expand) throw();
296 //const SfxItemPropertyMapEntry* getPropertyMapEntries() const throw() { return maPropSet.getPropertyMapEntries(); }
297 const SvxItemPropertySet* getPropertySet() const throw() { return mpPropSet; }
298 SvxEditSource* GetEditSource() const throw() { return mpEditSource; }
300 static bool SetPropertyValueHelper( const SfxItemSet& rOldSet, const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = NULL, SvxEditSource* pEditSource = NULL );
301 static bool GetPropertyValueHelper( SfxItemSet& rSet, const SfxItemPropertySimpleEntry* pMap, ::com::sun::star::uno::Any& aAny, const ESelection* pSelection = NULL, SvxEditSource* pEditSource = NULL ) throw( ::com::sun::star::uno::RuntimeException );
303 void attachField( const SvxFieldData* pData ) throw();
305 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextRangeBase )
307 // ::com::sun::star::text::XTextRange
308 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
309 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
310 virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
311 virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
313 // ::com::sun::star::beans::XPropertySet
314 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
315 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
316 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
317 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
318 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
319 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
320 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
322 // XMultiPropertySet
323 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
324 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
325 virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
326 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
327 virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
329 // ::com::sun::star::beans::XPropertyState
330 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
331 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
332 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
333 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
335 // ::com::sun::star::beans::XMultiPropertyStates
336 //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
337 virtual void SAL_CALL setAllPropertiesToDefault()
338 throw (::com::sun::star::uno::RuntimeException,
339 std::exception) SAL_OVERRIDE;
340 virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
341 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
343 // XTextRangeCompare
344 virtual ::sal_Int16 SAL_CALL compareRegionStarts( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
345 virtual ::sal_Int16 SAL_CALL compareRegionEnds( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
347 // ::com::sun::star::lang::XServiceInfo
348 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
349 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
350 static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( );
355 class SvxUnoTextBase;
356 class EDITENG_DLLPUBLIC SvxUnoTextRange : public SvxUnoTextRangeBase,
357 public ::com::sun::star::lang::XTypeProvider,
358 public ::cppu::OWeakAggObject
360 friend class SvxUnoTextRangeEnumeration;
361 private:
362 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
363 bool mbPortion;
365 public:
366 SvxUnoTextRange( const SvxUnoTextBase& rParent, bool bPortion = false ) throw();
367 virtual ~SvxUnoTextRange() throw();
369 // ::com::sun::star::uno::XInterface
370 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
371 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
372 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
373 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
375 // ::com::sun::star::text::XTextRange
376 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
378 // ::com::sun::star::lang::XServiceInfo
379 virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
381 // ::com::sun::star::lang::XTypeProvider
382 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
383 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
386 class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextRangeBase,
387 public ::com::sun::star::text::XTextAppend,
388 public ::com::sun::star::text::XTextCopy,
389 public ::com::sun::star::container::XEnumerationAccess,
390 public ::com::sun::star::text::XTextRangeMover,
391 public ::com::sun::star::lang::XTypeProvider
393 protected:
394 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
396 SvxUnoTextBase( const SvxItemPropertySet* _pSet ) throw();
397 SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > xParent ) throw();
398 SvxUnoTextBase( const SvxUnoTextBase& rText ) throw();
399 virtual ~SvxUnoTextBase() throw();
401 public:
402 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
404 ESelection InsertField( const SvxFieldItem& rField ) throw();
405 static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getStaticTypes() throw();
407 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
409 // ::com::sun::star::uno::XInterface
410 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception);
412 // ::com::sun::star::text::XSimpleText
413 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
414 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
415 virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const OUString& aString, sal_Bool bAbsorb ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
416 virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
418 // ::com::sun::star::text::XText
419 virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, sal_Bool bAbsorb ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
420 virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
421 virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
422 virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
424 // ::com::sun::star::text::XTextRange
425 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
426 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
427 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
429 // ::com::sun::star::container::XEnumerationAccess
430 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
432 // ::com::sun::star::container::XElementAccess
433 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
434 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
436 // ::com::sun::star::text::XTextRangeMover
437 virtual void SAL_CALL moveTextRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, sal_Int16 nParagraphs ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
439 // com::sun::star::text::XParagraphAppend (new import API)
440 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishParagraph( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
441 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishParagraphInsert( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xInsertPosition ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
443 // com::sun::star::text::XTextPortionAppend (new import API)
444 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextPortion( const OUString& Text, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
446 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL insertTextPortion( const OUString& Text, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties, const com::sun::star::uno::Reference< com::sun::star::text::XTextRange>& rTextRange ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
448 // com::sun::star::text::XTextCopy
449 virtual void SAL_CALL copyText( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCopy >& xSource ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
451 // ::com::sun::star::lang::XServiceInfo
452 virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
453 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
454 static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( );
456 // ::com::sun::star::lang::XTypeProvider
457 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
458 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
462 class EDITENG_DLLPUBLIC SvxUnoText : public SvxUnoTextBase,
463 public ::cppu::OWeakAggObject
465 public:
466 SvxUnoText( const SvxItemPropertySet* _pSet ) throw();
467 SvxUnoText( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > xParent ) throw();
468 SvxUnoText( const SvxUnoText& rText ) throw();
469 virtual ~SvxUnoText() throw();
471 // Internal
472 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
473 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
475 // ::com::sun::star::uno::XInterface
476 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
477 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
478 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
479 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
481 // ::com::sun::star::lang::XTypeProvider
482 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
483 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
488 class SvxUnoTextContentEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun::star::container::XEnumeration >
490 private:
491 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
492 SvxEditSource* mpEditSource;
493 sal_Int32 mnNextParagraph;
494 const SvxUnoTextBase& mrText;
496 public:
497 SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText ) throw();
498 virtual ~SvxUnoTextContentEnumeration() throw();
500 // ::com::sun::star::container::XEnumeration
501 virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
502 virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
506 #include <com/sun/star/text/XTextContent.hpp>
508 class SvxUnoTextContent : public SvxUnoTextRangeBase,
509 public ::com::sun::star::text::XTextContent,
510 public ::com::sun::star::container::XEnumerationAccess,
511 public ::com::sun::star::lang::XTypeProvider,
512 public ::cppu::OWeakAggObject
514 friend class SvxUnoTextContentEnumeration;
515 private:
516 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
517 sal_Int32 mnParagraph;
518 const SvxUnoTextBase& mrParentText;
520 // for xComponent
521 ::osl::Mutex maDisposeContainerMutex;
522 ::cppu::OInterfaceContainerHelper maDisposeListeners;
523 bool mbDisposing;
525 protected:
526 using SvxUnoTextRangeBase::setPropertyValue;
527 using SvxUnoTextRangeBase::getPropertyValue;
529 public:
530 SvxUnoTextContent( const SvxUnoTextBase& rText, sal_Int32 nPara ) throw();
531 SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw();
532 virtual ~SvxUnoTextContent() throw();
534 // ::com::sun::star::uno::XInterface
535 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
536 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
537 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
538 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
540 // ::com::sun::star::text::XTextRange
541 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
543 // ::com::sun::star::text::XTextContent -> ::com::sun::star::lang::XComponent
544 virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
545 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
547 // ::com::sun::star::lang::XComponent
548 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
549 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
550 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
552 // ::com::sun::star::container::XEnumerationAccess
553 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
555 // ::com::sun::star::container::XElementAccess
556 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
557 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
559 // ::com::sun::star::beans::XPropertySet
560 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
561 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
563 // XMultiPropertySet
564 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
565 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
567 // ::com::sun::star::beans::XPropertyState
568 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
569 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
570 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
572 // ::com::sun::star::lang::XServiceInfo
573 virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
574 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
576 // ::com::sun::star::lang::XTypeProvider
577 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
578 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
583 class SvxUnoTextRangeEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun::star::container::XEnumeration >
585 private:
586 SvxEditSource* mpEditSource;
587 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
588 const SvxUnoTextBase& mrParentText;
589 sal_Int32 mnParagraph;
590 std::vector<sal_Int32>* mpPortions;
591 sal_uInt16 mnNextPortion;
593 public:
594 SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_Int32 nPara ) throw();
595 virtual ~SvxUnoTextRangeEnumeration() throw();
597 // ::com::sun::star::container::XEnumeration
598 virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
599 virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
604 class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextRangeBase,
605 public ::com::sun::star::text::XTextCursor,
606 public ::com::sun::star::lang::XTypeProvider,
607 public ::cppu::OWeakAggObject
609 private:
610 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
612 public:
613 SvxUnoTextCursor( const SvxUnoTextBase& rText ) throw();
614 SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw();
615 virtual ~SvxUnoTextCursor() throw();
617 // ::com::sun::star::uno::XInterface
618 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
619 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
620 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
621 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
623 // ::com::sun::star::text::XTextRange
624 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
625 virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
626 virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
627 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
628 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
630 // ::com::sun::star::text::XTextCursor -> ::com::sun::star::text::XTextRange
631 virtual void SAL_CALL collapseToStart( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
632 virtual void SAL_CALL collapseToEnd( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
633 virtual sal_Bool SAL_CALL isCollapsed( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
634 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
635 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
636 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
637 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
638 virtual void SAL_CALL gotoRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
640 // ::com::sun::star::lang::XServiceInfo
641 virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
642 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
643 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
645 // ::com::sun::star::lang::XTypeProvider
646 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
647 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
651 EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
652 EDITENG_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
653 EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
654 EDITENG_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
656 #endif
658 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */