Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVX_UNOTEXT_HXX
30 : : #define _SVX_UNOTEXT_HXX
31 : :
32 : : #include "sal/config.h"
33 : :
34 : : #include <com/sun/star/container/XNameContainer.hpp>
35 : : #include <com/sun/star/text/XTextRange.hpp>
36 : : #include <com/sun/star/text/XText.hpp>
37 : : #include <com/sun/star/container/XEnumerationAccess.hpp>
38 : : #include <com/sun/star/text/XTextRangeMover.hpp>
39 : : #include <com/sun/star/text/XTextContent.hpp>
40 : : #include <com/sun/star/text/XTextCursor.hpp>
41 : : #include <com/sun/star/lang/XServiceInfo.hpp>
42 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
43 : : #include <com/sun/star/beans/XPropertySet.hpp>
44 : : #include <com/sun/star/beans/XPropertyState.hpp>
45 : : #include <com/sun/star/beans/XMultiPropertySet.hpp>
46 : : #include <com/sun/star/text/XTextRangeCompare.hpp>
47 : : #include <com/sun/star/beans/XMultiPropertyStates.hpp>
48 : : #include <com/sun/star/text/XTextAppend.hpp>
49 : : #include <com/sun/star/text/XTextCopy.hpp>
50 : : #include <com/sun/star/text/XTextField.hpp>
51 : : #include <com/sun/star/container/XIndexReplace.hpp>
52 : : #include <com/sun/star/awt/FontSlant.hpp>
53 : : #include <com/sun/star/awt/FontDescriptor.hpp>
54 : : #include <com/sun/star/style/LineSpacing.hpp>
55 : : #include <com/sun/star/style/TabStop.hpp>
56 : : #include <com/sun/star/lang/XUnoTunnel.hpp>
57 : : #include <cppuhelper/implbase1.hxx>
58 : : #include <cppuhelper/implbase2.hxx>
59 : : #include <cppuhelper/implbase4.hxx>
60 : : #include <cppuhelper/implbase8.hxx>
61 : : #include <cppuhelper/interfacecontainer.h>
62 : : #include <cppuhelper/weak.hxx>
63 : : #include <cppuhelper/weakagg.hxx>
64 : : #include <osl/diagnose.hxx>
65 : : #include <osl/mutex.hxx>
66 : : #include <comphelper/servicehelper.hxx>
67 : : #include <tools/link.hxx>
68 : : #include <svl/itemprop.hxx>
69 : : #include <svl/itemset.hxx>
70 : : #include <svl/itempool.hxx>
71 : : #include <svl/solar.hrc>
72 : : #include <editeng/editdata.hxx>
73 : : #include <editeng/unoedsrc.hxx>
74 : : #include <editeng/eeitem.hxx>
75 : : #include <editeng/editengdllapi.h>
76 : : #include <editeng/memberids.hrc>
77 : :
78 : : class SvxItemPropertySet;
79 : :
80 : : #ifndef SEQTYPE
81 : : #if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
82 : : #define SEQTYPE(x) (new ::com::sun::star::uno::Type( x ))
83 : : #else
84 : : #define SEQTYPE(x) &(x)
85 : : #endif
86 : : #endif
87 : :
88 : : #define WID_FONTDESC OWN_ATTR_VALUE_START
89 : : #define WID_NUMLEVEL OWN_ATTR_VALUE_START+1
90 : : #define WID_PORTIONTYPE OWN_ATTR_VALUE_START+2
91 : : #define WID_NUMBERINGSTARTVALUE OWN_ATTR_VALUE_START+3
92 : : #define WID_PARAISNUMBERINGRESTART OWN_ATTR_VALUE_START+4
93 : :
94 : : #define SVX_UNOEDIT_NUMBERING_PROPERTIE \
95 : : {MAP_CHAR_LEN(UNO_NAME_NUMBERING_RULES), EE_PARA_NUMBULLET, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace>*)0), 0, 0 }, \
96 : : {MAP_CHAR_LEN(UNO_NAME_NUMBERING), EE_PARA_BULLETSTATE,&::getBooleanCppuType(), 0, 0 }
97 : :
98 : : #define SVX_UNOEDIT_OUTLINER_PROPERTIES \
99 : : SVX_UNOEDIT_NUMBERING_PROPERTIE, \
100 : : {MAP_CHAR_LEN(UNO_NAME_NUMBERING_LEVEL), WID_NUMLEVEL, &::getCppuType((const sal_Int16*)0), 0, 0 }, \
101 : : {MAP_CHAR_LEN("NumberingStartValue"), WID_NUMBERINGSTARTVALUE, &::getCppuType((const sal_Int16*)0), 0, 0 }, \
102 : : {MAP_CHAR_LEN("ParaIsNumberingRestart"), WID_PARAISNUMBERINGRESTART, &::getBooleanCppuType(), 0, 0 }
103 : :
104 : : #define SVX_UNOEDIT_CHAR_PROPERTIES \
105 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_HEIGHT), EE_CHAR_FONTHEIGHT, &::getCppuType((const float*)0), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
106 : : { MAP_CHAR_LEN("CharScaleWidth"), EE_CHAR_FONTWIDTH, &::getCppuType((const sal_Int16*)0), 0, 0 }, \
107 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTNAME), EE_CHAR_FONTINFO, &::getCppuType((const ::rtl::OUString*)0), 0, MID_FONT_FAMILY_NAME },\
108 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTSTYLENAME),EE_CHAR_FONTINFO, &::getCppuType((const ::rtl::OUString*)0), 0, MID_FONT_STYLE_NAME }, \
109 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTFAMILY), EE_CHAR_FONTINFO, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_FAMILY }, \
110 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTCHARSET), EE_CHAR_FONTINFO, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_CHAR_SET }, \
111 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTPITCH), EE_CHAR_FONTINFO, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_PITCH }, \
112 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_POSTURE), EE_CHAR_ITALIC, &::getCppuType((const ::com::sun::star::awt::FontSlant*)0),0, MID_POSTURE }, \
113 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_WEIGHT), EE_CHAR_WEIGHT, &::getCppuType((const float*)0), 0, MID_WEIGHT }, \
114 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_LOCALE), EE_CHAR_LANGUAGE, &::getCppuType((const ::com::sun::star::lang::Locale*)0),0, MID_LANG_LOCALE }, \
115 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_COLOR), EE_CHAR_COLOR, &::getCppuType((const sal_Int32*)0), 0, 0 }, \
116 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_ESCAPEMENT), EE_CHAR_ESCAPEMENT, &::getCppuType((const sal_Int16*)0), 0, MID_ESC }, \
117 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_UNDERLINE), EE_CHAR_UNDERLINE, &::getCppuType((const sal_Int16*)0), 0, MID_TL_STYLE }, \
118 : : { MAP_CHAR_LEN("CharUnderlineColor"), EE_CHAR_UNDERLINE, &::getCppuType((const sal_Int32*)0), 0, MID_TL_COLOR }, \
119 : : { MAP_CHAR_LEN("CharUnderlineHasColor"), EE_CHAR_UNDERLINE, &::getBooleanCppuType(), 0, MID_TL_HASCOLOR } , \
120 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_OVERLINE), EE_CHAR_OVERLINE, &::getCppuType((const sal_Int16*)0), 0, MID_TL_STYLE }, \
121 : : { MAP_CHAR_LEN("CharOverlineColor"), EE_CHAR_OVERLINE, &::getCppuType((const sal_Int32*)0), 0, MID_TL_COLOR }, \
122 : : { MAP_CHAR_LEN("CharOverlineHasColor"), EE_CHAR_OVERLINE, &::getBooleanCppuType(), 0, MID_TL_HASCOLOR } , \
123 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_CROSSEDOUT), EE_CHAR_STRIKEOUT, &::getBooleanCppuType(), 0, MID_CROSSED_OUT }, \
124 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_STRIKEOUT), EE_CHAR_STRIKEOUT, &::getCppuType((const sal_Int16*)0), 0, MID_CROSS_OUT}, \
125 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_SHADOWED), EE_CHAR_SHADOW, &::getBooleanCppuType(), 0, 0 }, \
126 : : { MAP_CHAR_LEN("CharContoured"), EE_CHAR_OUTLINE, &::getBooleanCppuType(), 0, 0 }, \
127 : : { MAP_CHAR_LEN("CharEscapementHeight"), EE_CHAR_ESCAPEMENT, &::getCppuType((const sal_Int8*)0), 0, MID_ESC_HEIGHT },\
128 : : { MAP_CHAR_LEN("CharAutoKerning"), EE_CHAR_PAIRKERNING,&::getBooleanCppuType(), 0, 0 } , \
129 : : { MAP_CHAR_LEN("CharKerning"), EE_CHAR_KERNING, &::getCppuType((const sal_Int16*)0) , 0, 0 }, \
130 : : { MAP_CHAR_LEN("CharWordMode"), EE_CHAR_WLM, &::getBooleanCppuType(), 0, 0 }, \
131 : : { MAP_CHAR_LEN("CharEmphasis"), EE_CHAR_EMPHASISMARK,&::getCppuType((const sal_Int16*)0), 0, MID_EMPHASIS},\
132 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_HEIGHT_ASIAN), EE_CHAR_FONTHEIGHT_CJK, &::getCppuType((const float*)0), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
133 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTNAME_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const ::rtl::OUString*)0), 0, MID_FONT_FAMILY_NAME },\
134 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTSTYLENAME_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const ::rtl::OUString*)0), 0, MID_FONT_STYLE_NAME }, \
135 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTFAMILY_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_FAMILY }, \
136 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTCHARSET_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_CHAR_SET }, \
137 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTPITCH_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_PITCH }, \
138 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_POSTURE_ASIAN), EE_CHAR_ITALIC_CJK, &::getCppuType((const ::com::sun::star::awt::FontSlant*)0),0, MID_POSTURE }, \
139 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_WEIGHT_ASIAN), EE_CHAR_WEIGHT_CJK, &::getCppuType((const float*)0), 0, MID_WEIGHT }, \
140 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_LOCALE_ASIAN), EE_CHAR_LANGUAGE_CJK, &::getCppuType((const ::com::sun::star::lang::Locale*)0),0, MID_LANG_LOCALE }, \
141 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_HEIGHT_COMPLEX), EE_CHAR_FONTHEIGHT_CTL, &::getCppuType((const float*)0), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
142 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTNAME_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const ::rtl::OUString*)0), 0, MID_FONT_FAMILY_NAME },\
143 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTSTYLENAME_COMPLEX),EE_CHAR_FONTINFO_CTL, &::getCppuType((const ::rtl::OUString*)0), 0, MID_FONT_STYLE_NAME }, \
144 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTFAMILY_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_FAMILY }, \
145 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTCHARSET_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_CHAR_SET }, \
146 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTPITCH_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_PITCH }, \
147 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_POSTURE_COMPLEX), EE_CHAR_ITALIC_CTL, &::getCppuType((const ::com::sun::star::awt::FontSlant*)0),0, MID_POSTURE }, \
148 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_WEIGHT_COMPLEX), EE_CHAR_WEIGHT_CTL, &::getCppuType((const float*)0), 0, MID_WEIGHT }, \
149 : : { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX), EE_CHAR_LANGUAGE_CTL, &::getCppuType((const ::com::sun::star::lang::Locale*)0),0, MID_LANG_LOCALE }, \
150 : : { MAP_CHAR_LEN("CharRelief" ), EE_CHAR_RELIEF, &::getCppuType((const sal_Int16*)0), 0, MID_RELIEF }
151 : :
152 : : #define SVX_UNOEDIT_FONT_PROPERTIES \
153 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_FONT_DESCRIPTOR), WID_FONTDESC, &::getCppuType((const ::com::sun::star::awt::FontDescriptor*)0), 0, MID_FONT_FAMILY_NAME }
154 : :
155 : : #define SVX_UNOEDIT_PARA_PROPERTIES \
156 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_ADJUST), EE_PARA_JUST, &::getCppuType((const sal_Int16*)0), 0, MID_PARA_ADJUST }, \
157 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_BMARGIN), EE_PARA_ULSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_LO_MARGIN|SFX_METRIC_ITEM }, \
158 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_HYPHEN), EE_PARA_HYPHENATE, &::getBooleanCppuType(), 0, 0 }, \
159 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LASTLINEADJ), EE_PARA_JUST, &::getCppuType((const sal_Int16*)0), 0, MID_LAST_LINE_ADJUST }, \
160 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LMARGIN), EE_PARA_LRSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_TXT_LMARGIN|SFX_METRIC_ITEM }, \
161 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LINESPACING), EE_PARA_SBL, &::getCppuType((const ::com::sun::star::style::LineSpacing*)0), 0, 0 }, \
162 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_RMARGIN), EE_PARA_LRSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_R_MARGIN|SFX_METRIC_ITEM }, \
163 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_TAPSTOPS), EE_PARA_TABS, SEQTYPE(::getCppuType((const ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop >*)0)), 0, 0 }, \
164 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_TMARGIN), EE_PARA_ULSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_UP_MARGIN|SFX_METRIC_ITEM },\
165 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT), EE_PARA_LRSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_FIRST_LINE_INDENT|SFX_METRIC_ITEM}, \
166 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION),EE_PARA_HANGINGPUNCTUATION, &::getBooleanCppuType(), 0 ,0 }, \
167 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE), EE_PARA_ASIANCJKSPACING, &::getBooleanCppuType(), 0 ,0 }, \
168 : : {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES), EE_PARA_FORBIDDENRULES, &::getBooleanCppuType(), 0 ,0 },\
169 : : {MAP_CHAR_LEN("WritingMode"), EE_PARA_WRITINGDIR, &::getCppuType((const sal_Int16*)0), 0, 0 }
170 : :
171 : : class SvxEditSource;
172 : : class SvxTextForwarder;
173 : : class SvxFieldItem;
174 : : class SvxTextEditSource;
175 : : class SvxFieldData;
176 : : struct ESelection;
177 : :
178 : : EDITENG_DLLPUBLIC void GetSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw();
179 : : EDITENG_DLLPUBLIC void CheckSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw();
180 : :
181 : : // ====================================================================
182 : : // This class implements a SvxEditSource and SvxTextForwarder and does
183 : : // nothing otherwise
184 : : // ====================================================================
185 : :
186 : 0 : class SvxDummyTextSource : public SvxEditSource, public SvxTextForwarder
187 : : {
188 : : public:
189 : :
190 : : // SvxEditSource
191 : : virtual ~SvxDummyTextSource();
192 : : virtual SvxEditSource* Clone() const;
193 : : virtual SvxTextForwarder* GetTextForwarder();
194 : : virtual void UpdateData();
195 : :
196 : : // SvxTextForwarder
197 : : virtual sal_uInt16 GetParagraphCount() const;
198 : : virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
199 : : virtual String GetText( const ESelection& rSel ) const;
200 : : virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
201 : : virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
202 : : virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
203 : : virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
204 : : virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
205 : :
206 : : sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
207 : : sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
208 : :
209 : : virtual SfxItemPool* GetPool() const;
210 : :
211 : : virtual void QuickInsertText( const String& rText, const ESelection& rSel );
212 : : virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
213 : : virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
214 : : virtual void QuickInsertLineBreak( const ESelection& rSel );
215 : :
216 : : virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
217 : : virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
218 : :
219 : : virtual sal_Bool IsValid() const;
220 : :
221 : : virtual void SetNotifyHdl( const Link& );
222 : : virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
223 : : virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
224 : : virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
225 : : virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
226 : : virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
227 : : virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
228 : : virtual MapMode GetMapMode() const;
229 : : virtual OutputDevice* GetRefDevice() const;
230 : : virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
231 : : virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
232 : : virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
233 : : virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
234 : : virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
235 : : virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
236 : : virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
237 : : virtual sal_Bool Delete( const ESelection& );
238 : : virtual sal_Bool InsertText( const String&, const ESelection& );
239 : : virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
240 : : virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
241 : : virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
242 : :
243 : : virtual const SfxItemSet* GetEmptyItemSetPtr();
244 : :
245 : : // implementation functions for XParagraphAppend and XTextPortionAppend
246 : : virtual void AppendParagraph();
247 : : virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
248 : : //XTextCopy
249 : : virtual void CopyText(const SvxTextForwarder& rSource);
250 : : };
251 : :
252 : : namespace accessibility
253 : : {
254 : : class AccessibleEditableTextPara;
255 : : }
256 : :
257 : : // ====================================================================
258 : : typedef
259 : : cppu::WeakAggImplHelper8<
260 : : ::com::sun::star::text::XTextRange,
261 : : ::com::sun::star::beans::XPropertySet,
262 : : ::com::sun::star::beans::XMultiPropertySet,
263 : : ::com::sun::star::beans::XMultiPropertyStates,
264 : : ::com::sun::star::beans::XPropertyState,
265 : : ::com::sun::star::lang::XServiceInfo,
266 : : ::com::sun::star::text::XTextRangeCompare,
267 : : ::com::sun::star::lang::XUnoTunnel >
268 : : SvxUnoTextRangeBase_Base;
269 : :
270 : : class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public SvxUnoTextRangeBase_Base,
271 : : private osl::DebugBase<SvxUnoTextRangeBase>
272 : : {
273 : : friend class SvxUnoTextRangeEnumeration;
274 : : friend class ::accessibility::AccessibleEditableTextPara;
275 : :
276 : : protected:
277 : : SvxEditSource* mpEditSource;
278 : : ESelection maSelection;
279 : : const SvxItemPropertySet* mpPropSet;
280 : :
281 : : virtual void SAL_CALL _setPropertyValue( const ::rtl::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);
282 : : virtual ::com::sun::star::uno::Any SAL_CALL _getPropertyValue( const ::rtl::OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
283 : :
284 : : virtual void SAL_CALL _setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::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);
285 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL _getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, sal_Int32 nPara = -1 ) throw (::com::sun::star::uno::RuntimeException);
286 : :
287 : : virtual ::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);
288 : : virtual ::com::sun::star::beans::PropertyState SAL_CALL _getPropertyState( const ::rtl::OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
289 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL _getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
290 : : // returns true if property found or false if unknown property
291 : : virtual sal_Bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertySimpleEntry* pMap, ::com::sun::star::beans::PropertyState& rState);
292 : :
293 : : virtual void SAL_CALL _setPropertyToDefault( const ::rtl::OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
294 : : virtual void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara ) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
295 : : void SetEditSource( SvxEditSource* _pEditSource ) throw();
296 : :
297 : : virtual void getPropertyValue( const SfxItemPropertySimpleEntry* pMap, com::sun::star::uno::Any& rAny, const SfxItemSet& rSet ) throw(::com::sun::star::beans::UnknownPropertyException );
298 : : virtual 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 );
299 : :
300 : : public:
301 : : SvxUnoTextRangeBase( const SvxItemPropertySet* _pSet ) throw();
302 : : SvxUnoTextRangeBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet ) throw();
303 : : SvxUnoTextRangeBase( const SvxUnoTextRangeBase& rRange ) throw();
304 : : virtual ~SvxUnoTextRangeBase() throw();
305 : :
306 : : // Internal
307 : 31002 : const ESelection& GetSelection() const throw() { CheckSelection( ((SvxUnoTextRangeBase*)this)->maSelection, mpEditSource->GetTextForwarder() ); return maSelection; };
308 : : void SetSelection( const ESelection& rSelection ) throw();
309 : :
310 : : virtual void CollapseToStart(void) throw();
311 : : virtual void CollapseToEnd(void) throw();
312 : : virtual sal_Bool IsCollapsed(void) throw();
313 : : virtual sal_Bool GoLeft(sal_Int16 nCount, sal_Bool Expand) throw();
314 : : virtual sal_Bool GoRight(sal_Int16 nCount, sal_Bool Expand) throw();
315 : : virtual void GotoStart(sal_Bool Expand) throw();
316 : : virtual void GotoEnd(sal_Bool Expand) throw();
317 : :
318 : : //const SfxItemPropertyMapEntry* getPropertyMapEntries() const throw() { return maPropSet.getPropertyMapEntries(); }
319 : 6152 : const SvxItemPropertySet* getPropertySet() const throw() { return mpPropSet; }
320 : 91823 : SvxEditSource* GetEditSource() const throw() { return mpEditSource; }
321 : :
322 : : static sal_Bool SetPropertyValueHelper( const SfxItemSet& rOldSet, const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = NULL, SvxEditSource* pEditSource = NULL );
323 : : static sal_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 );
324 : :
325 : : void attachField( const SvxFieldData* pData ) throw();
326 : :
327 : : UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextRangeBase )
328 : :
329 : : // ::com::sun::star::text::XTextRange
330 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
331 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
332 : : virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
333 : : virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
334 : :
335 : : // ::com::sun::star::beans::XPropertySet
336 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
337 : : virtual void SAL_CALL setPropertyValue( const ::rtl::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);
338 : : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
339 : : virtual void SAL_CALL addPropertyChangeListener( const ::rtl::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);
340 : : virtual void SAL_CALL removePropertyChangeListener( const ::rtl::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);
341 : : virtual void SAL_CALL addVetoableChangeListener( const ::rtl::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);
342 : : virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::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);
343 : :
344 : : // XMultiPropertySet
345 : : virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::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);
346 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
347 : : virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
348 : : virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
349 : : virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
350 : :
351 : : // ::com::sun::star::beans::XPropertyState
352 : : virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
353 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
354 : : virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
355 : : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
356 : :
357 : : // ::com::sun::star::beans::XMultiPropertyStates
358 : : //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
359 : : virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
360 : : virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
361 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
362 : :
363 : : // XTextRangeCompare
364 : : 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);
365 : : 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);
366 : :
367 : : // ::com::sun::star::lang::XServiceInfo
368 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
369 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
370 : : static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static( ) SAL_THROW(());
371 : : };
372 : :
373 : : // ====================================================================
374 : :
375 : : class SvxUnoTextBase;
376 : : class EDITENG_DLLPUBLIC SvxUnoTextRange : public SvxUnoTextRangeBase
377 : : {
378 : : friend class SvxUnoTextRangeEnumeration;
379 : : private:
380 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
381 : : sal_Bool mbPortion;
382 : :
383 : : public:
384 : : SvxUnoTextRange( const SvxUnoTextBase& rParent, sal_Bool bPortion = sal_False ) throw();
385 : : virtual ~SvxUnoTextRange() throw();
386 : :
387 : : // ::com::sun::star::text::XTextRange
388 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
389 : :
390 : : // ::com::sun::star::lang::XServiceInfo
391 : : virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
392 : : };
393 : :
394 : : typedef
395 : : cppu::AggImplInheritanceHelper4<
396 : : SvxUnoTextRangeBase,
397 : : ::com::sun::star::text::XTextAppend,
398 : : ::com::sun::star::text::XTextCopy,
399 : : ::com::sun::star::container::XEnumerationAccess,
400 : : ::com::sun::star::text::XTextRangeMover >
401 : : SvxUnoTextBase_Base0;
402 : :
403 : : // Extra indirection to keep MSC from trying to (unsuccessfully) fully
404 : : // instantiate a non-DLLPUBLIC template base class of a DLLPUBLIC class:
405 : : class SvxUnoTextBase_Base: public SvxUnoTextBase_Base0 {
406 : : protected:
407 : : explicit SvxUnoTextBase_Base(SvxUnoTextBase_Base const &) throw ();
408 : : explicit SvxUnoTextBase_Base(SvxItemPropertySet const * set) throw ();
409 : : SvxUnoTextBase_Base(
410 : : SvxEditSource const * source, SvxItemPropertySet const * set) throw ();
411 : : virtual ~SvxUnoTextBase_Base() throw ();
412 : :
413 : : private:
414 : : void operator =(SvxUnoTextBase_Base const &); // not defined
415 : : };
416 : :
417 : : class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextBase_Base
418 : : {
419 : : protected:
420 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
421 : :
422 : : public:
423 : : SvxUnoTextBase( ) throw();
424 : : SvxUnoTextBase( const SvxItemPropertySet* _pSet ) throw();
425 : : SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > xParent ) throw();
426 : : SvxUnoTextBase( const SvxUnoTextBase& rText ) throw();
427 : : virtual ~SvxUnoTextBase() throw();
428 : :
429 : : UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
430 : :
431 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
432 : :
433 : : // ::com::sun::star::text::XSimpleText
434 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw(::com::sun::star::uno::RuntimeException);
435 : : 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);
436 : : virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, sal_Bool bAbsorb ) throw(::com::sun::star::uno::RuntimeException);
437 : : 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);
438 : :
439 : : // ::com::sun::star::text::XText
440 : : 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);
441 : : 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);
442 : : virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
443 : : virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
444 : :
445 : : // ::com::sun::star::text::XTextRange
446 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
447 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
448 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
449 : :
450 : : // ::com::sun::star::container::XEnumerationAccess
451 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
452 : :
453 : : // ::com::sun::star::container::XElementAccess
454 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
455 : : virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
456 : :
457 : : // ::com::sun::star::text::XTextRangeMover
458 : : 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);
459 : :
460 : : // com::sun::star::text::XParagraphAppend (new import API)
461 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendParagraph( 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);
462 : : 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);
463 : :
464 : : // com::sun::star::text::XTextPortionAppend (new import API)
465 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextPortion( const ::rtl::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);
466 : :
467 : : // com::sun::star::text::XTextCopy
468 : : virtual void SAL_CALL copyText( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCopy >& xSource ) throw (::com::sun::star::uno::RuntimeException);
469 : :
470 : : // ::com::sun::star::lang::XServiceInfo
471 : : virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
472 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
473 : : static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static( ) SAL_THROW(());
474 : : };
475 : :
476 : : // ====================================================================
477 : : class EDITENG_DLLPUBLIC SvxUnoText : public SvxUnoTextBase
478 : : {
479 : : public:
480 : : SvxUnoText( ) throw();
481 : : SvxUnoText( const SvxItemPropertySet* _pSet ) throw();
482 : : SvxUnoText( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > xParent ) throw();
483 : : SvxUnoText( const SvxUnoText& rText ) throw();
484 : : virtual ~SvxUnoText() throw();
485 : :
486 : : // Internal
487 : : static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
488 : : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
489 : : throw(::com::sun::star::uno::RuntimeException);
490 : : };
491 : :
492 : : // ====================================================================
493 : :
494 : : class SvxUnoTextContentEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun::star::container::XEnumeration >
495 : : {
496 : : private:
497 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
498 : : SvxEditSource* mpEditSource;
499 : : sal_uInt16 mnNextParagraph;
500 : : const SvxUnoTextBase& mrText;
501 : :
502 : : public:
503 : : SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText ) throw();
504 : : virtual ~SvxUnoTextContentEnumeration() throw();
505 : :
506 : : // ::com::sun::star::container::XEnumeration
507 : : virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException);
508 : : 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);
509 : : };
510 : :
511 : : // ====================================================================
512 : :
513 : : typedef
514 : : cppu::AggImplInheritanceHelper2<
515 : : SvxUnoTextRangeBase,
516 : : ::com::sun::star::text::XTextContent,
517 : : ::com::sun::star::container::XEnumerationAccess >
518 : : SvxUnoTextContent_Base;
519 : :
520 : : class SvxUnoTextContent : public SvxUnoTextContent_Base
521 : : {
522 : : friend class SvxUnoTextContentEnumeration;
523 : : private:
524 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
525 : : sal_uInt16 mnParagraph;
526 : : const SvxUnoTextBase& mrParentText;
527 : :
528 : : // for xComponent
529 : : ::osl::Mutex maDisposeContainerMutex;
530 : : ::cppu::OInterfaceContainerHelper maDisposeListeners;
531 : : bool mbDisposing;
532 : :
533 : : protected:
534 : : using SvxUnoTextRangeBase::setPropertyValue;
535 : : using SvxUnoTextRangeBase::getPropertyValue;
536 : :
537 : : public:
538 : : SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw();
539 : : SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw();
540 : : virtual ~SvxUnoTextContent() throw();
541 : :
542 : : // ::com::sun::star::text::XTextRange
543 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
544 : :
545 : : // ::com::sun::star::text::XTextContent -> ::com::sun::star::lang::XComponent
546 : : 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);
547 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException);
548 : :
549 : : // ::com::sun::star::lang::XComponent
550 : : virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
551 : : virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
552 : : virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
553 : :
554 : : // ::com::sun::star::container::XEnumerationAccess
555 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
556 : :
557 : : // ::com::sun::star::container::XElementAccess
558 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
559 : : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
560 : :
561 : : // ::com::sun::star::beans::XPropertySet
562 : : virtual void SAL_CALL setPropertyValue( const ::rtl::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);
563 : : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
564 : :
565 : : // XMultiPropertySet
566 : : virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::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);
567 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
568 : :
569 : : // ::com::sun::star::beans::XPropertyState
570 : : virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
571 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
572 : : virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
573 : :
574 : : // ::com::sun::star::lang::XServiceInfo
575 : : virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
576 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
577 : : };
578 : :
579 : : // ====================================================================
580 : :
581 : : class SvxUnoTextRangeEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun::star::container::XEnumeration >
582 : : {
583 : : private:
584 : : SvxEditSource* mpEditSource;
585 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
586 : : const SvxUnoTextBase& mrParentText;
587 : : sal_uInt16 mnParagraph;
588 : : std::vector<sal_uInt16>* mpPortions;
589 : : sal_uInt16 mnNextPortion;
590 : :
591 : : public:
592 : : SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw();
593 : : virtual ~SvxUnoTextRangeEnumeration() throw();
594 : :
595 : : // ::com::sun::star::container::XEnumeration
596 : : virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException);
597 : : 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);
598 : : };
599 : :
600 : : // ====================================================================
601 : :
602 : : typedef
603 : : cppu::AggImplInheritanceHelper1<
604 : : SvxUnoTextRangeBase,
605 : : ::com::sun::star::text::XTextCursor >
606 : : SvxUnoTextCursor_Base0;
607 : :
608 : : // Extra indirection to keep MSC from trying to (unsuccessfully) fully
609 : : // instantiate a non-DLLPUBLIC template base class of a DLLPUBLIC class:
610 : : class SvxUnoTextCursor_Base: public SvxUnoTextCursor_Base0 {
611 : : protected:
612 : : explicit SvxUnoTextCursor_Base(SvxUnoTextCursor_Base const & base) throw ();
613 : : explicit SvxUnoTextCursor_Base(SvxUnoTextRangeBase const & base) throw ();
614 : : virtual ~SvxUnoTextCursor_Base() throw ();
615 : :
616 : : private:
617 : : void operator =(SvxUnoTextCursor_Base const &); // not defined
618 : : };
619 : :
620 : : class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextCursor_Base
621 : : {
622 : : private:
623 : : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
624 : :
625 : : public:
626 : : SvxUnoTextCursor( const SvxUnoTextBase& rText ) throw();
627 : : SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw();
628 : : virtual ~SvxUnoTextCursor() throw();
629 : :
630 : : // ::com::sun::star::text::XTextRange
631 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
632 : : virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
633 : : virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
634 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
635 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
636 : :
637 : : // ::com::sun::star::text::XTextCursor -> ::com::sun::star::text::XTextRange
638 : : virtual void SAL_CALL collapseToStart( ) throw(::com::sun::star::uno::RuntimeException);
639 : : virtual void SAL_CALL collapseToEnd( ) throw(::com::sun::star::uno::RuntimeException);
640 : : virtual sal_Bool SAL_CALL isCollapsed( ) throw(::com::sun::star::uno::RuntimeException);
641 : : virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
642 : : virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
643 : : virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
644 : : virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
645 : : 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);
646 : :
647 : : // ::com::sun::star::lang::XServiceInfo
648 : : virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
649 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
650 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
651 : : };
652 : :
653 : : EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
654 : : EDITENG_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
655 : : EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
656 : : EDITENG_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
657 : :
658 : : #endif
659 : :
660 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|