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_UNOFORED_HXX
21 #define _SVX_UNOFORED_HXX
23 #include <editeng/editeng.hxx>
24 #include <editeng/unoedsrc.hxx>
25 #include "editeng/editengdllapi.h"
27 // SvxEditEngineForwarder - SvxTextForwarder for EditEngine
29 class EDITENG_DLLPUBLIC SvxEditEngineForwarder
: public SvxTextForwarder
32 EditEngine
& rEditEngine
;
35 SvxEditEngineForwarder( EditEngine
& rEngine
);
36 virtual ~SvxEditEngineForwarder();
38 virtual sal_Int32
GetParagraphCount() const;
39 virtual sal_uInt16
GetTextLen( sal_Int32 nParagraph
) const;
40 virtual String
GetText( const ESelection
& rSel
) const;
41 virtual SfxItemSet
GetAttribs( const ESelection
& rSel
, sal_Bool bOnlyHardAttrib
= EditEngineAttribs_All
) const;
42 virtual SfxItemSet
GetParaAttribs( sal_Int32 nPara
) const;
43 virtual void SetParaAttribs( sal_Int32 nPara
, const SfxItemSet
& rSet
);
44 virtual void RemoveAttribs( const ESelection
& rSelection
, sal_Bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
45 virtual void GetPortions( sal_Int32 nPara
, std::vector
<sal_uInt16
>& rList
) const;
47 virtual sal_uInt16
GetItemState( const ESelection
& rSel
, sal_uInt16 nWhich
) const;
48 virtual sal_uInt16
GetItemState( sal_Int32 nPara
, sal_uInt16 nWhich
) const;
50 virtual void QuickInsertText( const String
& rText
, const ESelection
& rSel
);
51 virtual void QuickInsertField( const SvxFieldItem
& rFld
, const ESelection
& rSel
);
52 virtual void QuickSetAttribs( const SfxItemSet
& rSet
, const ESelection
& rSel
);
53 virtual void QuickInsertLineBreak( const ESelection
& rSel
);
55 virtual SfxItemPool
* GetPool() const;
57 virtual OUString
CalcFieldValue( const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_uInt16 nPos
, Color
*& rpTxtColor
, Color
*& rpFldColor
);
58 virtual void FieldClicked( const SvxFieldItem
& rField
, sal_Int32 nPara
, xub_StrLen nPos
);
59 virtual sal_Bool
IsValid() const;
61 virtual LanguageType
GetLanguage( sal_Int32
, sal_uInt16
) const;
62 virtual sal_uInt16
GetFieldCount( sal_Int32 nPara
) const;
63 virtual EFieldInfo
GetFieldInfo( sal_Int32 nPara
, sal_uInt16 nField
) const;
64 virtual EBulletInfo
GetBulletInfo( sal_Int32 nPara
) const;
65 virtual Rectangle
GetCharBounds( sal_Int32 nPara
, sal_uInt16 nIndex
) const;
66 virtual Rectangle
GetParaBounds( sal_Int32 nPara
) const;
67 virtual MapMode
GetMapMode() const;
68 virtual OutputDevice
* GetRefDevice() const;
69 virtual sal_Bool
GetIndexAtPoint( const Point
&, sal_Int32
& nPara
, sal_uInt16
& nIndex
) const;
70 virtual sal_Bool
GetWordIndices( sal_Int32 nPara
, sal_uInt16 nIndex
, sal_uInt16
& nStart
, sal_uInt16
& nEnd
) const;
71 virtual sal_Bool
GetAttributeRun( sal_uInt16
& nStartIndex
, sal_uInt16
& nEndIndex
, sal_Int32 nPara
, sal_uInt16 nIndex
) const;
72 virtual sal_uInt16
GetLineCount( sal_Int32 nPara
) const;
73 virtual sal_uInt16
GetLineLen( sal_Int32 nPara
, sal_uInt16 nLine
) const;
74 virtual void GetLineBoundaries( /*out*/sal_uInt16
&rStart
, /*out*/sal_uInt16
&rEnd
, sal_Int32 nParagraph
, sal_uInt16 nLine
) const;
75 virtual sal_uInt16
GetLineNumberAtIndex( sal_Int32 nPara
, sal_uInt16 nIndex
) const;
76 virtual sal_Bool
Delete( const ESelection
& );
77 virtual sal_Bool
InsertText( const String
&, const ESelection
& );
78 virtual sal_Bool
QuickFormatDoc( sal_Bool bFull
=sal_False
);
79 virtual sal_Int16
GetDepth( sal_Int32 nPara
) const;
80 virtual sal_Bool
SetDepth( sal_Int32 nPara
, sal_Int16 nNewDepth
);
82 virtual const SfxItemSet
* GetEmptyItemSetPtr();
84 // implementation functions for XParagraphAppend and XTextPortionAppend
85 virtual void AppendParagraph();
86 virtual xub_StrLen
AppendTextPortion( sal_Int32 nPara
, const String
&rText
, const SfxItemSet
&rSet
);
88 virtual void CopyText(const SvxTextForwarder
& rSource
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */