• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kate

kateundo.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef kate_undo_h
00022 #define kate_undo_h
00023 
00024 #include <QtCore/QList>
00025 
00026 #include "ktexteditor/range.h"
00027 
00028 
00029 class KateDocument;
00030 class KateUndo;
00031 
00035 class KateUndoGroup
00036 {
00037   public:
00042     explicit KateUndoGroup (KateDocument *doc);
00043 
00047     ~KateUndoGroup ();
00048 
00049   public:
00053     void undo ();
00054 
00058     void redo ();
00059 
00060   public:
00064     enum UndoType
00065     {
00066       editInsertText,
00067       editRemoveText,
00068       editWrapLine,
00069       editUnWrapLine,
00070       editInsertLine,
00071       editRemoveLine,
00072       editMarkLineAutoWrapped,
00073       editInvalid
00074     };
00075 
00084     void addItem (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text);
00085 
00090     void setSelection (const KTextEditor::Range &selection);
00091 
00096     void setCursorPosition (const KTextEditor::Cursor &cursor);
00097 
00104     bool merge(KateUndoGroup* newGroup,bool complex);
00105 
00109     void safePoint (bool safePoint=true);
00110 
00114     bool isEmpty () const { return m_items.isEmpty(); }
00115 
00116   private:
00121     KateUndoGroup::UndoType singleType() const;
00122 
00128     bool isOnlyType(KateUndoGroup::UndoType type) const;
00129 
00134     void addItem (KateUndo *u);
00135 
00136   private:
00140     KateDocument *m_doc;
00141 
00145     QList<KateUndo*> m_items;
00146 
00150     bool m_safePoint;
00151 
00155     KTextEditor::Range m_selection;
00156 
00160     KTextEditor::Cursor m_cursor;
00161 };
00162 
00163 #endif
00164 
00165 // kate: space-indent on; indent-width 2; replace-tabs on;

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal