1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <tools/gen.hxx>
23 #include <tools/string.hxx>
25 #include <svl/brdcst.hxx>
27 #include <editeng/editdata.hxx>
28 #include <editeng/numitem.hxx>
29 #include <i18nlangtag/lang.h>
30 #include <tools/color.hxx>
31 #include <tools/contnr.hxx>
32 #include <vcl/graph.hxx>
33 #include <tools/link.hxx>
34 #include <rsc/rscsfx.hxx>
35 #include "editeng/editengdllapi.h"
36 #include <com/sun/star/lang/Locale.hpp>
38 #include <svtools/grfmgr.hxx>
40 #include <tools/rtti.hxx> // due to typedef TypeId
43 class OutlinerEditEng
;
48 class OutlinerParaObject
;
62 class SfxStyleSheetPool
;
66 class SvxNumBulletItem
;
67 class SvxNumberFormat
;
70 class SvKeyValueIterator
;
71 class SvxForbiddenCharactersTable
;
78 #include <com/sun/star/uno/Reference.h>
80 #include <rtl/ref.hxx>
81 #include <editeng/svxfont.hxx>
82 #include <editeng/eedata.hxx>
83 #include <editeng/paragraphdata.hxx>
86 //////////////////////////////////////////////////////////////////////////////
88 namespace com
{ namespace sun
{ namespace star
{ namespace linguistic2
{
94 typedef std::vector
<SpellPortion
> SpellPortions
;
97 namespace basegfx
{ class B2DPolyPolygon
; }
100 #define PARAFLAG_DROPTARGET 0x1000
101 #define PARAFLAG_DROPTARGET_EMPTY 0x2000
102 #define PARAFLAG_HOLDDEPTH 0x4000
103 #define PARAFLAG_SETBULLETTEXT 0x8000
104 #define PARAFLAG_ISPAGE 0x0100
107 #define OLUNDO_DEPTH EDITUNDO_USER
108 // #define OLUNDO_HEIGHT EDITUNDO_USER+1
109 #define OLUNDO_EXPAND EDITUNDO_USER+2
110 #define OLUNDO_COLLAPSE EDITUNDO_USER+3
111 // #define OLUNDO_REMOVE EDITUNDO_USER+4
112 #define OLUNDO_ATTR EDITUNDO_USER+5
113 #define OLUNDO_INSERT EDITUNDO_USER+6
114 // #define OLUNDO_MOVEPARAGRAPHS EDITUNDO_USER+7
115 #define OLUNDO_CHECKPARA EDITUNDO_USER+8
117 class Paragraph
: protected ParagraphData
120 friend class Outliner
;
121 friend class ParagraphList
;
122 friend class OutlinerView
;
123 friend class OutlinerParaObject
;
124 friend class OutlinerEditEng
;
125 friend class OutlinerUndoCheckPara
;
126 friend class OutlinerUndoChangeParaFlags
;
128 Paragraph
& operator=(const Paragraph
& rPara
);
135 sal_Bool
IsVisible() const { return bVisible
; }
136 void SetText( const OUString
& rText
) { aBulText
= rText
; aBulSize
.Width() = -1; }
137 void Invalidate() { aBulSize
.Width() = -1; }
138 void SetDepth( sal_Int16 nNewDepth
) { nDepth
= nNewDepth
; aBulSize
.Width() = -1; }
139 const OUString
& GetText() const { return aBulText
; }
141 Paragraph( sal_Int16 nDepth
);
142 Paragraph( const Paragraph
& );
143 Paragraph( const ParagraphData
& );
146 sal_Int16
GetDepth() const { return nDepth
; }
148 sal_Int16
GetNumberingStartValue() const { return mnNumberingStartValue
; }
149 void SetNumberingStartValue( sal_Int16 nNumberingStartValue
);
151 sal_Bool
IsParaIsNumberingRestart() const { return mbParaIsNumberingRestart
; }
152 void SetParaIsNumberingRestart( sal_Bool bParaIsNumberingRestart
);
154 void SetFlag( sal_uInt16 nFlag
) { nFlags
|= nFlag
; }
155 void RemoveFlag( sal_uInt16 nFlag
) { nFlags
&= ~nFlag
; }
156 bool HasFlag( sal_uInt16 nFlag
) const { return (nFlags
& nFlag
) != 0; }
161 sal_Int32 nStartPara
;
164 ParaRange( sal_Int32 nS
, sal_Int32 nE
) { nStartPara
= nS
, nEndPara
= nE
; }
167 sal_uInt16
Len() const { return 1 + ( ( nEndPara
> nStartPara
) ? (nEndPara
-nStartPara
) : (nStartPara
-nEndPara
) ); }
170 inline void ParaRange::Adjust()
172 if ( nStartPara
> nEndPara
)
174 sal_Int32 nTmp
= nStartPara
;
175 nStartPara
= nEndPara
;
180 class EDITENG_DLLPUBLIC OutlinerView
182 friend class Outliner
;
190 sal_Bool bBeginDragAtMove_OLDMEMBER
;
191 sal_Bool bInDragMode
;
192 Point aDDStartPosRef
;
193 Point aDDStartPosPix
;
194 sal_Int32 nDDStartPara
;
195 sal_Int32 nDDStartParaVisChildCount
;
196 sal_Int32 nDDCurPara
;
197 sal_uInt16 nDDStartDepth
;
198 sal_uInt16 nDDCurDepth
;
199 sal_uInt16 nDDMaxDepth
;
200 sal_Bool bDDChangingDepth
;
201 sal_Bool bDDCursorVisible
;
203 long nDDScrollLRBorderWidthWin
; // Left Right
204 long nDDScrollTBBorderWidthWin
; // Top Bottom
205 long nDDScrollLROffs
;
206 long nDDScrollTDOffs
;
214 MouseHypertext
= 2, // Outside OutputArea
215 MouseOutside
= 3, // Outside OutputArea
218 MouseTarget OLD_ePrevMouseTarget
;
220 EDITENG_DLLPRIVATE
void ImplExpandOrCollaps( sal_Int32 nStartPara
, sal_Int32 nEndPara
, sal_Bool bExpand
);
222 EDITENG_DLLPRIVATE sal_Int32
ImpCheckMousePos( const Point
& rPosPixel
, MouseTarget
& reTarget
);
223 EDITENG_DLLPRIVATE
void ImpToggleExpand( Paragraph
* pParentPara
);
224 EDITENG_DLLPRIVATE ParaRange
ImpGetSelectedParagraphs( sal_Bool bIncludeHiddenChildren
);
226 EDITENG_DLLPRIVATE Pointer
ImpGetMousePointer( MouseTarget eTarget
);
227 EDITENG_DLLPRIVATE sal_Int32
ImpInitPaste( sal_Int32
& rStart
);
228 EDITENG_DLLPRIVATE
void ImpPasted( sal_Int32 nStart
, sal_Int32 nPrevParaCount
, sal_Int32 nSize
);
229 EDITENG_DLLPRIVATE sal_Int32
ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected
);
230 EDITENG_DLLPRIVATE sal_Bool
ImpIsIndentingPages();
233 OutlinerView( Outliner
* pOut
, Window
* pWindow
);
234 virtual ~OutlinerView();
236 EditView
& GetEditView() const { return *pEditView
; }
238 void Scroll( long nHorzScroll
, long nVertScroll
);
240 void Paint( const Rectangle
& rRect
, OutputDevice
* pTargetDevice
= 0 );
241 sal_Bool
PostKeyEvent( const KeyEvent
& rKEvt
, Window
* pFrameWin
= NULL
);
242 sal_Bool
MouseButtonDown( const MouseEvent
& );
243 sal_Bool
MouseButtonUp( const MouseEvent
& );
244 sal_Bool
MouseMove( const MouseEvent
& );
246 void ShowCursor( sal_Bool bGotoCursor
= sal_True
);
249 Outliner
* GetOutliner() const { return pOwner
; }
251 void SetWindow( Window
* pWindow
);
252 Window
* GetWindow() const;
254 void SetReadOnly( sal_Bool bReadOnly
);
255 sal_Bool
IsReadOnly() const;
257 void SetOutputArea( const Rectangle
& rRect
);
258 Rectangle
GetOutputArea() const;
260 Rectangle
GetVisArea() const;
262 void CreateSelectionList (std::vector
<Paragraph
*> &aSelList
) ;
264 // Retruns the number of selected paragraphs
265 sal_Int32
Select( Paragraph
* pParagraph
,
266 sal_Bool bSelect
=sal_True
,
267 sal_Bool bWChildren
=sal_True
);
269 String
GetSelected() const;
270 void SelectRange( sal_Int32 nFirst
, sal_Int32 nCount
);
271 void SetAttribs( const SfxItemSet
& );
272 void Indent( short nDiff
);
273 void AdjustDepth( short nDX
); // Later replace with Indent!
275 sal_Bool
AdjustHeight( long nDY
);
277 sal_uLong
Read( SvStream
& rInput
, const String
& rBaseURL
, EETextFormat eFormat
, sal_Bool bSelect
= sal_False
, SvKeyValueIterator
* pHTTPHeaderAttrs
= NULL
);
279 void InsertText( const String
& rNew
, sal_Bool bSelect
= sal_False
);
280 void InsertText( const OutlinerParaObject
& rParaObj
);
286 void SetBackgroundColor( const Color
& rColor
);
287 Color
GetBackgroundColor();
289 SfxItemSet
GetAttribs();
296 const SfxStyleSheet
* GetStyleSheet() const;
297 SfxStyleSheet
* GetStyleSheet();
299 void SetControlWord( sal_uLong nWord
);
300 sal_uLong
GetControlWord() const;
302 void SetAnchorMode( EVAnchorMode eMode
);
303 EVAnchorMode
GetAnchorMode() const;
305 Pointer
GetPointer( const Point
& rPosPixel
);
306 void Command( const CommandEvent
& rCEvt
);
308 EESpellState
StartSpeller( sal_Bool bMultipleDoc
= sal_False
);
309 EESpellState
StartThesaurus();
310 sal_uInt16
StartSearchAndReplace( const SvxSearchItem
& rSearchItem
);
312 // for text conversion
313 void StartTextConversion( LanguageType nSrcLang
, LanguageType nDestLang
, const Font
*pDestFont
, sal_Int32 nOptions
, sal_Bool bIsInteractive
, sal_Bool bMultipleDoc
);
315 void TransliterateText( sal_Int32 nTransliterationMode
);
317 ESelection
GetSelection();
319 sal_uInt16
GetSelectedScriptType() const;
321 void SetVisArea( const Rectangle
& rRect
);
322 void SetSelection( const ESelection
& );
324 void RemoveAttribs( sal_Bool bRemoveParaAttribs
= sal_False
, sal_uInt16 nWhich
= 0, sal_Bool bKeepLanguages
= sal_False
);
325 void RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs
);
326 sal_Bool
HasSelection() const;
328 void InsertField( const SvxFieldItem
& rFld
);
329 const SvxFieldItem
* GetFieldUnderMousePointer() const;
330 const SvxFieldItem
* GetFieldAtSelection() const;
332 /** enables bullets for the selected paragraphs if the bullets/numbering of the first paragraph is off
333 or disables bullets/numbering for the selected paragraphs if the bullets/numbering of the first paragraph is on
335 void ToggleBullets();
337 void ToggleBulletsNumbering(
339 const bool bHandleBullets
,
340 const SvxNumRule
* pNumRule
= NULL
);
342 /** apply bullets/numbering for paragraphs
344 @param boolean bHandleBullets
346 false: handle numbering
349 numbering rule which needs to be applied. can be 0.
351 @param boolean bAtSelection
352 true: apply bullets/numbering at selected paragraphs
353 false: apply bullets/numbering at all paragraphs
355 void ApplyBulletsNumbering(
356 const bool bHandleBullets
,
357 const SvxNumRule
* pNewNumRule
,
358 const bool bCheckCurrentNumRuleBeforeApplyingNewNumRule
,
359 const bool bAtSelection
= false );
361 /** switch off bullets/numbering for paragraphs
363 @param boolean bAtSelection
364 true: switch off bullets/numbering at selected paragraphs
365 false: switch off bullets/numbering at all paragraphs
367 void SwitchOffBulletsNumbering(
368 const bool bAtSelection
= false );
370 /** enables numbering for the selected paragraphs that are not enabled and ignore all selected
371 paragraphs that already have numbering enabled.
373 void EnableBullets();
375 sal_Bool
IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong
= sal_False
);
376 sal_Bool
IsWrongSpelledWordAtPos( const Point
& rPosPixel
, sal_Bool bMarkIfWrong
= sal_False
);
377 void ExecuteSpellPopup( const Point
& rPosPixel
, Link
* pCallBack
= 0 );
379 void SetInvalidateMore( sal_uInt16 nPixel
);
380 sal_uInt16
GetInvalidateMore() const;
382 String
GetSurroundingText() const;
383 Selection
GetSurroundingTextSelection() const;
387 // some thesaurus functionality to avoid code duplication in different projects...
388 bool EDITENG_DLLPUBLIC
GetStatusValueForThesaurusFromContext( String
&rStatusVal
, LanguageType
&rLang
, const EditView
&rEditView
);
389 void EDITENG_DLLPUBLIC
ReplaceTextWithSynonym( EditView
&rEditView
, const String
&rSynonmText
);
391 typedef ::std::vector
< OutlinerView
* > ViewList
;
393 class EDITENG_DLLPUBLIC DrawPortionInfo
396 const Point
& mrStartPos
;
397 const String
& mrText
;
398 sal_uInt16 mnTextStart
;
399 sal_uInt16 mnTextLen
;
402 const SvxFont
& mrFont
;
403 const sal_Int32
* mpDXArray
;
405 const EEngineData::WrongSpellVector
* mpWrongSpellVector
;
406 const SvxFieldData
* mpFieldData
;
407 const ::com::sun::star::lang::Locale
* mpLocale
;
408 const Color maOverlineColor
;
409 const Color maTextLineColor
;
411 sal_uInt8 mnBiDiLevel
;
417 unsigned mbEndOfLine
: 1;
418 unsigned mbEndOfParagraph
: 1;
419 unsigned mbEndOfBullet
: 1;
421 sal_uInt8
GetBiDiLevel() const { return mnBiDiLevel
; }
422 sal_Bool
IsRTL() const { return mnBiDiLevel
% 2 ? sal_True
: sal_False
; }
427 sal_uInt16 nTxtStart
,
432 const sal_Int32
* pDXArr
,
433 const EEngineData::WrongSpellVector
* pWrongSpellVector
,
434 const SvxFieldData
* pFieldData
,
435 const ::com::sun::star::lang::Locale
* pLocale
,
436 const Color
& rOverlineColor
,
437 const Color
& rTextLineColor
,
438 sal_uInt8 nBiDiLevel
,
442 bool bEndOfParagraph
,
446 mnTextStart(nTxtStart
),
452 mpWrongSpellVector(pWrongSpellVector
),
453 mpFieldData(pFieldData
),
455 maOverlineColor(rOverlineColor
),
456 maTextLineColor(rTextLineColor
),
457 mnBiDiLevel(nBiDiLevel
),
459 mnWidthToFill( nWidthToFill
),
460 mbEndOfLine(bEndOfLine
),
461 mbEndOfParagraph(bEndOfParagraph
),
462 mbEndOfBullet(bEndOfBullet
)
466 class EDITENG_DLLPUBLIC DrawBulletInfo
469 const GraphicObject maBulletGraphicObject
;
470 Point maBulletPosition
;
474 const GraphicObject
& rBulletGraphicObject
,
475 const Point
& rBulletPosition
,
476 const Size
& rBulletSize
)
477 : maBulletGraphicObject(rBulletGraphicObject
),
478 maBulletPosition(rBulletPosition
),
479 maBulletSize(rBulletSize
)
483 struct EDITENG_DLLPUBLIC PaintFirstLineInfo
486 const Point
& mrStartPos
;
488 const Point
& mrOrigin
;
490 OutputDevice
* mpOutDev
;
492 PaintFirstLineInfo( sal_Int32 nPara
, const Point
& rStartPos
, long nBaseLineY
, const Point
& rOrigin
, short nOrientation
, OutputDevice
* pOutDev
)
493 : mnPara( nPara
), mrStartPos( rStartPos
), mnBaseLineY( nBaseLineY
), mrOrigin( rOrigin
), mnOrientation( nOrientation
), mpOutDev( pOutDev
)
503 const SvxFieldItem
& rFldItem
;
508 String aRepresentation
;
512 sal_Bool bSimpleClick
;
515 EditFieldInfo( const EditFieldInfo
& );
520 EditFieldInfo( Outliner
* pOutl
, const SvxFieldItem
& rFItem
, sal_Int32 nPa
, xub_StrLen nPo
)
524 nPara
= nPa
; nPos
= nPo
;
525 pTxtColor
= 0; pFldColor
= 0; bSimpleClick
= sal_False
;
534 Outliner
* GetOutliner() const { return pOutliner
; }
536 const SvxFieldItem
& GetField() const { return rFldItem
; }
538 Color
* GetTxtColor() const { return pTxtColor
; }
539 void SetTxtColor( const Color
& rColor
)
540 { delete pTxtColor
; pTxtColor
= new Color( rColor
); }
542 Color
* GetFldColor() const { return pFldColor
; }
543 void SetFldColor( const Color
& rColor
)
544 { delete pFldColor
; pFldColor
= new Color( rColor
); }
546 { delete pFldColor
; pFldColor
= 0; }
548 sal_Int32
GetPara() const { return nPara
; }
549 xub_StrLen
GetPos() const { return nPos
; }
551 sal_Bool
IsSimpleClick() const { return bSimpleClick
; }
552 void SetSimpleClick( sal_Bool bSimple
) { bSimpleClick
= bSimple
; }
554 const String
& GetRepresentation() const { return aRepresentation
; }
555 String
& GetRepresentation() { return aRepresentation
; }
556 void SetRepresentation( const String
& rStr
) { aRepresentation
= rStr
; }
558 void SetSdrPage( SdrPage
* pPage
) { mpSdrPage
= pPage
; }
559 SdrPage
* GetSdrPage() const { return mpSdrPage
; }
565 sal_uInt16 nType
; // see SvxNumberType
569 sal_Int32 nParagraph
;
572 EBulletInfo() : bVisible( sal_False
), nType( 0 ), nParagraph( EE_PARA_NOT_FOUND
) {}
575 #define OUTLINERMODE_DONTKNOW 0x0000
576 #define OUTLINERMODE_TEXTOBJECT 0x0001
577 #define OUTLINERMODE_TITLEOBJECT 0x0002
578 #define OUTLINERMODE_OUTLINEOBJECT 0x0003
579 #define OUTLINERMODE_OUTLINEVIEW 0x0004
581 #define OUTLINERMODE_USERMASK 0x00FF
583 #define OUTLINERMODE_SUBTITLE (0x0100|OUTLINERMODE_TEXTOBJECT)
584 #define OUTLINERMODE_NOTE (0x0200|OUTLINERMODE_TEXTOBJECT)
586 class EDITENG_DLLPUBLIC Outliner
: public SfxBroadcaster
588 friend class OutlinerView
;
589 friend class OutlinerEditEng
;
590 friend class OutlinerParaObject
;
591 friend class OLUndoExpand
;
592 friend class OutlinerUndoChangeDepth
;
593 friend class OutlinerUndoCheckPara
;
594 friend class OutlinerUndoChangeParaFlags
;
596 OutlinerEditEng
* pEditEngine
;
598 ParagraphList
* pParaList
;
601 Paragraph
* pHdlParagraph
;
602 sal_Int32 mnFirstSelPage
;
603 Link aDrawPortionHdl
;
606 Link aParaInsertedHdl
;
607 Link aParaRemovingHdl
;
608 Link aDepthChangedHdl
;
609 Link aWidthArrReqHdl
;
610 Link aBeginMovingHdl
;
612 Link aIndentingPagesHdl
;
613 Link aRemovingPagesHdl
;
614 Link aFieldClickedHdl
;
615 Link aCalcFieldValueHdl
;
616 Link maPaintFirstLineHdl
;
617 Link maBeginPasteOrDropHdl
;
618 Link maEndPasteOrDropHdl
;
620 sal_Int32 nDepthChangedHdlPrevDepth
;
621 sal_uInt16 mnDepthChangeHdlPrevFlags
;
623 const sal_Int16 nMinDepth
;
624 sal_Int32 nFirstPage
;
626 sal_uInt16 nOutlinerMode
;
628 sal_Bool bIsExpanding
; // Only valid in Expand/Collaps-Hdl, reset
629 sal_Bool bFirstParaIsEmpty
;
630 sal_Bool bBlockInsCallback
;
631 sal_Bool bStrippingPortions
;
636 DECL_LINK( ParaVisibleStateChangedHdl
, Paragraph
* );
637 DECL_LINK( BeginMovingParagraphsHdl
, void* );
638 DECL_LINK( EndMovingParagraphsHdl
, MoveParagraphsInfo
* );
639 DECL_LINK( BeginPasteOrDropHdl
, PasteOrDropInfos
* );
640 DECL_LINK( EndPasteOrDropHdl
, PasteOrDropInfos
* );
641 DECL_LINK( EditEngineNotifyHdl
, EENotify
* );
642 void ImplCheckParagraphs( sal_Int32 nStart
, sal_Int32 nEnd
);
643 bool ImplHasNumberFormat( sal_Int32 nPara
) const;
644 Size
ImplGetBulletSize( sal_Int32 nPara
);
645 sal_uInt16
ImplGetNumbering( sal_Int32 nPara
, const SvxNumberFormat
* pParaFmt
);
646 void ImplCalcBulletText( sal_Int32 nPara
, sal_Bool bRecalcLevel
, sal_Bool bRecalcChildren
);
647 String
ImplGetBulletText( sal_Int32 nPara
);
648 void ImplCheckNumBulletItem( sal_Int32 nPara
);
649 void ImplInitDepth( sal_Int32 nPara
, sal_Int16 nDepth
, sal_Bool bCreateUndo
, sal_Bool bUndoAction
= sal_False
);
650 void ImplSetLevelDependendStyleSheet( sal_Int32 nPara
, SfxStyleSheet
* pLevelStyle
= NULL
);
652 void ImplBlockInsertionCallbacks( sal_Bool b
);
654 void ImplCheckStyleSheet( sal_Int32 nPara
, sal_Bool bReplaceExistingStyle
);
655 void ImpRecalcBulletIndent( sal_Int32 nPara
);
657 const SvxBulletItem
& ImpGetBullet( sal_Int32 nPara
, sal_uInt16
& );
658 void ImpFilterIndents( sal_Int32 nFirstPara
, sal_Int32 nLastPara
);
659 bool ImpConvertEdtToOut( sal_Int32 nPara
, EditView
* pView
= 0 );
661 void ImpTextPasted( sal_Int32 nStartPara
, sal_Int32 nCount
);
662 long ImpCalcMaxBulletWidth( sal_Int32 nPara
, const SvxBulletItem
& rBullet
);
663 Font
ImpCalcBulletFont( sal_Int32 nPara
) const;
664 Rectangle
ImpCalcBulletArea( sal_Int32 nPara
, sal_Bool bAdjust
, sal_Bool bReturnPaperPos
);
665 long ImpGetTextIndent( sal_Int32 nPara
);
666 sal_Bool
ImpCanIndentSelectedPages( OutlinerView
* pCurView
);
667 sal_Bool
ImpCanDeleteSelectedPages( OutlinerView
* pCurView
);
668 sal_Bool
ImpCanDeleteSelectedPages( OutlinerView
* pCurView
, sal_Int32 nFirstPage
, sal_Int32 nPages
);
670 sal_uInt16
ImplGetOutlinerMode() const { return nOutlinerMode
& OUTLINERMODE_USERMASK
; }
671 void ImplCheckDepth( sal_Int16
& rnDepth
) const;
674 void ParagraphInserted( sal_Int32 nParagraph
);
675 void ParagraphDeleted( sal_Int32 nParagraph
);
676 void ParaAttribsChanged( sal_Int32 nParagraph
);
678 virtual void StyleSheetChanged( SfxStyleSheet
* pStyle
);
680 void InvalidateBullet( Paragraph
* pPara
, sal_Int32 nPara
);
681 void PaintBullet( sal_Int32 nPara
, const Point
& rStartPos
,
682 const Point
& rOrigin
, short nOrientation
,
683 OutputDevice
* pOutDev
);
685 // used by OutlinerEditEng. Allows Outliner objects to provide
686 // bullet access to the EditEngine.
687 virtual const SvxNumberFormat
* GetNumberFormat( sal_Int32 nPara
) const;
691 Outliner( SfxItemPool
* pPool
, sal_uInt16 nOutlinerMode
);
694 void Init( sal_uInt16 nOutlinerMode
);
695 sal_uInt16
GetMode() const { return nOutlinerMode
; }
697 void SetVertical( sal_Bool bVertical
);
698 sal_Bool
IsVertical() const;
700 void SetFixedCellHeight( sal_Bool bUseFixedCellHeight
);
702 void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir
);
703 EEHorizontalTextDirection
GetDefaultHorizontalTextDirection() const;
705 sal_uInt16
GetScriptType( const ESelection
& rSelection
) const;
706 LanguageType
GetLanguage( sal_Int32 nPara
, sal_uInt16 nPos
) const;
708 void SetAsianCompressionMode( sal_uInt16 nCompressionMode
);
710 void SetKernAsianPunctuation( sal_Bool bEnabled
);
712 void SetAddExtLeading( sal_Bool b
);
714 size_t InsertView( OutlinerView
* pView
, size_t nIndex
= size_t(-1) );
715 OutlinerView
* RemoveView( OutlinerView
* pView
);
716 OutlinerView
* RemoveView( size_t nIndex
);
717 OutlinerView
* GetView( size_t nIndex
) const;
718 size_t GetViewCount() const;
720 Paragraph
* Insert( const String
& rText
, sal_Int32 nAbsPos
= EE_PARA_APPEND
, sal_Int16 nDepth
= 0 );
721 void SetText( const OutlinerParaObject
& );
722 void AddText( const OutlinerParaObject
& );
723 void SetText( const String
& rText
, Paragraph
* pParagraph
);
724 String
GetText( Paragraph
* pPara
, sal_Int32 nParaCount
=1 ) const;
726 OutlinerParaObject
* CreateParaObject( sal_Int32 nStartPara
= 0, sal_Int32 nParaCount
= EE_PARA_ALL
) const;
728 const SfxItemSet
& GetEmptyItemSet() const;
730 void SetRefMapMode( const MapMode
& );
731 MapMode
GetRefMapMode() const;
733 void SetBackgroundColor( const Color
& rColor
);
734 Color
GetBackgroundColor() const;
736 sal_Int16
GetMinDepth() const { return -1; }
738 void SetMaxDepth( sal_Int16 nDepth
, sal_Bool bCheckParas
= sal_False
);
739 sal_Int16
GetMaxDepth() const { return nMaxDepth
; }
741 void SetUpdateMode( sal_Bool bUpdate
);
742 sal_Bool
GetUpdateMode() const;
746 void RemoveAttribs( const ESelection
& rSelection
, sal_Bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
748 sal_Int32
GetParagraphCount() const;
749 Paragraph
* GetParagraph( sal_Int32 nAbsPos
) const;
751 sal_Bool
HasParent( Paragraph
* pParagraph
) const;
752 sal_Bool
HasChildren( Paragraph
* pParagraph
) const;
753 sal_Int32
GetChildCount( Paragraph
* pParent
) const;
754 sal_Bool
IsExpanded( Paragraph
* pPara
) const;
755 Paragraph
* GetParent( Paragraph
* pParagraph
) const;
756 sal_Int32
GetAbsPos( Paragraph
* pPara
);
758 sal_Int16
GetDepth( sal_Int32 nPara
) const;
759 void SetDepth( Paragraph
* pParagraph
, sal_Int16 nNewDepth
);
761 sal_Bool
IsVisible( Paragraph
* pPara
) const { return pPara
->IsVisible(); }
763 void EnableUndo( sal_Bool bEnable
);
764 sal_Bool
IsUndoEnabled() const;
765 void UndoActionStart( sal_uInt16 nId
);
766 void UndoActionEnd( sal_uInt16 nId
);
767 void InsertUndo( EditUndo
* pUndo
);
770 void ClearModifyFlag();
771 sal_Bool
IsModified() const;
773 Paragraph
* GetHdlParagraph() const { return pHdlParagraph
; }
774 sal_Bool
IsExpanding() const { return bIsExpanding
; }
776 virtual void ExpandHdl();
777 void SetExpandHdl( const Link
& rLink
) { aExpandHdl
= rLink
; }
778 Link
GetExpandHdl() const { return aExpandHdl
; }
780 virtual void ParagraphInsertedHdl();
781 void SetParaInsertedHdl(const Link
& rLink
){aParaInsertedHdl
=rLink
;}
782 Link
GetParaInsertedHdl() const { return aParaInsertedHdl
; }
784 virtual void ParagraphRemovingHdl();
785 void SetParaRemovingHdl(const Link
& rLink
){aParaRemovingHdl
=rLink
;}
786 Link
GetParaRemovingHdl() const { return aParaRemovingHdl
; }
788 virtual void DepthChangedHdl();
789 void SetDepthChangedHdl(const Link
& rLink
){aDepthChangedHdl
=rLink
;}
790 Link
GetDepthChangedHdl() const { return aDepthChangedHdl
; }
791 sal_Int16
GetPrevDepth() const { return static_cast<sal_Int16
>(nDepthChangedHdlPrevDepth
); }
792 sal_uInt16
GetPrevFlags() const { return mnDepthChangeHdlPrevFlags
; }
794 virtual long RemovingPagesHdl( OutlinerView
* );
795 void SetRemovingPagesHdl(const Link
& rLink
){aRemovingPagesHdl
=rLink
;}
796 Link
GetRemovingPagesHdl() const { return aRemovingPagesHdl
; }
797 virtual long IndentingPagesHdl( OutlinerView
* );
798 void SetIndentingPagesHdl(const Link
& rLink
){aIndentingPagesHdl
=rLink
;}
799 Link
GetIndentingPagesHdl() const { return aIndentingPagesHdl
; }
800 // valid only in the two upper handlers
801 sal_Int32
GetSelPageCount() const { return nDepthChangedHdlPrevDepth
; }
803 // valid only in the two upper handlers
804 sal_Int32
GetFirstSelPage() const { return mnFirstSelPage
; }
806 void SetCalcFieldValueHdl(const Link
& rLink
) { aCalcFieldValueHdl
= rLink
; }
807 Link
GetCalcFieldValueHdl() const { return aCalcFieldValueHdl
; }
809 void SetFieldClickedHdl(const Link
& rLink
) { aFieldClickedHdl
= rLink
; }
810 Link
GetFieldClickedHdl() const { return aFieldClickedHdl
; }
812 void SetDrawPortionHdl(const Link
& rLink
){aDrawPortionHdl
=rLink
;}
813 Link
GetDrawPortionHdl() const { return aDrawPortionHdl
; }
815 void SetDrawBulletHdl(const Link
& rLink
){aDrawBulletHdl
=rLink
;}
816 Link
GetDrawBulletHdl() const { return aDrawBulletHdl
; }
818 void SetPaintFirstLineHdl(const Link
& rLink
) { maPaintFirstLineHdl
= rLink
; }
819 Link
GetPaintFirstLineHdl() const { return maPaintFirstLineHdl
; }
821 void SetModifyHdl( const Link
& rLink
);
822 Link
GetModifyHdl() const;
824 void SetNotifyHdl( const Link
& rLink
);
826 void SetStatusEventHdl( const Link
& rLink
);
827 Link
GetStatusEventHdl() const;
829 void Draw( OutputDevice
* pOutDev
, const Rectangle
& rOutRect
);
830 void Draw( OutputDevice
* pOutDev
, const Point
& rStartPos
, short nOrientation
= 0 );
832 const Size
& GetPaperSize() const;
833 void SetPaperSize( const Size
& rSize
);
835 void SetFirstPageNumber( sal_Int32 n
) { nFirstPage
= n
; }
836 sal_Int32
GetFirstPageNumber() const { return nFirstPage
; }
838 void SetPolygon( const basegfx::B2DPolyPolygon
& rPolyPolygon
);
839 void SetPolygon( const basegfx::B2DPolyPolygon
& rPolyPolygon
, const basegfx::B2DPolyPolygon
* pLinePolyPolygon
);
842 const Size
& GetMinAutoPaperSize() const;
843 void SetMinAutoPaperSize( const Size
& rSz
);
845 const Size
& GetMaxAutoPaperSize() const;
846 void SetMaxAutoPaperSize( const Size
& rSz
);
848 void SetDefTab( sal_uInt16 nTab
);
850 sal_Bool
IsFlatMode() const;
851 void SetFlatMode( sal_Bool bFlat
);
853 void EnableAutoColor( sal_Bool b
);
855 void ForceAutoColor( sal_Bool b
);
856 sal_Bool
IsForceAutoColor() const;
858 EBulletInfo
GetBulletInfo( sal_Int32 nPara
);
860 void SetWordDelimiters( const String
& rDelimiters
);
861 String
GetWordDelimiters() const;
862 String
GetWord( sal_Int32 nPara
, xub_StrLen nIndex
);
864 void StripPortions();
866 virtual void DrawingText(
867 const Point
& rStartPos
, const String
& rText
, sal_uInt16 nTextStart
, sal_uInt16 nTextLen
,
868 const sal_Int32
* pDXArray
, const SvxFont
& rFont
, sal_Int32 nPara
, xub_StrLen nIndex
, sal_uInt8 nRightToLeft
,
869 const EEngineData::WrongSpellVector
* pWrongSpellVector
,
870 const SvxFieldData
* pFieldData
,
872 bool bEndOfParagraph
,
874 const ::com::sun::star::lang::Locale
* pLocale
,
875 const Color
& rOverlineColor
,
876 const Color
& rTextLineColor
);
878 virtual void DrawingTab(
879 const Point
& rStartPos
, long nWidth
, const String
& rChar
,
880 const SvxFont
& rFont
, sal_Int32 nPara
, xub_StrLen nIndex
, sal_uInt8 nRightToLeft
,
882 bool bEndOfParagraph
,
883 const Color
& rOverlineColor
,
884 const Color
& rTextLineColor
);
887 Size
CalcTextSizeNTP();
889 void SetStyleSheetPool( SfxStyleSheetPool
* pSPool
);
890 SfxStyleSheetPool
* GetStyleSheetPool();
892 sal_Bool
IsInSelectionMode() const;
894 void SetStyleSheet( sal_Int32 nPara
, SfxStyleSheet
* pStyle
);
895 SfxStyleSheet
* GetStyleSheet( sal_Int32 nPara
);
897 void SetParaAttribs( sal_Int32 nPara
, const SfxItemSet
& );
898 SfxItemSet
GetParaAttribs( sal_Int32 nPara
);
900 void Remove( Paragraph
* pPara
, sal_Int32 nParaCount
);
901 sal_Bool
Expand( Paragraph
* );
902 sal_Bool
Collapse( Paragraph
* );
904 void SetParaFlag( Paragraph
* pPara
, sal_uInt16 nFlag
);
905 bool HasParaFlag( const Paragraph
* pPara
, sal_uInt16 nFlag
) const;
907 // Returns an array containing the widths of the Bullet Indentations
908 // Last value must be -1. Is deleted by the outliner.
909 Link
GetWidthArrReqHdl() const{ return aWidthArrReqHdl
; }
910 void SetWidthArrReqHdl(const Link
& rLink
){aWidthArrReqHdl
=rLink
; }
912 void SetControlWord( sal_uLong nWord
);
913 sal_uLong
GetControlWord() const;
915 Link
GetBeginMovingHdl() const { return aBeginMovingHdl
; }
916 void SetBeginMovingHdl(const Link
& rLink
) {aBeginMovingHdl
=rLink
;}
917 Link
GetEndMovingHdl() const {return aEndMovingHdl
;}
918 void SetEndMovingHdl( const Link
& rLink
){aEndMovingHdl
=rLink
;}
920 sal_uLong
GetLineCount( sal_Int32 nParagraph
) const;
921 sal_uInt16
GetLineLen( sal_Int32 nParagraph
, sal_uInt16 nLine
) const;
922 sal_uLong
GetLineHeight( sal_Int32 nParagraph
, sal_uInt16 nLine
= 0 );
924 sal_uLong
Read( SvStream
& rInput
, const String
& rBaseURL
, sal_uInt16
, SvKeyValueIterator
* pHTTPHeaderAttrs
= NULL
);
929 void QuickSetAttribs( const SfxItemSet
& rSet
, const ESelection
& rSel
);
930 void QuickInsertField( const SvxFieldItem
& rFld
, const ESelection
& rSel
);
931 void QuickInsertLineBreak( const ESelection
& rSel
);
933 // Only for EditEngine mode
934 void QuickInsertText( const String
& rText
, const ESelection
& rSel
);
935 void QuickDelete( const ESelection
& rSel
);
936 void QuickRemoveCharAttribs( sal_Int32 nPara
, sal_uInt16 nWhich
= 0 );
937 void QuickFormatDoc( sal_Bool bFull
= sal_False
);
939 sal_Bool
UpdateFields();
940 void RemoveFields( sal_Bool bKeepFieldText
, TypeId aType
= NULL
);
942 virtual void FieldClicked( const SvxFieldItem
& rField
, sal_Int32 nPara
, xub_StrLen nPos
);
943 virtual void FieldSelected( const SvxFieldItem
& rField
, sal_Int32 nPara
, xub_StrLen nPos
);
944 virtual OUString
CalcFieldValue( const SvxFieldItem
& rField
, sal_Int32 nPara
, xub_StrLen nPos
, Color
*& rTxtColor
, Color
*& rFldColor
);
946 void SetSpeller( ::com::sun::star::uno::Reference
<
947 ::com::sun::star::linguistic2::XSpellChecker1
> &xSpeller
);
948 ::com::sun::star::uno::Reference
<
949 ::com::sun::star::linguistic2::XSpellChecker1
>
951 void SetHyphenator( ::com::sun::star::uno::Reference
<
952 ::com::sun::star::linguistic2::XHyphenator
>& xHyph
);
954 void SetForbiddenCharsTable( rtl::Reference
<SvxForbiddenCharactersTable
> xForbiddenChars
);
957 void SetDefaultLanguage( LanguageType eLang
);
958 LanguageType
GetDefaultLanguage() const;
960 void CompleteOnlineSpelling();
962 EESpellState
HasSpellErrors();
963 sal_Bool
HasText( const SvxSearchItem
& rSearchItem
);
964 virtual sal_Bool
SpellNextDocument();
966 // for text conversion
967 sal_Bool
HasConvertibleTextPortion( LanguageType nLang
);
968 virtual sal_Bool
ConvertNextDocument();
970 void SetEditTextObjectPool( SfxItemPool
* pPool
);
971 SfxItemPool
* GetEditTextObjectPool() const;
973 void SetRefDevice( OutputDevice
* pRefDev
);
974 OutputDevice
* GetRefDevice() const;
976 sal_uLong
GetTextHeight() const;
977 sal_uLong
GetTextHeight( sal_Int32 nParagraph
) const;
978 Point
GetDocPosTopLeft( sal_Int32 nParagraph
);
979 Point
GetDocPos( const Point
& rPaperPos
) const;
980 sal_Bool
IsTextPos( const Point
& rPaperPos
, sal_uInt16 nBorder
= 0 );
981 sal_Bool
IsTextPos( const Point
& rPaperPos
, sal_uInt16 nBorder
, sal_Bool
* pbBuuletPos
);
983 void SetGlobalCharStretching( sal_uInt16 nX
= 100, sal_uInt16 nY
= 100 );
984 void GetGlobalCharStretching( sal_uInt16
& rX
, sal_uInt16
& rY
) const;
985 void EraseVirtualDevice();
987 sal_Bool
ShouldCreateBigTextObject() const;
989 const EditEngine
& GetEditEngine() const { return *((EditEngine
*)pEditEngine
); }
991 // this is needed for StarOffice Api
992 void SetLevelDependendStyleSheet( sal_Int32 nPara
);
994 sal_uInt16
GetOutlinerMode() const { return nOutlinerMode
& OUTLINERMODE_USERMASK
; }
996 void StartSpelling(EditView
& rEditView
, sal_Bool bMultipleDoc
);
997 // spell and return a sentence
998 bool SpellSentence(EditView
& rEditView
, ::svx::SpellPortions
& rToFill
, bool bIsGrammarChecking
);
999 // put spell position to start of current sentence
1000 void PutSpellingToSentenceStart( EditView
& rEditView
);
1001 // applies a changed sentence
1002 void ApplyChangedSentence(EditView
& rEditView
, const ::svx::SpellPortions
& rNewPortions
, bool bRecheck
);
1004 /** sets a link that is called at the beginning of a drag operation at an edit view */
1005 void SetBeginDropHdl( const Link
& rLink
);
1007 /** sets a link that is called at the end of a drag operation at an edit view */
1008 void SetEndDropHdl( const Link
& rLink
);
1010 /** sets a link that is called before a drop or paste operation. */
1011 void SetBeginPasteOrDropHdl( const Link
& rLink
);
1012 Link
GetBeginPasteOrDropHdl() const { return maBeginPasteOrDropHdl
; }
1014 /** sets a link that is called after a drop or paste operation. */
1015 void SetEndPasteOrDropHdl( const Link
& rLink
);
1016 Link
GetEndPasteOrDropHdl() const { return maEndPasteOrDropHdl
; }
1018 virtual sal_Int16
GetNumberingStartValue( sal_Int32 nPara
);
1019 virtual void SetNumberingStartValue( sal_Int32 nPara
, sal_Int16 nNumberingStartValue
);
1021 virtual sal_Bool
IsParaIsNumberingRestart( sal_Int32 nPara
);
1022 virtual void SetParaIsNumberingRestart( sal_Int32 nPara
, sal_Bool bParaIsNumberingRestart
);
1024 /** determine the bullets/numbering status of the given paragraphs
1027 index of paragraph at which the check starts
1030 index of paragraph at which the check ends
1033 0 : all paragraphs have bullets
1034 1 : all paragraphs have numbering
1037 sal_Int32
GetBulletsNumberingStatus(
1038 const sal_Int32 nParaStart
,
1039 const sal_Int32 nParaEnd
) const;
1041 // convenient method to determine the bullets/numbering status for all paragraphs
1042 sal_Int32
GetBulletsNumberingStatus() const;
1047 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */