1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED
29 #define IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED
32 #include <sal/types.h>
50 namespace utl
{ class TransliterationWrapper
; }
51 namespace svt
{ class EmbeddedObjectRef
; }
53 /** Text operation/manipulation interface
55 class IDocumentContentOperations
60 DOC_MOVEDEFAULT
= 0x00,
61 DOC_MOVEALLFLYS
= 0x01,
62 DOC_CREATEUNDOOBJ
= 0x02,
63 DOC_MOVEREDLINES
= 0x04,
67 // constants for inserting text
69 { INS_DEFAULT
= 0x00 // no extras
70 , INS_EMPTYEXPAND
= 0x01 // expand empty hints at insert position
71 , INS_NOHINTEXPAND
= 0x02 // do not expand any hints at insert pos
72 , INS_FORCEHINTEXPAND
= 0x04 // expand all hints at insert position
76 /** Kopieren eines Bereiches im oder in ein anderes Dokument !
77 Die Position kann auch im Bereich liegen !!
79 virtual bool CopyRange(SwPaM
&, SwPosition
&, const bool bCopyAll
) const = 0;
81 /** Loesche die Section, in der der Node steht.
83 virtual void DeleteSection(SwNode
* pNode
) = 0;
85 /** loeschen eines BereichesSwFlyFrmFmt
87 virtual bool DeleteRange(SwPaM
&) = 0;
89 /** loeschen gesamter Absaetze
91 virtual bool DelFullPara(SwPaM
&) = 0;
93 /** complete delete of a given PaM
95 OD 2009-08-20 #i100466#
96 Add optional parameter <bForceJoinNext>, default value <false>
97 Needed for hiding of deletion redlines
99 virtual bool DeleteAndJoin( SwPaM
&,
100 const bool bForceJoinNext
= false ) = 0;
102 /** verschieben eines Bereiches
104 virtual bool MoveRange(SwPaM
&, SwPosition
&, SwMoveFlags
) = 0;
106 /** verschieben ganzer Nodes
108 virtual bool MoveNodeRange(SwNodeRange
&, SwNodeIndex
&, SwMoveFlags
) = 0;
110 /** verschieben eines Bereiches
112 virtual bool MoveAndJoin(SwPaM
&, SwPosition
&, SwMoveFlags
) = 0;
114 /** Ueberschreiben eines Strings in einem bestehenden Textnode.
116 virtual bool Overwrite(const SwPaM
&rRg
, const String
& rStr
) = 0;
118 /** Insert string into existing text node at position rRg.Point().
120 virtual bool InsertString(const SwPaM
&rRg
, const String
&,
121 const enum InsertFlags nInsertMode
= INS_EMPTYEXPAND
) = 0;
123 /** change text to Upper/Lower/Hiragana/Katagana/...
125 virtual void TransliterateText(const SwPaM
& rPaM
, utl::TransliterationWrapper
&) = 0;
127 /** Einfuegen einer Grafik, Formel. Die XXXX werden kopiert.
129 virtual SwFlyFrmFmt
* Insert(const SwPaM
&rRg
, const String
& rGrfName
, const String
& rFltName
, const Graphic
* pGraphic
,
130 const SfxItemSet
* pFlyAttrSet
, const SfxItemSet
* pGrfAttrSet
, SwFrmFmt
*) = 0;
134 virtual SwFlyFrmFmt
* Insert(const SwPaM
& rRg
, const GraphicObject
& rGrfObj
, const SfxItemSet
* pFlyAttrSet
,
135 const SfxItemSet
* pGrfAttrSet
, SwFrmFmt
*) = 0;
137 /** austauschen einer Grafik (mit Undo)
139 virtual void ReRead(SwPaM
&, const String
& rGrfName
, const String
& rFltName
, const Graphic
* pGraphic
, const GraphicObject
* pGrfObj
) = 0;
141 /** Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel
144 virtual SwDrawFrmFmt
* Insert(const SwPaM
&rRg
, SdrObject
& rDrawObj
, const SfxItemSet
* pFlyAttrSet
, SwFrmFmt
*) = 0;
146 /** Einfuegen von OLE-Objecten.
148 virtual SwFlyFrmFmt
* Insert(const SwPaM
&rRg
, const svt::EmbeddedObjectRef
& xObj
, const SfxItemSet
* pFlyAttrSet
,
149 const SfxItemSet
* pGrfAttrSet
, SwFrmFmt
*) = 0;
151 virtual SwFlyFrmFmt
* InsertOLE(const SwPaM
&rRg
, const String
& rObjName
, sal_Int64 nAspect
, const SfxItemSet
* pFlyAttrSet
,
152 const SfxItemSet
* pGrfAttrSet
, SwFrmFmt
*) = 0;
154 /** Aufspalten eines Nodes an rPos (nur fuer den TxtNode implementiert)
156 virtual bool SplitNode(const SwPosition
&rPos
, bool bChkTableStart
) = 0;
160 virtual bool AppendTxtNode(SwPosition
& rPos
) = 0;
162 /** Ersetz einen selektierten Bereich in einem TextNode mit dem
163 String. Ist fuers Suchen&Ersetzen gedacht.
164 bRegExpRplc - ersetze Tabs (\\t) und setze den gefundenen String
166 z.B.: Fnd: "zzz", Repl: "xx\t\\t..&..\&"
167 --> "xx\t<Tab>..zzz..&"
169 virtual bool ReplaceRange(SwPaM
& rPam
, const String
& rNewStr
,
170 const bool bRegExReplace
) = 0;
172 /** Einfuegen eines Attributs. Erstreckt sich rRg ueber
173 mehrere Nodes, wird das Attribut aufgespaltet, sofern
174 dieses Sinn macht. Nodes, in denen dieses Attribut keinen
175 Sinn macht, werden ignoriert. In vollstaendig in der
176 Selektion eingeschlossenen Nodes wird das Attribut zu
177 harter Formatierung, in den anderen (Text-)Nodes wird das
178 Attribut in das Attributearray eingefuegt. Bei einem
179 Zeichenattribut wird ein "leerer" Hint eingefuegt,
181 vorliegt; andernfalls wird das Attribut als harte
182 Formatierung dem durch rRg.Start() bezeichneten Node
183 hinzugefuegt. Wenn das Attribut nicht eingefuegt werden
184 konnte, liefert die Methode sal_False.
186 virtual bool InsertPoolItem(const SwPaM
&rRg
, const SfxPoolItem
&,
187 const sal_uInt16 nFlags
) = 0;
191 virtual bool InsertItemSet (const SwPaM
&rRg
, const SfxItemSet
&,
192 const sal_uInt16 nFlags
) = 0;
194 /** Removes any leading white space from the paragraph
196 virtual void RemoveLeadingWhiteSpace(const SwPosition
& rPos
) = 0;
199 virtual ~IDocumentContentOperations() {};
202 #endif // IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED