11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
31d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file
51d2dbeb0SAndrew Rist * distributed with this work for additional information
61d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file
71d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
131d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the
171d2dbeb0SAndrew Rist * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist * under the License.
19cdf0e10cSrcweir *
201d2dbeb0SAndrew Rist *************************************************************/
211d2dbeb0SAndrew Rist
221d2dbeb0SAndrew Rist
23*39acede3Smseidel
24cdf0e10cSrcweir #ifndef SW_NDTXT_HXX
25cdf0e10cSrcweir #define SW_NDTXT_HXX
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <cppuhelper/weakref.hxx>
28cdf0e10cSrcweir
29cdf0e10cSrcweir #include "swdllapi.h"
30cdf0e10cSrcweir #include <error.h>
31cdf0e10cSrcweir #include <node.hxx>
32cdf0e10cSrcweir #include <hintids.hxx>
33cdf0e10cSrcweir #include <ndhints.hxx>
34cdf0e10cSrcweir #include <errhdl.hxx>
35cdf0e10cSrcweir #include <modeltoviewhelper.hxx>
36cdf0e10cSrcweir #include <SwNumberTreeTypes.hxx>
37cdf0e10cSrcweir #include <IDocumentContentOperations.hxx>
38cdf0e10cSrcweir
39cdf0e10cSrcweir #include <sfx2/Metadatable.hxx>
40cdf0e10cSrcweir
41cdf0e10cSrcweir #include <vector>
42cdf0e10cSrcweir #include <set>
43cdf0e10cSrcweir
44cdf0e10cSrcweir class SfxHint;
45cdf0e10cSrcweir class SwNumRule;
46cdf0e10cSrcweir class SwNodeNum;
47cdf0e10cSrcweir class SwList;
48cdf0e10cSrcweir class SvxLRSpaceItem;
49cdf0e10cSrcweir
50cdf0e10cSrcweir namespace utl {
51cdf0e10cSrcweir class TransliterationWrapper;
52cdf0e10cSrcweir }
53cdf0e10cSrcweir
54cdf0e10cSrcweir class SwTxtFmtColl;
55cdf0e10cSrcweir class SwCntntFrm;
5669a74367SOliver-Rainer Wittmann class SwTxtFld;
5769a74367SOliver-Rainer Wittmann class SwTxtInputFld;
58cdf0e10cSrcweir class SfxItemSet;
59cdf0e10cSrcweir class SwUndoTransliterate;
60cdf0e10cSrcweir
61cdf0e10cSrcweir
62cdf0e10cSrcweir struct SwSpellArgs; // for Spell(), splargs.hxx
63cdf0e10cSrcweir struct SwConversionArgs; // for Convert(), splargs.hxx
64cdf0e10cSrcweir class SwInterHyphInfo; // for Hyphenate(), splargs.hxx
65*39acede3Smseidel class SwWrongList; // for OnlineSpelling
66cdf0e10cSrcweir class SwGrammarMarkUp;
67cdf0e10cSrcweir class OutputDevice;
68cdf0e10cSrcweir class SwScriptInfo;
69cdf0e10cSrcweir struct SwDocStat;
70cdf0e10cSrcweir struct SwParaIdleData_Impl;
71cdf0e10cSrcweir
72cdf0e10cSrcweir namespace com { namespace sun { namespace star {
73cdf0e10cSrcweir namespace uno {
74cdf0e10cSrcweir template < class > class Sequence;
75cdf0e10cSrcweir }
76cdf0e10cSrcweir namespace text { class XTextContent; }
77cdf0e10cSrcweir } } }
78cdf0e10cSrcweir
79cdf0e10cSrcweir typedef std::set< xub_StrLen > SwSoftPageBreakList;
80cdf0e10cSrcweir
81cdf0e10cSrcweir // --------------------
82cdf0e10cSrcweir // SwTxtNode
83cdf0e10cSrcweir // --------------------
84cdf0e10cSrcweir class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
85cdf0e10cSrcweir {
86cdf0e10cSrcweir
87cdf0e10cSrcweir // fuer das Erzeugen des ersten TextNode
88cdf0e10cSrcweir friend class SwDoc; // CTOR und AppendTxtNode()
89cdf0e10cSrcweir friend class SwNodes;
90cdf0e10cSrcweir friend class SwTxtFrm;
91cdf0e10cSrcweir friend class SwScriptInfo;
92cdf0e10cSrcweir
93cdf0e10cSrcweir //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
94cdf0e10cSrcweir //Also niemals direkt zugreifen!
95cdf0e10cSrcweir SwpHints *m_pSwpHints;
96cdf0e10cSrcweir
97cdf0e10cSrcweir mutable SwNodeNum* mpNodeNum; // Numerierung fuer diesen Absatz
98cdf0e10cSrcweir XubString m_Text;
99cdf0e10cSrcweir
100cdf0e10cSrcweir SwParaIdleData_Impl* m_pParaIdleData_Impl;
101cdf0e10cSrcweir
102cdf0e10cSrcweir // Some of the chars this para are hidden. Paragraph has to be reformatted
103cdf0e10cSrcweir // on changing the view to print preview.
104cdf0e10cSrcweir mutable bool m_bContainsHiddenChars : 1;
105cdf0e10cSrcweir // The whole paragraph is hidden because of the hidden text attribute
106cdf0e10cSrcweir mutable bool m_bHiddenCharsHidePara : 1;
107cdf0e10cSrcweir // The last two flags have to be recalculated if this flag is set:
108cdf0e10cSrcweir mutable bool m_bRecalcHiddenCharFlags : 1;
109cdf0e10cSrcweir
110cdf0e10cSrcweir mutable bool m_bLastOutlineState : 1;
111cdf0e10cSrcweir bool m_bNotifiable;
112cdf0e10cSrcweir
113cdf0e10cSrcweir // sal_uInt8 nOutlineLevel; //#outline level, removed by zhaojianwei.
114cdf0e10cSrcweir
11569a74367SOliver-Rainer Wittmann bool mbEmptyListStyleSetDueToSetOutlineLevelAttr;
11669a74367SOliver-Rainer Wittmann
117cdf0e10cSrcweir // boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
118cdf0e10cSrcweir // <ResetAllAttr(..)> method is running.
119cdf0e10cSrcweir // Needed to avoid duplicate handling of attribute change actions.
120cdf0e10cSrcweir bool mbInSetOrResetAttr;
121cdf0e10cSrcweir // pointer to the list, to whose the text node is added to
122cdf0e10cSrcweir SwList* mpList;
123cdf0e10cSrcweir /// #i111677# cached expansion (for clipboard)
124cdf0e10cSrcweir ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache;
125cdf0e10cSrcweir
126cdf0e10cSrcweir ::com::sun::star::uno::WeakReference<
127cdf0e10cSrcweir ::com::sun::star::text::XTextContent> m_wXParagraph;
128cdf0e10cSrcweir
12956b35d86SArmin Le Grand //UUUU DrawingLayer FillAttributes in a preprocessed form for primitive usage
13056b35d86SArmin Le Grand drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes;
13156b35d86SArmin Le Grand
132cdf0e10cSrcweir SW_DLLPRIVATE SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl,
133cdf0e10cSrcweir const SfxItemSet* pAutoAttr = 0 );
134cdf0e10cSrcweir
135cdf0e10cSrcweir // Kopiert die Attribute an nStart nach pDest.
136cdf0e10cSrcweir SW_DLLPRIVATE void CopyAttr( SwTxtNode *pDest, const xub_StrLen nStart, const xub_StrLen nOldPos);
137cdf0e10cSrcweir
138cdf0e10cSrcweir SW_DLLPRIVATE SwTxtNode* _MakeNewTxtNode( const SwNodeIndex&, sal_Bool bNext = sal_True,
139cdf0e10cSrcweir sal_Bool bChgFollow = sal_True );
140cdf0e10cSrcweir
141cdf0e10cSrcweir SW_DLLPRIVATE void CutImpl(
142cdf0e10cSrcweir SwTxtNode * const pDest, const SwIndex & rDestStart,
143cdf0e10cSrcweir const SwIndex & rStart, /*const*/ xub_StrLen nLen,
144cdf0e10cSrcweir const bool bUpdate = true );
145cdf0e10cSrcweir
146cdf0e10cSrcweir // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
147cdf0e10cSrcweir SW_DLLPRIVATE void MoveTxtAttr_To_AttrSet(); // wird von SplitNode gerufen.
148cdf0e10cSrcweir
149cdf0e10cSrcweir // lege den spz. AttrSet an
150cdf0e10cSrcweir SW_DLLPRIVATE virtual void NewAttrSet( SwAttrPool& );
151cdf0e10cSrcweir
152cdf0e10cSrcweir SW_DLLPRIVATE void Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
153cdf0e10cSrcweir xub_StrLen nEndPos, sal_Bool bExpandFlds ) const;
154cdf0e10cSrcweir
155cdf0e10cSrcweir // Optimization: Asking for information about hidden characters at SwScriptInfo
156cdf0e10cSrcweir // updates these flags.
IsCalcHiddenCharFlags() const157cdf0e10cSrcweir inline bool IsCalcHiddenCharFlags() const
158cdf0e10cSrcweir { return m_bRecalcHiddenCharFlags; }
SetHiddenCharAttribute(bool bNewHiddenCharsHidePara,bool bNewContainsHiddenChars) const159cdf0e10cSrcweir inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars ) const
160cdf0e10cSrcweir {
161cdf0e10cSrcweir m_bHiddenCharsHidePara = bNewHiddenCharsHidePara;
162cdf0e10cSrcweir m_bContainsHiddenChars = bNewContainsHiddenChars;
163cdf0e10cSrcweir m_bRecalcHiddenCharFlags = false;
164cdf0e10cSrcweir }
165cdf0e10cSrcweir
166cdf0e10cSrcweir SW_DLLPRIVATE void CalcHiddenCharFlags() const;
167cdf0e10cSrcweir
168cdf0e10cSrcweir SW_DLLPRIVATE SwNumRule * _GetNumRule(sal_Bool bInParent = sal_True) const;
169cdf0e10cSrcweir
170cdf0e10cSrcweir SW_DLLPRIVATE void SetLanguageAndFont( const SwPaM &rPaM,
171cdf0e10cSrcweir LanguageType nLang, sal_uInt16 nLangWhichId,
172cdf0e10cSrcweir const Font *pFont, sal_uInt16 nFontWhichId );
173cdf0e10cSrcweir
174cdf0e10cSrcweir //
175cdf0e10cSrcweir // Start: Data collected during idle time
176cdf0e10cSrcweir //
177cdf0e10cSrcweir SW_DLLPRIVATE void SetParaNumberOfWords( sal_uLong nTmpWords ) const;
178cdf0e10cSrcweir SW_DLLPRIVATE sal_uLong GetParaNumberOfWords() const;
179cdf0e10cSrcweir SW_DLLPRIVATE void SetParaNumberOfChars( sal_uLong nTmpChars ) const;
180cdf0e10cSrcweir SW_DLLPRIVATE sal_uLong GetParaNumberOfChars() const;
181cdf0e10cSrcweir SW_DLLPRIVATE void InitSwParaStatistics( bool bNew );
182cdf0e10cSrcweir
183cdf0e10cSrcweir /** create number for this text node, if not already existing
184cdf0e10cSrcweir
185cdf0e10cSrcweir @return number of this node
186cdf0e10cSrcweir */
187cdf0e10cSrcweir SwNodeNum* CreateNum() const;
188cdf0e10cSrcweir
189cdf0e10cSrcweir inline void TryDeleteSwpHints();
190cdf0e10cSrcweir
191cdf0e10cSrcweir SW_DLLPRIVATE void impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet);
192cdf0e10cSrcweir
19369a74367SOliver-Rainer Wittmann const SwTxtInputFld* GetOverlappingInputFld( const SwTxtAttr& rTxtAttr ) const;
19469a74367SOliver-Rainer Wittmann
195cdf0e10cSrcweir public:
19691100364SJian Hong Cheng //Bug 120881:Modify here for Directly Page Numbering
19791100364SJian Hong Cheng bool HasPageNumberField();
19891100364SJian Hong Cheng //Bug 120881(End)
199cdf0e10cSrcweir bool IsWordCountDirty() const;
200cdf0e10cSrcweir bool IsWrongDirty() const;
201cdf0e10cSrcweir bool IsGrammarCheckDirty() const;
202cdf0e10cSrcweir bool IsSmartTagDirty() const; // SMARTTAGS
203cdf0e10cSrcweir bool IsAutoCompleteWordDirty() const;
204cdf0e10cSrcweir void SetWordCountDirty( bool bNew ) const;
205cdf0e10cSrcweir void SetWrongDirty( bool bNew ) const;
206cdf0e10cSrcweir void SetGrammarCheckDirty( bool bNew ) const;
207cdf0e10cSrcweir void SetSmartTagDirty( bool bNew ) const; // SMARTTAGS
208cdf0e10cSrcweir void SetAutoCompleteWordDirty( bool bNew ) const;
209cdf0e10cSrcweir void SetWrong( SwWrongList* pNew, bool bDelete = true );
210cdf0e10cSrcweir SwWrongList* GetWrong();
211cdf0e10cSrcweir const SwWrongList* GetWrong() const;
212cdf0e10cSrcweir void SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete = true );
213cdf0e10cSrcweir SwGrammarMarkUp* GetGrammarCheck();
214cdf0e10cSrcweir // SMARTTAGS
215cdf0e10cSrcweir void SetSmartTags( SwWrongList* pNew, bool bDelete = true );
216cdf0e10cSrcweir SwWrongList* GetSmartTags();
217abbaf3ecSJian Hong Cheng //Modify here for #119405, by easyfan, 2012-05-24
218abbaf3ecSJian Hong Cheng bool TryCharSetExpandToNum(const SfxItemSet& pCharSet);
219abbaf3ecSJian Hong Cheng //End of modification, by easyfan
220cdf0e10cSrcweir
221cdf0e10cSrcweir //
222cdf0e10cSrcweir // End: Data collected during idle time
223cdf0e10cSrcweir //
224cdf0e10cSrcweir protected:
225cdf0e10cSrcweir // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
226cdf0e10cSrcweir virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
227cdf0e10cSrcweir virtual void SwClientNotify( const SwModify&, const SfxHint& );
228cdf0e10cSrcweir
229cdf0e10cSrcweir public:
230cdf0e10cSrcweir using SwCntntNode::GetAttr;
231cdf0e10cSrcweir
GetTxt() const232cdf0e10cSrcweir const String& GetTxt() const { return m_Text; }
233cdf0e10cSrcweir
234cdf0e10cSrcweir // getters for SwpHints
235cdf0e10cSrcweir inline SwpHints &GetSwpHints();
236cdf0e10cSrcweir inline const SwpHints &GetSwpHints() const;
GetpSwpHints()237cdf0e10cSrcweir inline SwpHints *GetpSwpHints() { return m_pSwpHints; }
GetpSwpHints() const238cdf0e10cSrcweir inline const SwpHints *GetpSwpHints() const { return m_pSwpHints; }
HasHints() const239cdf0e10cSrcweir inline bool HasHints() const { return m_pSwpHints ? true : false; }
240cdf0e10cSrcweir inline SwpHints &GetOrCreateSwpHints();
241cdf0e10cSrcweir
242cdf0e10cSrcweir virtual ~SwTxtNode();
243cdf0e10cSrcweir
244cdf0e10cSrcweir virtual xub_StrLen Len() const;
245cdf0e10cSrcweir
246cdf0e10cSrcweir // steht in itratr
247cdf0e10cSrcweir void GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, sal_uLong &rAbs,
248cdf0e10cSrcweir OutputDevice* pOut = 0 ) const;
249cdf0e10cSrcweir
250cdf0e10cSrcweir // overriding to handle change of certain paragraph attributes
251cdf0e10cSrcweir virtual sal_Bool SetAttr( const SfxPoolItem& );
252cdf0e10cSrcweir virtual sal_Bool SetAttr( const SfxItemSet& rSet );
253cdf0e10cSrcweir virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
254cdf0e10cSrcweir virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
255cdf0e10cSrcweir virtual sal_uInt16 ResetAllAttr();
256cdf0e10cSrcweir
257cdf0e10cSrcweir /// insert text content
258cdf0e10cSrcweir void InsertText( const XubString & rStr, const SwIndex & rIdx,
259cdf0e10cSrcweir const enum IDocumentContentOperations::InsertFlags nMode
260cdf0e10cSrcweir = IDocumentContentOperations::INS_DEFAULT );
261cdf0e10cSrcweir
262cdf0e10cSrcweir /** delete text content
263cdf0e10cSrcweir ATTENTION: must not be called with a range that overlaps the start of
264cdf0e10cSrcweir an attribute with both extent and dummy char
265cdf0e10cSrcweir */
266cdf0e10cSrcweir void EraseText ( const SwIndex &rIdx, const xub_StrLen nCount = STRING_LEN,
267cdf0e10cSrcweir const enum IDocumentContentOperations::InsertFlags nMode
268cdf0e10cSrcweir = IDocumentContentOperations::INS_DEFAULT );
269cdf0e10cSrcweir
270cdf0e10cSrcweir /** delete all attributes.
271cdf0e10cSrcweir If neither pSet nor nWhich is given, delete all attributes (except
272cdf0e10cSrcweir refmarks, toxmarks, meta) in range.
273cdf0e10cSrcweir @param rIdx start position
274cdf0e10cSrcweir @param nLen range in which attributes will be deleted
275cdf0e10cSrcweir @param pSet if not 0, delete only attributes contained in pSet
276cdf0e10cSrcweir @param nWhich if not 0, delete only attributes with matching which
277cdf0e10cSrcweir @param bInclRefToxMark
278cdf0e10cSrcweir refmarks, toxmarks, and metas will be ignored unless this is true
279cdf0e10cSrcweir ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
280cdf0e10cSrcweir */
28169a74367SOliver-Rainer Wittmann void RstTxtAttr(
2824d322ebcSOliver-Rainer Wittmann const SwIndex &rIdx,
2834d322ebcSOliver-Rainer Wittmann const xub_StrLen nLen,
2844d322ebcSOliver-Rainer Wittmann const sal_uInt16 nWhich = 0,
2854d322ebcSOliver-Rainer Wittmann const SfxItemSet* pSet = 0,
2864d322ebcSOliver-Rainer Wittmann const sal_Bool bInclRefToxMark = sal_False );
287cdf0e10cSrcweir void GCAttr();
288cdf0e10cSrcweir
289cdf0e10cSrcweir // loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
290cdf0e10cSrcweir void DestroyAttr( SwTxtAttr* pAttr );
291cdf0e10cSrcweir
292cdf0e10cSrcweir // loesche alle Attribute aus dem SwpHintsArray.
293cdf0e10cSrcweir void ClearSwpHintsArr( bool bDelFields );
294cdf0e10cSrcweir
295*39acede3Smseidel /// Insert pAttr into hints array. @return true if inserted successfully
296cdf0e10cSrcweir bool InsertHint( SwTxtAttr * const pAttr,
297cdf0e10cSrcweir const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
298cdf0e10cSrcweir /// create new text attribute from rAttr and insert it
299cdf0e10cSrcweir /// @return inserted hint; 0 if not sure the hint is inserted
300cdf0e10cSrcweir SwTxtAttr* InsertItem( SfxPoolItem& rAttr,
301cdf0e10cSrcweir const xub_StrLen nStart, const xub_StrLen nEnd,
302cdf0e10cSrcweir const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
303cdf0e10cSrcweir
304cdf0e10cSrcweir // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
305cdf0e10cSrcweir // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
30669a74367SOliver-Rainer Wittmann sal_Bool SetAttr(
30769a74367SOliver-Rainer Wittmann const SfxItemSet& rSet,
30869a74367SOliver-Rainer Wittmann const xub_StrLen nStt,
30969a74367SOliver-Rainer Wittmann const xub_StrLen nEnd,
310cdf0e10cSrcweir const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
31169a74367SOliver-Rainer Wittmann
312cdf0e10cSrcweir // erfrage die Attribute vom TextNode ueber den Bereich
313cdf0e10cSrcweir // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
314cdf0e10cSrcweir // If <bMergeIndentValuesOfNumRule> == sal_True, the indent attributes of
315cdf0e10cSrcweir // the corresponding list level of an applied list style is merged into
316cdf0e10cSrcweir // the requested item set as a LR-SPACE item, if <bOnlyTxtAttr> == sal_False,
317cdf0e10cSrcweir // corresponding node has not its own indent attributes and the
318cdf0e10cSrcweir // position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT.
319cdf0e10cSrcweir sal_Bool GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
320cdf0e10cSrcweir sal_Bool bOnlyTxtAttr = sal_False,
321cdf0e10cSrcweir sal_Bool bGetFromChrFmt = sal_True,
322cdf0e10cSrcweir const bool bMergeIndentValuesOfNumRule = false ) const;
323cdf0e10cSrcweir // <--
324cdf0e10cSrcweir
325cdf0e10cSrcweir // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
326cdf0e10cSrcweir void FmtToTxtAttr( SwTxtNode* pNd );
327cdf0e10cSrcweir
328cdf0e10cSrcweir /// delete all attributes of type nWhich at nStart (opt. end nEnd)
329cdf0e10cSrcweir void DeleteAttributes( const sal_uInt16 nWhich,
330cdf0e10cSrcweir const xub_StrLen nStart, const xub_StrLen nEnd = 0 );
331cdf0e10cSrcweir /// delete the attribute pTxtAttr
332cdf0e10cSrcweir void DeleteAttribute ( SwTxtAttr * const pTxtAttr );
333cdf0e10cSrcweir
334cdf0e10cSrcweir // Aktionen auf Text und Attributen
335cdf0e10cSrcweir // introduce optional parameter to control, if all attributes have to be copied.
336cdf0e10cSrcweir void CopyText( SwTxtNode * const pDest,
337cdf0e10cSrcweir const SwIndex &rStart,
338cdf0e10cSrcweir const xub_StrLen nLen,
339cdf0e10cSrcweir const bool bForceCopyOfAllAttrs = false );
340cdf0e10cSrcweir void CopyText( SwTxtNode * const pDest,
341cdf0e10cSrcweir const SwIndex &rDestStart,
342cdf0e10cSrcweir const SwIndex &rStart,
343cdf0e10cSrcweir xub_StrLen nLen,
344cdf0e10cSrcweir const bool bForceCopyOfAllAttrs = false );
345cdf0e10cSrcweir
346cdf0e10cSrcweir void CutText(SwTxtNode * const pDest,
347cdf0e10cSrcweir const SwIndex & rStart, const xub_StrLen nLen);
348cdf0e10cSrcweir inline void CutText(SwTxtNode * const pDest, const SwIndex &rDestStart,
349cdf0e10cSrcweir const SwIndex & rStart, const xub_StrLen nLen);
350cdf0e10cSrcweir
351cdf0e10cSrcweir /// replace nDelLen characters at rStart with rText
352cdf0e10cSrcweir void ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
353cdf0e10cSrcweir const XubString& rText );
354cdf0e10cSrcweir void ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen, const XubString& rText,
355cdf0e10cSrcweir const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
356cdf0e10cSrcweir
357cdf0e10cSrcweir // virtuelle Methoden aus dem CntntNode
358cdf0e10cSrcweir virtual SwCntntFrm *MakeFrm( SwFrm* );
359cdf0e10cSrcweir virtual SwCntntNode *SplitCntntNode( const SwPosition & );
360cdf0e10cSrcweir virtual SwCntntNode *JoinNext();
361cdf0e10cSrcweir virtual SwCntntNode *JoinPrev();
362cdf0e10cSrcweir
363cdf0e10cSrcweir SwCntntNode *AppendNode( const SwPosition & );
364cdf0e10cSrcweir
365cdf0e10cSrcweir // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen
366cdf0e10cSrcweir sal_Bool DontExpandFmt( const SwIndex& rIdx, bool bFlag = true,
367cdf0e10cSrcweir sal_Bool bFmtToTxtAttributes = sal_True );
368cdf0e10cSrcweir
369cdf0e10cSrcweir enum GetTxtAttrMode {
37069a74367SOliver-Rainer Wittmann DEFAULT, /// DEFAULT: (Start <= nIndex < End)
37169a74367SOliver-Rainer Wittmann EXPAND, /// EXPAND : (Start < nIndex <= End)
372cdf0e10cSrcweir PARENT, /// PARENT : (Start < nIndex < End)
373cdf0e10cSrcweir };
374cdf0e10cSrcweir
375cdf0e10cSrcweir /** get the innermost text attribute covering position nIndex.
376cdf0e10cSrcweir @param nWhich only attribute with this id is returned.
377cdf0e10cSrcweir @param eMode the predicate for matching (@see GetTxtAttrMode).
378cdf0e10cSrcweir
379cdf0e10cSrcweir ATTENTION: this function is not well-defined for those
380cdf0e10cSrcweir hints of which several may cover a single position, like
381cdf0e10cSrcweir RES_TXTATR_CHARFMT, RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK
382cdf0e10cSrcweir */
38369a74367SOliver-Rainer Wittmann SwTxtAttr *GetTxtAttrAt(
38469a74367SOliver-Rainer Wittmann xub_StrLen const nIndex,
38569a74367SOliver-Rainer Wittmann RES_TXTATR const nWhich,
386cdf0e10cSrcweir enum GetTxtAttrMode const eMode = DEFAULT ) const;
387cdf0e10cSrcweir
388cdf0e10cSrcweir /** get the innermost text attributes covering position nIndex.
389cdf0e10cSrcweir @param nWhich only attributes with this id are returned.
390cdf0e10cSrcweir @param eMode the predicate for matching (@see GetTxtAttrMode).
391cdf0e10cSrcweir */
39269a74367SOliver-Rainer Wittmann ::std::vector<SwTxtAttr *> GetTxtAttrsAt(
39369a74367SOliver-Rainer Wittmann xub_StrLen const nIndex,
394cdf0e10cSrcweir RES_TXTATR const nWhich,
395cdf0e10cSrcweir enum GetTxtAttrMode const eMode = DEFAULT ) const;
396cdf0e10cSrcweir
397cdf0e10cSrcweir /** get the text attribute at position nIndex which owns
398cdf0e10cSrcweir the dummy character CH_TXTATR_* at that position, if one exists.
399cdf0e10cSrcweir @param nIndex the position in the text
400cdf0e10cSrcweir @param nWhich if different from RES_TXTATR_END, return only
401cdf0e10cSrcweir attribute with given which id
402cdf0e10cSrcweir @return the text attribute at nIndex of type nWhich, if it exists
403cdf0e10cSrcweir */
40469a74367SOliver-Rainer Wittmann SwTxtAttr *GetTxtAttrForCharAt(
40569a74367SOliver-Rainer Wittmann const xub_StrLen nIndex,
406cdf0e10cSrcweir const RES_TXTATR nWhich = RES_TXTATR_END ) const;
407cdf0e10cSrcweir
40869a74367SOliver-Rainer Wittmann SwTxtFld* GetFldTxtAttrAt(
40969a74367SOliver-Rainer Wittmann const xub_StrLen nIndex,
41069a74367SOliver-Rainer Wittmann const bool bIncludeInputFldAtStart = false ) const;
41169a74367SOliver-Rainer Wittmann
412cdf0e10cSrcweir // Aktuelles Wort zurueckliefern
413cdf0e10cSrcweir XubString GetCurWord(xub_StrLen) const;
414cdf0e10cSrcweir sal_uInt16 Spell(SwSpellArgs*);
415cdf0e10cSrcweir sal_uInt16 Convert( SwConversionArgs & );
416cdf0e10cSrcweir
417cdf0e10cSrcweir inline SwTxtFmtColl *GetTxtColl() const;
418cdf0e10cSrcweir virtual SwFmtColl *ChgFmtColl( SwFmtColl* );
419cdf0e10cSrcweir void _ChgTxtCollUpdateNum( const SwTxtFmtColl* pOld,
420cdf0e10cSrcweir const SwTxtFmtColl* pNew );
421cdf0e10cSrcweir
422cdf0e10cSrcweir // kopiere die Collection mit allen Autoformaten zum Dest-Node
423cdf0e10cSrcweir // dieser kann auch in einem anderen Dokument stehen!
424cdf0e10cSrcweir // (Methode steht im ndcopy.cxx!!)
425cdf0e10cSrcweir void CopyCollFmt( SwTxtNode& rDestNd );
426cdf0e10cSrcweir
427cdf0e10cSrcweir //
428cdf0e10cSrcweir // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
429cdf0e10cSrcweir //
430cdf0e10cSrcweir
431cdf0e10cSrcweir /**
432cdf0e10cSrcweir Returns numbering rule of this text node.
433cdf0e10cSrcweir
434*39acede3Smseidel @param bInParent search in parent attributes, too
435cdf0e10cSrcweir
436cdf0e10cSrcweir @return numbering rule of this text node or NULL if none is set
437cdf0e10cSrcweir */
438cdf0e10cSrcweir SwNumRule *GetNumRule(sal_Bool bInParent = sal_True) const;
439cdf0e10cSrcweir
GetNum() const440cdf0e10cSrcweir inline const SwNodeNum* GetNum() const
441cdf0e10cSrcweir {
442cdf0e10cSrcweir return mpNodeNum;
443cdf0e10cSrcweir }
444cdf0e10cSrcweir
445cdf0e10cSrcweir SwNumberTree::tNumberVector GetNumberVector() const;
446cdf0e10cSrcweir
447cdf0e10cSrcweir /**
448cdf0e10cSrcweir Returns if this text node is an outline.
449cdf0e10cSrcweir
450cdf0e10cSrcweir @retval true this text node is an outline
451cdf0e10cSrcweir @retval false else
452cdf0e10cSrcweir */
453cdf0e10cSrcweir bool IsOutline() const;
454cdf0e10cSrcweir
455cdf0e10cSrcweir bool IsOutlineStateChanged() const;
456cdf0e10cSrcweir
457cdf0e10cSrcweir void UpdateOutlineState();
458cdf0e10cSrcweir
459cdf0e10cSrcweir /**
460cdf0e10cSrcweir Notify this textnode that its numbering rule has changed.
461cdf0e10cSrcweir */
462cdf0e10cSrcweir void NumRuleChgd();
463cdf0e10cSrcweir
464cdf0e10cSrcweir /** Returns outline of numbering string
465cdf0e10cSrcweir
466cdf0e10cSrcweir Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
467cdf0e10cSrcweir if the prefix and the suffix strings have to been included or not.
468cdf0e10cSrcweir
469cdf0e10cSrcweir @param _bInclPrefixAndSuffixStrings
470cdf0e10cSrcweir optional input parameter - boolean indicating, if the prefix and the
471cdf0e10cSrcweir suffix strings have to been included or not. default value = <true>
472cdf0e10cSrcweir
473cdf0e10cSrcweir @param _nRestrictToThisLevel
474cdf0e10cSrcweir optional input parameter - unsigned integer indicating the maximum outline
475cdf0e10cSrcweir level to which the output string must be restricted to. Default value is
476cdf0e10cSrcweir MAXLEVEL
477cdf0e10cSrcweir */
478cdf0e10cSrcweir XubString GetNumString( const bool _bInclPrefixAndSuffixStrings = true, const unsigned int _nRestrictToThisLevel = MAXLEVEL ) const;
479cdf0e10cSrcweir
480cdf0e10cSrcweir /**
481cdf0e10cSrcweir Returns the additional indents of this text node and its numbering.
482cdf0e10cSrcweir
483cdf0e10cSrcweir @param bTxtLeft ???
484cdf0e10cSrcweir
485cdf0e10cSrcweir @return additional indents
486cdf0e10cSrcweir */
487cdf0e10cSrcweir long GetLeftMarginWithNum( sal_Bool bTxtLeft = sal_False ) const;
488cdf0e10cSrcweir
489cdf0e10cSrcweir /**
490cdf0e10cSrcweir Returns the combined first line indent of this text node and
491cdf0e10cSrcweir its numbering.
492cdf0e10cSrcweir
493cdf0e10cSrcweir @param the first line indent of this text node taking the
494cdf0e10cSrcweir numbering into account (return parameter)
495cdf0e10cSrcweir
496cdf0e10cSrcweir @retval sal_True this node has SwNodeNum and has numbering rule
497cdf0e10cSrcweir @retval sal_False else
498cdf0e10cSrcweir */
499cdf0e10cSrcweir sal_Bool GetFirstLineOfsWithNum( short& rFirstOffset ) const;
500cdf0e10cSrcweir
501cdf0e10cSrcweir SwTwips GetAdditionalIndentForStartingNewList() const;
502cdf0e10cSrcweir
503cdf0e10cSrcweir // --> OD 2008-12-02 #i96772#
504cdf0e10cSrcweir void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const;
505cdf0e10cSrcweir // <--
506cdf0e10cSrcweir
507cdf0e10cSrcweir /** return left margin for tab stop position calculation
508cdf0e10cSrcweir
509cdf0e10cSrcweir OD 2008-06-30 #i91133#
510cdf0e10cSrcweir Needed for text formatting
511cdf0e10cSrcweir Method considers new list level attributes, which also can provide a left margin value
512cdf0e10cSrcweir
513cdf0e10cSrcweir @author OD
514cdf0e10cSrcweir */
515cdf0e10cSrcweir long GetLeftMarginForTabCalculation() const;
516cdf0e10cSrcweir
517cdf0e10cSrcweir /** -> #i29560
518cdf0e10cSrcweir Returns if this text node has a number.
519cdf0e10cSrcweir
520cdf0e10cSrcweir This text node has a number if it has a SwNodeNum and a
521cdf0e10cSrcweir numbering rule and the numbering format specified for the
522cdf0e10cSrcweir level of the SwNodeNum is of an enumeration type.
523cdf0e10cSrcweir
524cdf0e10cSrcweir @retval sal_True This text node has a number.
525cdf0e10cSrcweir @retval sal_False else
526cdf0e10cSrcweir */
527cdf0e10cSrcweir sal_Bool HasNumber() const;
528cdf0e10cSrcweir
529cdf0e10cSrcweir /** -> #i29560
530cdf0e10cSrcweir Returns if this text node has a bullet.
531cdf0e10cSrcweir
532cdf0e10cSrcweir This text node has a bullet if it has a SwNodeNum and a
533cdf0e10cSrcweir numbering rule and the numbering format specified for the
534cdf0e10cSrcweir level of the SwNodeNum is of a bullet type.
535cdf0e10cSrcweir
536cdf0e10cSrcweir @retval sal_True This text node has a bullet.
537cdf0e10cSrcweir @retval sal_False else
538cdf0e10cSrcweir */
539cdf0e10cSrcweir sal_Bool HasBullet() const;
540cdf0e10cSrcweir
541cdf0e10cSrcweir /** -> #i27615#
542cdf0e10cSrcweir Returns is this text node is numbered.
543cdf0e10cSrcweir
544cdf0e10cSrcweir This node is numbered if it has a SwNodeNum and it has a
545cdf0e10cSrcweir numbering rule and has not a hidden SwNodeNum.
546cdf0e10cSrcweir
547cdf0e10cSrcweir ATTENTION: Returns sal_True even if the SwNumFmt has type
548cdf0e10cSrcweir SVX_NUM_NUMBER_NONE.
549cdf0e10cSrcweir
550cdf0e10cSrcweir @retval sal_True This node is numbered.
551cdf0e10cSrcweir @retval sal_False else
552cdf0e10cSrcweir */
553cdf0e10cSrcweir sal_Bool IsNumbered() const;
554cdf0e10cSrcweir
555cdf0e10cSrcweir /** -> #i27615#
556cdf0e10cSrcweir Returns if this text node has a marked label.
557cdf0e10cSrcweir
558cdf0e10cSrcweir @retval true This text node has a marked label.
559cdf0e10cSrcweir @retval false else
560cdf0e10cSrcweir */
561cdf0e10cSrcweir bool HasMarkedLabel() const;
562cdf0e10cSrcweir
563cdf0e10cSrcweir /** Sets the list level of this text node.
564cdf0e10cSrcweir
565cdf0e10cSrcweir Side effect, when the text node is a list item:
566cdf0e10cSrcweir The text node's representation in the list tree (<SwNodeNum> instance)
567cdf0e10cSrcweir is updated.
568cdf0e10cSrcweir
569cdf0e10cSrcweir @param nLevel level to set
570cdf0e10cSrcweir */
571cdf0e10cSrcweir void SetAttrListLevel(int nLevel);
572cdf0e10cSrcweir
573cdf0e10cSrcweir bool HasAttrListLevel() const;
574cdf0e10cSrcweir
575cdf0e10cSrcweir int GetAttrListLevel() const;
576cdf0e10cSrcweir
577cdf0e10cSrcweir /** Returns the actual list level of this text node, when it is a list item
578cdf0e10cSrcweir
579cdf0e10cSrcweir @return the actual list level of this text node, if it is a list item,
580cdf0e10cSrcweir -1 otherwise
581cdf0e10cSrcweir */
582cdf0e10cSrcweir int GetActualListLevel() const;
583cdf0e10cSrcweir
584cdf0e10cSrcweir /**
585cdf0e10cSrcweir Returns outline level of this text node.
586cdf0e10cSrcweir
587cdf0e10cSrcweir If a text node has an outline number (i.e. it has an SwNodeNum
588cdf0e10cSrcweir and a outline numbering rule) the outline level is the level of
589cdf0e10cSrcweir this SwNodeNum.
590cdf0e10cSrcweir
591cdf0e10cSrcweir If a text node has no outline number and has a paragraph style
592cdf0e10cSrcweir attached the outline level is the outline level of the
593cdf0e10cSrcweir paragraph style.
594cdf0e10cSrcweir
595cdf0e10cSrcweir Otherwise the text node has no outline level (NO_NUMBERING).
596cdf0e10cSrcweir
597cdf0e10cSrcweir NOTE: The outline level of text nodes is subject to change. The
598cdf0e10cSrcweir plan is to have an SwTxtNode::nOutlineLevel member that is
599cdf0e10cSrcweir updated from a paragraph style upon appliance of that paragraph
600cdf0e10cSrcweir style.
601cdf0e10cSrcweir
602cdf0e10cSrcweir @return outline level or NO_NUMBERING if there is no outline level
603cdf0e10cSrcweir */
60428f5a95aSOliver-Rainer Wittmann int GetAttrOutlineLevel() const;
605cdf0e10cSrcweir
606cdf0e10cSrcweir /**
607cdf0e10cSrcweir Sets the out line level *at* a text node.
608cdf0e10cSrcweir
609cdf0e10cSrcweir @param nLevel the level to be set
610cdf0e10cSrcweir
611cdf0e10cSrcweir If the text node has an outline number the level is set at the
612cdf0e10cSrcweir outline number.
613cdf0e10cSrcweir
614cdf0e10cSrcweir If the text node has no outline number but has a paragraph
615cdf0e10cSrcweir style applied the outline level is set at the paragraph style.
616cdf0e10cSrcweir
617cdf0e10cSrcweir NOTE: This is subject to change, see GetOutlineLevel.
618cdf0e10cSrcweir */
61928f5a95aSOliver-Rainer Wittmann void SetAttrOutlineLevel(int nLevel);
620cdf0e10cSrcweir
621cdf0e10cSrcweir bool IsEmptyListStyleDueToSetOutlineLevelAttr();
622cdf0e10cSrcweir void SetEmptyListStyleDueToSetOutlineLevelAttr();
623cdf0e10cSrcweir void ResetEmptyListStyleDueToResetOutlineLevelAttr();
62428f5a95aSOliver-Rainer Wittmann
625cdf0e10cSrcweir
626cdf0e10cSrcweir /**
627cdf0e10cSrcweir Returns the width of leading tabs/blanks in this paragraph.
628cdf0e10cSrcweir This space will be converted into numbering indent if the paragraph
629cdf0e10cSrcweir is set to be numbered.
630cdf0e10cSrcweir
631cdf0e10cSrcweir @return the width of the leading whitespace
632cdf0e10cSrcweir */
633cdf0e10cSrcweir sal_uInt16 GetWidthOfLeadingTabs() const;
634cdf0e10cSrcweir
635cdf0e10cSrcweir
636cdf0e10cSrcweir /**
637cdf0e10cSrcweir Returns if the paragraph has a visible numbering or bullet.
638cdf0e10cSrcweir This includes all kinds of numbering/bullet/outlines.
639cdf0e10cSrcweir Note: This function returns false, if the numbering format is
640cdf0e10cSrcweir SVX_NUM_NUMBER_NONE or if the numbering/bullet has been deleted.
641cdf0e10cSrcweir
642cdf0e10cSrcweir @return sal_True if the paragraph has a visible numbering/bullet/outline
643cdf0e10cSrcweir */
644cdf0e10cSrcweir bool HasVisibleNumberingOrBullet() const;
645cdf0e10cSrcweir
646cdf0e10cSrcweir void SetListId( const String sListId );
647cdf0e10cSrcweir String GetListId() const;
648cdf0e10cSrcweir
649cdf0e10cSrcweir /** Determines, if the list level indent attributes can be applied to the
650cdf0e10cSrcweir paragraph.
651cdf0e10cSrcweir
652cdf0e10cSrcweir The list level indents can be applied to the paragraph under the one
653cdf0e10cSrcweir of following conditions:
654cdf0e10cSrcweir - the list style is directly applied to the paragraph and the paragraph
655cdf0e10cSrcweir has no own indent attributes.
656cdf0e10cSrcweir - the list style is applied to the paragraph through one of its paragraph
657cdf0e10cSrcweir styles, the paragraph has no own indent attributes and on the paragraph
658cdf0e10cSrcweir style hierarchy from the paragraph to the paragraph style with the
659cdf0e10cSrcweir list style no indent attributes are found.
660cdf0e10cSrcweir
661cdf0e10cSrcweir @author OD
662cdf0e10cSrcweir
663cdf0e10cSrcweir @return boolean
664cdf0e10cSrcweir */
665cdf0e10cSrcweir bool AreListLevelIndentsApplicable() const;
666cdf0e10cSrcweir
667cdf0e10cSrcweir /** Retrieves the list tab stop position, if the paragraph's list level defines
668cdf0e10cSrcweir one and this list tab stop has to merged into the tap stops of the paragraph
669cdf0e10cSrcweir
670cdf0e10cSrcweir @author OD
671cdf0e10cSrcweir
672cdf0e10cSrcweir @param nListTabStopPosition
673cdf0e10cSrcweir output parameter - containing the list tab stop position
674cdf0e10cSrcweir
675cdf0e10cSrcweir @return boolean - indicating, if a list tab stop position is provided
676cdf0e10cSrcweir */
677cdf0e10cSrcweir bool GetListTabStopPosition( long& nListTabStopPosition ) const;
678cdf0e10cSrcweir
679cdf0e10cSrcweir /** Retrieves the character following the list label, if the paragraph's
680cdf0e10cSrcweir list level defines one.
681cdf0e10cSrcweir
682cdf0e10cSrcweir @author OD
683cdf0e10cSrcweir
684cdf0e10cSrcweir @return XubString - the list tab stop position
685cdf0e10cSrcweir */
686cdf0e10cSrcweir XubString GetLabelFollowedBy() const;
687cdf0e10cSrcweir
688cdf0e10cSrcweir //
689cdf0e10cSrcweir // END OF BULLET/NUMBERING/OUTLINE STUFF:
690cdf0e10cSrcweir //
691cdf0e10cSrcweir
692cdf0e10cSrcweir void fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const;
693cdf0e10cSrcweir
694cdf0e10cSrcweir sal_uInt16 GetLang( const xub_StrLen nBegin, const xub_StrLen nLen = 0,
695cdf0e10cSrcweir sal_uInt16 nScript = 0 ) const;
696cdf0e10cSrcweir
697cdf0e10cSrcweir // steht in ndcopy.cxx
698cdf0e10cSrcweir sal_Bool IsSymbol( const xub_StrLen nBegin ) const; // steht in itratr.cxx
699cdf0e10cSrcweir virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
700cdf0e10cSrcweir
701cdf0e10cSrcweir // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph
702cdf0e10cSrcweir sal_Bool Hyphenate( SwInterHyphInfo &rHyphInf );
703cdf0e10cSrcweir void DelSoftHyph( const xub_StrLen nStart, const xub_StrLen nEnd );
704cdf0e10cSrcweir
705cdf0e10cSrcweir // --> OD 2007-11-15 #i83479#
706cdf0e10cSrcweir // add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating,
707cdf0e10cSrcweir // when <bWithNum = true> that a space is inserted after the string for
708cdf0e10cSrcweir // the list label.
709cdf0e10cSrcweir // add 5th optional parameter <bWithSpacesForLevel> indicating, if additional
710cdf0e10cSrcweir // spaces are inserted in front of the expanded text string depending on
711cdf0e10cSrcweir // the list level.
712cdf0e10cSrcweir XubString GetExpandTxt( const xub_StrLen nIdx = 0,
713cdf0e10cSrcweir const xub_StrLen nLen = STRING_LEN,
714cdf0e10cSrcweir const bool bWithNum = false,
715cdf0e10cSrcweir const bool bAddSpaceAfterListLabelStr = false,
716cdf0e10cSrcweir const bool bWithSpacesForLevel = false ) const;
717cdf0e10cSrcweir // <--
718cdf0e10cSrcweir sal_Bool GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx = 0,
719cdf0e10cSrcweir xub_StrLen nIdx = 0, xub_StrLen nLen = STRING_LEN,
720cdf0e10cSrcweir sal_Bool bWithNum = sal_False, sal_Bool bWithFtn = sal_True,
721cdf0e10cSrcweir sal_Bool bReplaceTabsWithSpaces = sal_False ) const;
722cdf0e10cSrcweir
723cdf0e10cSrcweir /*
724cdf0e10cSrcweir *
725cdf0e10cSrcweir */
726cdf0e10cSrcweir const ModelToViewHelper::ConversionMap*
727cdf0e10cSrcweir BuildConversionMap( rtl::OUString& rExpandText ) const;
728cdf0e10cSrcweir
729cdf0e10cSrcweir XubString GetRedlineTxt( xub_StrLen nIdx = 0,
730cdf0e10cSrcweir xub_StrLen nLen = STRING_LEN,
731cdf0e10cSrcweir sal_Bool bExpandFlds = sal_False,
732cdf0e10cSrcweir sal_Bool bWithNum = sal_False ) const;
733cdf0e10cSrcweir //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen
734cdf0e10cSrcweir //bei nWishLen == 0 die des ersten Wortes
735cdf0e10cSrcweir sal_uInt16 GetDropLen( sal_uInt16 nWishLen) const;
736cdf0e10cSrcweir
737cdf0e10cSrcweir // Passes back info needed on the dropcap dimensions
738cdf0e10cSrcweir bool GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescent) const;
739cdf0e10cSrcweir
740cdf0e10cSrcweir // Hidden Paragraph Field:
CalcHiddenParaField()741cdf0e10cSrcweir inline bool CalcHiddenParaField()
742cdf0e10cSrcweir { return m_pSwpHints ? m_pSwpHints->CalcHiddenParaField() : false; }
743cdf0e10cSrcweir // set CalcVisible flags
SetCalcHiddenParaField()744cdf0e10cSrcweir inline void SetCalcHiddenParaField()
745cdf0e10cSrcweir { if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); }
746cdf0e10cSrcweir
747cdf0e10cSrcweir // is the paragraph visible?
HasHiddenParaField() const748cdf0e10cSrcweir inline bool HasHiddenParaField() const
749cdf0e10cSrcweir { return m_pSwpHints ? m_pSwpHints->HasHiddenParaField() : false; }
750cdf0e10cSrcweir
751cdf0e10cSrcweir //
752cdf0e10cSrcweir // Hidden Paragraph Field:
753cdf0e10cSrcweir //
HasHiddenCharAttribute(bool bWholePara) const754cdf0e10cSrcweir inline bool HasHiddenCharAttribute( bool bWholePara ) const
755cdf0e10cSrcweir {
756cdf0e10cSrcweir if ( m_bRecalcHiddenCharFlags )
757cdf0e10cSrcweir CalcHiddenCharFlags();
758cdf0e10cSrcweir return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars;
759cdf0e10cSrcweir }
760cdf0e10cSrcweir
SetCalcHiddenCharFlags() const761cdf0e10cSrcweir inline void SetCalcHiddenCharFlags() const
762cdf0e10cSrcweir { m_bRecalcHiddenCharFlags = true; }
763cdf0e10cSrcweir
764cdf0e10cSrcweir // --> FME 2004-06-08 #i12836# enhanced pdf
765cdf0e10cSrcweir //
766cdf0e10cSrcweir // Returns if the node is hidden due to
767cdf0e10cSrcweir // 1. HiddenParaField
768cdf0e10cSrcweir // 2. HiddenCharAttribute
769cdf0e10cSrcweir // 3. HiddenSection
770cdf0e10cSrcweir //
771cdf0e10cSrcweir bool IsHidden() const;
772cdf0e10cSrcweir // <--
773cdf0e10cSrcweir
774cdf0e10cSrcweir TYPEINFO(); // fuer rtti
775cdf0e10cSrcweir
776cdf0e10cSrcweir // override SwIndexReg
77769a74367SOliver-Rainer Wittmann virtual void Update(
77869a74367SOliver-Rainer Wittmann SwIndex const & rPos,
77969a74367SOliver-Rainer Wittmann const xub_StrLen nChangeLen,
78069a74367SOliver-Rainer Wittmann const bool bNegative = false,
78169a74367SOliver-Rainer Wittmann const bool bDelete = false );
782cdf0e10cSrcweir
783cdf0e10cSrcweir // change text to Upper/Lower/Hiragana/Katagana/...
784cdf0e10cSrcweir void TransliterateText( utl::TransliterationWrapper& rTrans,
785cdf0e10cSrcweir xub_StrLen nStart, xub_StrLen nEnd,
786cdf0e10cSrcweir SwUndoTransliterate* pUndo = 0 );
787cdf0e10cSrcweir
788cdf0e10cSrcweir // count words in given range
789cdf0e10cSrcweir void CountWords( SwDocStat& rStat, xub_StrLen nStart, xub_StrLen nEnd ) const;
790cdf0e10cSrcweir
791cdf0e10cSrcweir // Checks some global conditions like loading or destruction of document
792cdf0e10cSrcweir // to economize notifications
793cdf0e10cSrcweir bool IsNotificationEnabled() const;
794cdf0e10cSrcweir
795*39acede3Smseidel // Checks a temporary notification blocker and the global conditions of IsNotificationEnabled()
796cdf0e10cSrcweir bool IsNotifiable() const;
797cdf0e10cSrcweir
798cdf0e10cSrcweir void SetListRestart( bool bRestart );
799cdf0e10cSrcweir bool IsListRestart() const;
800cdf0e10cSrcweir
801cdf0e10cSrcweir void SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNum );
802cdf0e10cSrcweir bool HasAttrListRestartValue() const;
803cdf0e10cSrcweir SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const;
804cdf0e10cSrcweir SwNumberTree::tSwNumTreeNumber GetActualListStartValue() const;
805cdf0e10cSrcweir
806cdf0e10cSrcweir void SetCountedInList( bool bCounted );
807cdf0e10cSrcweir bool IsCountedInList() const;
808cdf0e10cSrcweir
809cdf0e10cSrcweir void AddToList();
810cdf0e10cSrcweir void RemoveFromList();
811cdf0e10cSrcweir bool IsInList() const;
812cdf0e10cSrcweir
813cdf0e10cSrcweir bool IsFirstOfNumRule() const;
814cdf0e10cSrcweir
815cdf0e10cSrcweir sal_uInt16 GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) const;
816cdf0e10cSrcweir
817cdf0e10cSrcweir SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
GetXParagraph() const818cdf0e10cSrcweir ::com::sun::star::text::XTextContent> const& GetXParagraph() const
819cdf0e10cSrcweir { return m_wXParagraph; }
SetXParagraph(::com::sun::star::uno::Reference<::com::sun::star::text::XTextContent> const & xParagraph)820cdf0e10cSrcweir SW_DLLPRIVATE void SetXParagraph(::com::sun::star::uno::Reference<
821cdf0e10cSrcweir ::com::sun::star::text::XTextContent> const& xParagraph)
822cdf0e10cSrcweir { m_wXParagraph = xParagraph; }
823cdf0e10cSrcweir
824cdf0e10cSrcweir // sfx2::Metadatable
825cdf0e10cSrcweir virtual ::sfx2::IXmlIdRegistry& GetRegistry();
826cdf0e10cSrcweir virtual bool IsInClipboard() const;
827cdf0e10cSrcweir virtual bool IsInUndo() const;
828cdf0e10cSrcweir virtual bool IsInContent() const;
829cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference<
830cdf0e10cSrcweir ::com::sun::star::rdf::XMetadatable > MakeUnoObject();
831cdf0e10cSrcweir
832cdf0e10cSrcweir DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
83356b35d86SArmin Le Grand
83456b35d86SArmin Le Grand //UUUU Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage
83556b35d86SArmin Le Grand virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
836cdf0e10cSrcweir };
837cdf0e10cSrcweir
838cdf0e10cSrcweir //-----------------------------------------------------------------------------
839cdf0e10cSrcweir
GetSwpHints()840cdf0e10cSrcweir inline SwpHints & SwTxtNode::GetSwpHints()
841cdf0e10cSrcweir {
842cdf0e10cSrcweir ASSERT_ID( m_pSwpHints, ERR_NOHINTS);
843cdf0e10cSrcweir return *m_pSwpHints;
844cdf0e10cSrcweir }
GetSwpHints() const845cdf0e10cSrcweir inline const SwpHints &SwTxtNode::GetSwpHints() const
846cdf0e10cSrcweir {
847cdf0e10cSrcweir ASSERT_ID( m_pSwpHints, ERR_NOHINTS);
848cdf0e10cSrcweir return *m_pSwpHints;
849cdf0e10cSrcweir }
850cdf0e10cSrcweir
GetOrCreateSwpHints()851cdf0e10cSrcweir inline SwpHints& SwTxtNode::GetOrCreateSwpHints()
852cdf0e10cSrcweir {
853cdf0e10cSrcweir if ( !m_pSwpHints )
854cdf0e10cSrcweir {
855cdf0e10cSrcweir m_pSwpHints = new SwpHints;
856cdf0e10cSrcweir }
857cdf0e10cSrcweir return *m_pSwpHints;
858cdf0e10cSrcweir }
859cdf0e10cSrcweir
TryDeleteSwpHints()860cdf0e10cSrcweir inline void SwTxtNode::TryDeleteSwpHints()
861cdf0e10cSrcweir {
862cdf0e10cSrcweir if ( m_pSwpHints && m_pSwpHints->CanBeDeleted() )
863cdf0e10cSrcweir {
864cdf0e10cSrcweir DELETEZ( m_pSwpHints );
865cdf0e10cSrcweir }
866cdf0e10cSrcweir }
867cdf0e10cSrcweir
GetTxtColl() const868cdf0e10cSrcweir inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const
869cdf0e10cSrcweir {
870cdf0e10cSrcweir return static_cast<SwTxtFmtColl*>(const_cast<SwModify*>(GetRegisteredIn()));
871cdf0e10cSrcweir }
872cdf0e10cSrcweir
873cdf0e10cSrcweir // fuer den IBM-Compiler nicht inlinen wg. 42876
874cdf0e10cSrcweir #ifndef ICC
875*39acede3Smseidel // Inline Methoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
GetTxtNode()876cdf0e10cSrcweir inline SwTxtNode *SwNode::GetTxtNode()
877cdf0e10cSrcweir {
878cdf0e10cSrcweir return ND_TEXTNODE == nNodeType ? static_cast<SwTxtNode*>(this) : 0;
879cdf0e10cSrcweir }
GetTxtNode() const880cdf0e10cSrcweir inline const SwTxtNode *SwNode::GetTxtNode() const
881cdf0e10cSrcweir {
882cdf0e10cSrcweir return ND_TEXTNODE == nNodeType ? static_cast<const SwTxtNode*>(this) : 0;
883cdf0e10cSrcweir }
884cdf0e10cSrcweir #endif
885cdf0e10cSrcweir
886cdf0e10cSrcweir inline void
CutText(SwTxtNode * const pDest,const SwIndex & rDestStart,const SwIndex & rStart,const xub_StrLen nLen)887cdf0e10cSrcweir SwTxtNode::CutText(SwTxtNode * const pDest, const SwIndex & rDestStart,
888cdf0e10cSrcweir const SwIndex & rStart, const xub_StrLen nLen)
889cdf0e10cSrcweir {
890cdf0e10cSrcweir CutImpl( pDest, rDestStart, rStart, nLen, true );
891cdf0e10cSrcweir }
892cdf0e10cSrcweir
893cdf0e10cSrcweir #endif
894