KateUndo

Search for usage in LXR

#include <kateundo.h>

Inherited by KateEditInsertLineUndo, KateEditInsertTextUndo, KateEditMarkLineAutoWrappedUndo, KateEditRemoveLineUndo, KateEditRemoveTextUndo, KateEditUnWrapLineUndo, and KateEditWrapLineUndo.

Public Types

enum  ModificationFlag {
  UndoLine1Modified = 1, UndoLine2Modified = 2, UndoLine1Saved = 4, UndoLine2Saved = 8,
  RedoLine1Modified = 16, RedoLine2Modified = 32, RedoLine1Saved = 64, RedoLine2Saved = 128
}
 
enum  UndoType {
  editInsertText, editRemoveText, editWrapLine, editUnWrapLine,
  editInsertLine, editRemoveLine, editMarkLineAutoWrapped, editInvalid
}
 

Public Member Functions

 KateUndo (KTextEditor::DocumentPrivate *document)
 
virtual ~KateUndo ()=default
 
virtual bool isEmpty () const
 
bool isFlagSet (ModificationFlag flag) const
 
virtual bool mergeWith (const KateUndo *undo)
 
virtual void redo ()=0
 
void setFlag (ModificationFlag flag)
 
virtual KateUndo::UndoType type () const =0
 
virtual void undo ()=0
 
void unsetFlag (ModificationFlag flag)
 
virtual void updateRedoSavedOnDiskFlag (QBitArray &lines)
 
virtual void updateUndoSavedOnDiskFlag (QBitArray &lines)
 

Protected Member Functions

KTextEditor::DocumentPrivate * document ()
 

Detailed Description

Base class for Kate undo commands.

Definition at line 29 of file kateundo.h.

Member Enumeration Documentation

◆ UndoType

Types for undo items.

Definition at line 47 of file kateundo.h.

Constructor & Destructor Documentation

◆ KateUndo()

KateUndo::KateUndo ( KTextEditor::DocumentPrivate *  document)
explicit

Constructor.

Parameters
documentthe document the undo item belongs to

Definition at line 20 of file kateundo.cpp.

◆ ~KateUndo()

virtual KateUndo::~KateUndo ( )
virtualdefault

Destructor.

Member Function Documentation

◆ document()

KTextEditor::DocumentPrivate* KateUndo::document ( )
inlineprotected

Return the document the undo item belongs to.

Returns
the document the undo item belongs to

Definition at line 87 of file kateundo.h.

◆ isEmpty()

bool KateUndo::isEmpty ( ) const
virtual

Check whether the item is empty.

Returns
whether the item is empty

Definition at line 73 of file kateundo.cpp.

◆ mergeWith()

bool KateUndo::mergeWith ( const KateUndo undo)
virtual

merge an undo item Saves a bit of memory and potentially many calls when undo/redoing.

Only called for equal types of this object and the passed one.

Parameters
undoundo item to merge
Returns
success

Definition at line 88 of file kateundo.cpp.

◆ redo()

virtual void KateUndo::redo ( )
pure virtual

redo this item

◆ type()

virtual KateUndo::UndoType KateUndo::type ( ) const
pure virtual

type of item

Returns
type

◆ undo()

virtual void KateUndo::undo ( )
pure virtual

undo this item


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 03:49:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.