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 .
20 #ifndef _SVX_UNOFOROU_HXX
21 #define _SVX_UNOFOROU_HXX
23 #include <editeng/unoedsrc.hxx>
24 #include "editeng/editengdllapi.h"
26 #include <editeng/editdata.hxx>
30 // SvxOutlinerForwarder - SvxTextForwarder for Outliner
32 class EDITENG_DLLPUBLIC SvxOutlinerForwarder
: public SvxTextForwarder
36 sal_Bool bOutlinerText
;
38 /** this pointer may be null or point to an item set for the attribs of
39 the selection maAttribsSelection */
40 mutable SfxItemSet
* mpAttribsCache
;
42 /** if we have a chached attribute item set, this is the selection of it */
43 mutable ESelection maAttribCacheSelection
;
45 /** this pointer may be null or point to an item set for the paragraph
47 mutable SfxItemSet
* mpParaAttribsCache
;
49 /** if we have a cached para attribute item set, this is the paragraph of it */
50 mutable sal_Int32 mnParaAttribsCache
;
53 SvxOutlinerForwarder( Outliner
& rOutl
, sal_Bool bOutlText
= sal_False
);
54 virtual ~SvxOutlinerForwarder();
56 virtual sal_Int32
GetParagraphCount() const;
57 virtual sal_uInt16
GetTextLen( sal_Int32 nParagraph
) const;
58 virtual String
GetText( const ESelection
& rSel
) const;
59 virtual SfxItemSet
GetAttribs( const ESelection
& rSel
, sal_Bool bOnlyHardAttrib
= 0 ) const;
60 virtual SfxItemSet
GetParaAttribs( sal_Int32 nPara
) const;
61 virtual void SetParaAttribs( sal_Int32 nPara
, const SfxItemSet
& rSet
);
62 virtual void RemoveAttribs( const ESelection
& rSelection
, sal_Bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
63 virtual void GetPortions( sal_Int32 nPara
, std::vector
<sal_uInt16
>& rList
) const;
65 virtual sal_uInt16
GetItemState( const ESelection
& rSel
, sal_uInt16 nWhich
) const;
66 virtual sal_uInt16
GetItemState( sal_Int32 nPara
, sal_uInt16 nWhich
) const;
68 virtual void QuickInsertText( const String
& rText
, const ESelection
& rSel
);
69 virtual void QuickInsertField( const SvxFieldItem
& rFld
, const ESelection
& rSel
);
70 virtual void QuickSetAttribs( const SfxItemSet
& rSet
, const ESelection
& rSel
);
71 virtual void QuickInsertLineBreak( const ESelection
& rSel
);
73 virtual SfxItemPool
* GetPool() const;
75 virtual OUString
CalcFieldValue( const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_uInt16 nPos
, Color
*& rpTxtColor
, Color
*& rpFldColor
);
76 virtual void FieldClicked( const SvxFieldItem
& rField
, sal_Int32 nPara
, xub_StrLen nPos
);
78 virtual sal_Bool
IsValid() const;
80 Outliner
& GetOutliner() const { return rOutliner
; }
82 virtual LanguageType
GetLanguage( sal_Int32
, sal_uInt16
) const;
83 virtual sal_uInt16
GetFieldCount( sal_Int32 nPara
) const;
84 virtual EFieldInfo
GetFieldInfo( sal_Int32 nPara
, sal_uInt16 nField
) const;
85 virtual EBulletInfo
GetBulletInfo( sal_Int32 nPara
) const;
86 virtual Rectangle
GetCharBounds( sal_Int32 nPara
, sal_uInt16 nIndex
) const;
87 virtual Rectangle
GetParaBounds( sal_Int32 nPara
) const;
88 virtual MapMode
GetMapMode() const;
89 virtual OutputDevice
* GetRefDevice() const;
90 virtual sal_Bool
GetIndexAtPoint( const Point
&, sal_Int32
& nPara
, sal_uInt16
& nIndex
) const;
91 virtual sal_Bool
GetWordIndices( sal_Int32 nPara
, sal_uInt16 nIndex
, sal_uInt16
& nStart
, sal_uInt16
& nEnd
) const;
92 virtual sal_Bool
GetAttributeRun( sal_uInt16
& nStartIndex
, sal_uInt16
& nEndIndex
, sal_Int32 nPara
, sal_uInt16 nIndex
) const;
93 virtual sal_uInt16
GetLineCount( sal_Int32 nPara
) const;
94 virtual sal_uInt16
GetLineLen( sal_Int32 nPara
, sal_uInt16 nLine
) const;
95 virtual void GetLineBoundaries( /*out*/sal_uInt16
&rStart
, /*out*/sal_uInt16
&rEnd
, sal_Int32 nPara
, sal_uInt16 nLine
) const;
96 virtual sal_uInt16
GetLineNumberAtIndex( sal_Int32 nPara
, sal_uInt16 nIndex
) const;
97 virtual sal_Bool
Delete( const ESelection
& );
98 virtual sal_Bool
InsertText( const String
&, const ESelection
& );
99 virtual sal_Bool
QuickFormatDoc( sal_Bool bFull
=sal_False
);
100 virtual sal_Int16
GetDepth( sal_Int32 nPara
) const;
101 virtual sal_Bool
SetDepth( sal_Int32 nPara
, sal_Int16 nNewDepth
);
102 virtual sal_Int16
GetNumberingStartValue( sal_Int32 nPara
);
103 virtual void SetNumberingStartValue( sal_Int32 nPara
, sal_Int16 nNumberingStartValue
);
105 virtual sal_Bool
IsParaIsNumberingRestart( sal_Int32 nPara
);
106 virtual void SetParaIsNumberingRestart( sal_Int32 nPara
, sal_Bool bParaIsNumberingRestart
);
108 /* this method flushes internal caches for this forwarder */
111 virtual const SfxItemSet
* GetEmptyItemSetPtr();
113 // implementation functions for XParagraphAppend and XTextPortionAppend
114 virtual void AppendParagraph();
115 virtual xub_StrLen
AppendTextPortion( sal_Int32 nPara
, const String
&rText
, const SfxItemSet
&rSet
);
117 virtual void CopyText(const SvxTextForwarder
& rSource
);
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */