kate Library API Documentation

kateundo.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
00003    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00004    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef kate_undo_h
00022 #define kate_undo_h
00023 
00024 #include <qptrlist.h>
00025 #include <qstring.h>
00026 
00027 class KateDocument;
00028 
00029 class KateUndoGroup
00030 {
00031   public:
00032     KateUndoGroup (KateDocument *doc);
00033     ~KateUndoGroup ();
00034 
00035     void undo ();
00036     void redo ();
00037 
00038     void addItem (uint type, uint line, uint col, uint len, const QString &text);
00039 
00040     bool merge(KateUndoGroup* newGroup);
00041 
00042     enum types
00043     {
00044       editInsertText,
00045       editRemoveText,
00046       editWrapLine,
00047       editUnWrapLine,
00048       editInsertLine,
00049       editRemoveLine,
00050       editMarkLineAutoWrapped,
00051       editInvalid
00052     };
00053 
00054   private:
00055     // returns the type if it's only one type, or editInvalid if it contains multiple types.
00056     uint singleType();
00057     bool isOnlyType(uint type);
00058 
00059     void addItem(class KateUndo* u);
00060 
00061     KateDocument *m_doc;
00062     QPtrList<KateUndo> m_items;
00063 };
00064 
00065 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun May 16 22:07:08 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003