kateundo.h
/* This file is part of the KDE libraries
Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef kate_undo_h
#define kate_undo_h
#include <qptrlist.h>
#include <qstring.h>
class KateDocument;
class KateUndo;
class KateUndoGroup
{
public:
KateUndoGroup (KateDocument *doc);
~KateUndoGroup ();
public:
void undo ();
void redo ();
public:
enum UndoType
{
editInsertText,
editRemoveText,
editWrapLine,
editUnWrapLine,
editInsertLine,
editRemoveLine,
editMarkLineAutoWrapped,
editInvalid
};
void addItem (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text);
bool merge(KateUndoGroup* newGroup,bool complex);
void safePoint (bool safePoint=true);
bool isEmpty () const { return m_items.isEmpty(); }
private:
KateUndoGroup::UndoType singleType();
bool isOnlyType(KateUndoGroup::UndoType type);
void addItem (KateUndo *u);
private:
KateDocument *m_doc;
QPtrList<KateUndo> m_items;
bool m_safePoint;
};
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
KateUndoGroup::undo
void undo()
Undo the contained undo items.
Definition: kateundo.cpp:286
KateUndoGroup::merge
bool merge(KateUndoGroup *newGroup, bool complex)
merge this group with an other
Definition: kateundo.cpp:347
KateUndoGroup::isEmpty
bool isEmpty() const
is this undogroup empty?
Definition: kateundo.h:100
KateUndoGroup
Class to manage a group of undo items.
Definition: kateundo.h:33
KateUndoGroup::addItem
void addItem(KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text)
add an item to the group
Definition: kateundo.cpp:332
KateUndoGroup::UndoType
UndoType
Types for undo items.
Definition: kateundo.h:62
KateUndoGroup::KateUndoGroup
KateUndoGroup(KateDocument *doc)
Constructor.
Definition: kateundo.cpp:276
KateUndoGroup::safePoint
void safePoint(bool safePoint=true)
set group as as savepoint.
Definition: kateundo.cpp:363
KateUndoGroup::~KateUndoGroup
~KateUndoGroup()
Destructor.
Definition: kateundo.cpp:282
KateUndoGroup::redo
void redo()
Redo the contained undo items.
Definition: kateundo.cpp:309

KDE Home | KDE Accessibility Home | Description of Access Keys