LibreOffice Module sw (master) 1
Public Member Functions | Protected Member Functions | List of all members
IDocumentContentOperations Class Referenceabstract

Text operation/manipulation interface. More...

#include <IDocumentContentOperations.hxx>

Inheritance diagram for IDocumentContentOperations:
[legend]

Public Member Functions

virtual bool CopyRange (SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
 Copy a selected content range to a position. More...
 
virtual void DeleteSection (SwNode *pNode)=0
 Delete section containing the node. More...
 
virtual void DeleteRange (SwPaM &)=0
 Delete a range SwFlyFrameFormat. More...
 
virtual bool DelFullPara (SwPaM &)=0
 Delete full paragraphs. More...
 
virtual bool DeleteAndJoin (SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
 complete delete of a given PaM More...
 
virtual bool MoveRange (SwPaM &, SwPosition &, SwMoveFlags)=0
 
virtual bool MoveNodeRange (SwNodeRange &, SwNode &, SwMoveFlags)=0
 
virtual void MoveAndJoin (SwPaM &, SwPosition &)=0
 Move a range. More...
 
virtual bool Overwrite (const SwPaM &rRg, const OUString &rStr)=0
 Overwrite string in an existing text node. More...
 
virtual bool InsertString (const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
 Insert string into existing text node at position rRg.Point(). More...
 
virtual void SetIME (bool bIME)=0
 States that the last inserted string came from IME. More...
 
virtual bool GetIME () const =0
 Did the last inserted string come from IME? More...
 
virtual void TransliterateText (const SwPaM &rPaM, utl::TransliterationWrapper &)=0
 change text to Upper/Lower/Hiragana/Katakana/... More...
 
virtual SwFlyFrameFormatInsertGraphic (const SwPaM &rRg, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet, SwFrameFormat *)=0
 Insert graphic or formula. More...
 
virtual void ReRead (SwPaM &, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic)=0
 Transpose graphic (with undo) More...
 
virtual SwDrawFrameFormatInsertDrawObj (const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
 Insert a DrawObject. More...
 
virtual SwFlyFrameFormatInsertEmbObject (const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, SfxItemSet *pFlyAttrSet)=0
 Insert OLE-objects. More...
 
virtual SwFlyFrameFormatInsertOLE (const SwPaM &rRg, const OUString &rObjName, sal_Int64 nAspect, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet)=0
 
virtual bool SplitNode (const SwPosition &rPos, bool bChkTableStart)=0
 Split a node at rPos (implemented only for TextNode). More...
 
virtual bool AppendTextNode (SwPosition &rPos)=0
 
virtual bool ReplaceRange (SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace)=0
 Replace selected range in a TextNode with string. More...
 
virtual bool InsertPoolItem (const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
 Insert an attribute. More...
 
virtual void InsertItemSet (const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
 
virtual void RemoveLeadingWhiteSpace (const SwPosition &rPos)=0
 Removes any leading white space from the paragraph. More...
 
virtual void RemoveLeadingWhiteSpace (SwPaM &rPaM)=0
 

Protected Member Functions

virtual ~IDocumentContentOperations ()
 

Detailed Description

Text operation/manipulation interface.

Definition at line 96 of file IDocumentContentOperations.hxx.

Constructor & Destructor Documentation

◆ ~IDocumentContentOperations()

virtual IDocumentContentOperations::~IDocumentContentOperations ( )
inlineprotectedvirtual

Definition at line 250 of file IDocumentContentOperations.hxx.

Member Function Documentation

◆ AppendTextNode()

virtual bool IDocumentContentOperations::AppendTextNode ( SwPosition rPos)
pure virtual

◆ CopyRange()

virtual bool IDocumentContentOperations::CopyRange ( SwPaM rPam,
SwPosition rPos,
SwCopyFlags  flags 
) const
pure virtual

Copy a selected content range to a position.

The position can be in the same or in an another document. It can also be within the range!

Warning
The range has to include at least two nodes or has to be a SwDoc::IsColumnSelection, because the rPam is treated [mark, point[.

Normally this function should work only with content nodes. But there is a special case used by SwDoc::Paste, which starts the SwPaM at the content start node. This position doesn't contain any content:

SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 1 );
Marks a node in the document model.
Definition: ndindex.hxx:31

This is important, because it prevents merging of the first node of the range into the node pointed to by rPos. As a result this keeps all properties of the first real content node, which is the 2nd, including the Flys and the page description. In this case the first (fake) node is silently dropped and all other nodes are just copied.

Parameters
rPamThe source node range to copy
rPosThe target copy destination
flagsSwCopyFlags::CheckPos: If this function should check if rPos is in a fly frame anchored in rPam. If false, then no such check will be performed, and it is assumed that the caller took care of verifying this constraint already.

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwDoc::AppendDoc(), SwAutoCorrDoc::ChgAutoCorrWord(), SwEditShell::CopySelToDoc(), SwRangeRedline::CopyToSection(), SwDoc::InsertGlossary(), lcl_CopySelToDoc(), SwDOCXReader::MakeEntries(), WW8Glossary::MakeEntries(), SwDoc::MakeFlyAndMove(), SwDoc::MoveParagraphImpl(), SwFEShell::Paste(), SwTransferable::PrepareForCopyTextRange(), SwUndoInserts::RepeatImpl(), and SwEditShell::SaveGlossaryDoc().

◆ DeleteAndJoin()

virtual bool IDocumentContentOperations::DeleteAndJoin ( SwPaM ,
SwDeleteFlags  flags = SwDeleteFlags::Default 
)
pure virtual

◆ DeleteRange()

virtual void IDocumentContentOperations::DeleteRange ( SwPaM )
pure virtual

◆ DeleteSection()

virtual void IDocumentContentOperations::DeleteSection ( SwNode pNode)
pure virtual

◆ DelFullPara()

virtual bool IDocumentContentOperations::DelFullPara ( SwPaM )
pure virtual

◆ GetIME()

virtual bool IDocumentContentOperations::GetIME ( ) const
pure virtual

Did the last inserted string come from IME?

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwExtTextInput::~SwExtTextInput().

◆ InsertDrawObj()

virtual SwDrawFrameFormat * IDocumentContentOperations::InsertDrawObj ( const SwPaM rRg,
SdrObject rDrawObj,
const SfxItemSet rFlyAttrSet 
)
pure virtual

◆ InsertEmbObject()

virtual SwFlyFrameFormat * IDocumentContentOperations::InsertEmbObject ( const SwPaM rRg,
const svt::EmbeddedObjectRef xObj,
SfxItemSet pFlyAttrSet 
)
pure virtual

◆ InsertGraphic()

virtual SwFlyFrameFormat * IDocumentContentOperations::InsertGraphic ( const SwPaM rRg,
const OUString &  rGrfName,
const OUString &  rFltName,
const Graphic pGraphic,
const SfxItemSet pFlyAttrSet,
const SfxItemSet pGrfAttrSet,
SwFrameFormat  
)
pure virtual

◆ InsertItemSet()

virtual void IDocumentContentOperations::InsertItemSet ( const SwPaM rRg,
const SfxItemSet ,
const SetAttrMode  nFlags = SetAttrMode::DEFAULT,
SwRootFrame const *  pLayout = nullptr 
)
pure virtual

◆ InsertOLE()

virtual SwFlyFrameFormat * IDocumentContentOperations::InsertOLE ( const SwPaM rRg,
const OUString &  rObjName,
sal_Int64  nAspect,
const SfxItemSet pFlyAttrSet,
const SfxItemSet pGrfAttrSet 
)
pure virtual

◆ InsertPoolItem()

virtual bool IDocumentContentOperations::InsertPoolItem ( const SwPaM rRg,
const SfxPoolItem ,
const SetAttrMode  nFlags = SetAttrMode::DEFAULT,
SwRootFrame const *  pLayout = nullptr,
SwTextAttr **  ppNewTextAttr = nullptr 
)
pure virtual

Insert an attribute.

If rRg spans several nodes the attribute is split, provided it makes sense. Nodes, where this attribute does not make sense are ignored. In nodes completely enclosed in the selection the attribute becomes hard-formatted, in all other (text-) nodes the attribute is inserted into the attribute array. For a character attribute, in cases where no selection exists an "empty" hint is inserted. If there is a selection the attribute is hard-formatted and added to the node at rRg.Start(). If the attribute could not be inserted, the method returns false.

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwDoc::AppendDoc(), SwXTextField::attach(), SwXFootnote::attach(), SwXLineBreak::attach(), SwXMeta::AttachImpl(), SwXContentControl::AttachImpl(), SwFEShell::ChgCurPageDesc(), SwWW8ImplReader::End_Field(), GiveNodePageDesc(), SwEditShell::Insert(), SwEditShell::InsertField(), SwXReferenceMark::Impl::InsertRefMark(), wwSectionManager::InsertSegments(), SwWW8ImplReader::InsertTagField(), SwXDocumentIndexMark::Impl::InsertTOXMark(), lcl_FormatPostIt(), lcl_ImportTox(), lcl_SetAPageOffset(), HTMLReader::Read(), SwWW8ImplReader::Read_And(), SwWW8ImplReader::Read_F_ANumber(), SwWW8ImplReader::Read_F_Author(), SwWW8ImplReader::Read_F_CurPage(), SwWW8ImplReader::Read_F_DateTime(), SwWW8ImplReader::Read_F_DBField(), SwWW8ImplReader::Read_F_DBNext(), SwWW8ImplReader::Read_F_DBNum(), SwWW8ImplReader::Read_F_DocInfo(), SwWW8ImplReader::Read_F_Equation(), SwWW8ImplReader::Read_F_FileName(), SwWW8ImplReader::Read_F_FormListBox(), SwWW8ImplReader::Read_F_FormTextBox(), SwWW8ImplReader::Read_F_Input(), SwWW8ImplReader::Read_F_InputVar(), SwWW8ImplReader::Read_F_Macro(), SwWW8ImplReader::Read_F_Num(), SwWW8ImplReader::Read_F_PgRef(), SwWW8ImplReader::Read_F_Ref(), SwWW8ImplReader::Read_F_Seq(), SwWW8ImplReader::Read_F_Set(), SwWW8ImplReader::Read_F_Styleref(), SwWW8ImplReader::Read_F_TemplName(), SwWW8ImplReader::ReadChar(), SwWW8ImplReader::ReadText(), SwRedlineExtraData_Format::Reject(), SwFltControlStack::SetAttrInDoc(), SwWW8FltControlStack::SetAttrInDoc(), SwWW8FltRefStack::SetAttrInDoc(), SwEditShell::SetAttrItem(), SwDoc::SetCounted(), SwDoc::SetNumRule(), SwDoc::SetRubyList(), SwCursorShell::SetShadowCursorPos(), SwXTextField::TransmuteLeadToInputField(), and SwExtTextInput::~SwExtTextInput().

◆ InsertString()

virtual bool IDocumentContentOperations::InsertString ( const SwPaM rRg,
const OUString &  ,
const SwInsertFlags  nInsertMode = SwInsertFlags::EMPTYEXPAND 
)
pure virtual

◆ MoveAndJoin()

virtual void IDocumentContentOperations::MoveAndJoin ( SwPaM ,
SwPosition  
)
pure virtual

Move a range.

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwRangeRedline::MoveToSection().

◆ MoveNodeRange()

virtual bool IDocumentContentOperations::MoveNodeRange ( SwNodeRange ,
SwNode ,
SwMoveFlags   
)
pure virtual

◆ MoveRange()

virtual bool IDocumentContentOperations::MoveRange ( SwPaM ,
SwPosition ,
SwMoveFlags   
)
pure virtual

◆ Overwrite()

virtual bool IDocumentContentOperations::Overwrite ( const SwPaM rRg,
const OUString &  rStr 
)
pure virtual

Overwrite string in an existing text node.

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwUndoOverwrite::RepeatImpl(), and SwExtTextInput::~SwExtTextInput().

◆ RemoveLeadingWhiteSpace() [1/2]

virtual void IDocumentContentOperations::RemoveLeadingWhiteSpace ( const SwPosition rPos)
pure virtual

Removes any leading white space from the paragraph.

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwWrtShell::NumOrBulletOn().

◆ RemoveLeadingWhiteSpace() [2/2]

virtual void IDocumentContentOperations::RemoveLeadingWhiteSpace ( SwPaM rPaM)
pure virtual

◆ ReplaceRange()

virtual bool IDocumentContentOperations::ReplaceRange ( SwPaM rPam,
const OUString &  rNewStr,
const bool  bRegExReplace 
)
pure virtual

Replace selected range in a TextNode with string.

Intended for search & replace. bRegExpRplc - replace tabs (\t) and insert the found string ( not & ). E.g.: Find: "zzz", Replace: "xx\t\\t..&..\&" --> "xx\t<Tab>..zzz..&"

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwAutoFormat::AutoCorrect(), SwXFlatParagraph::changeText(), SwAutoCorrDoc::ChgAutoCorrWord(), SwAutoFormat::DelEmptyLine(), SwUndoReplace::Impl::RedoImpl(), sw::ReplaceImpl(), SwAutoCorrDoc::ReplaceRange(), SwDoc::SetRubyList(), SwAutoCorrDoc::TransliterateRTLWord(), SwTextNode::TransliterateText(), and SwUndoReplace::Impl::UndoImpl().

◆ ReRead()

virtual void IDocumentContentOperations::ReRead ( SwPaM ,
const OUString &  rGrfName,
const OUString &  rFltName,
const Graphic pGraphic 
)
pure virtual

Transpose graphic (with undo)

Implemented in sw::DocumentContentOperationsManager.

◆ SetIME()

virtual void IDocumentContentOperations::SetIME ( bool  bIME)
pure virtual

States that the last inserted string came from IME.

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwEditShell::Insert2(), and SwExtTextInput::~SwExtTextInput().

◆ SplitNode()

virtual bool IDocumentContentOperations::SplitNode ( const SwPosition rPos,
bool  bChkTableStart 
)
pure virtual

◆ TransliterateText()

virtual void IDocumentContentOperations::TransliterateText ( const SwPaM rPaM,
utl::TransliterationWrapper  
)
pure virtual

change text to Upper/Lower/Hiragana/Katakana/...

Implemented in sw::DocumentContentOperationsManager.

Referenced by SwUndoTransliterate::DoTransliterate(), and SwEditShell::TransliterateText().


The documentation for this class was generated from the following file: