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

Kate

kateundomanager.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2009 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef KATEUNDOMANAGER_H
00020 #define KATEUNDOMANAGER_H
00021 
00022 #include <QtCore/QObject>
00023 #include <QtCore/QList>
00024 
00025 class KateDocument;
00026 class KateUndo;
00027 class KateUndoGroup;
00028 
00029 namespace KTextEditor {
00030   class Document;
00031   class View;
00032 }
00033 
00041 class KateUndoManager : public QObject
00042 {
00043   Q_OBJECT
00044 
00045   public:
00051     KateUndoManager (KateDocument *doc);
00052 
00053     ~KateUndoManager();
00054 
00060     uint undoCount () const;
00061 
00067     uint redoCount () const;
00068 
00072     void undoSafePoint();
00073 
00074     bool undoDontMerge() const;
00075 
00081     void setUndoDontMerge(bool dontMerge);
00082 
00083     bool allowComplexMerge() const;
00084 
00093     void setAllowComplexMerge(bool allow);
00094 
00095     void setModified( bool m );
00096     void updateConfig ();
00097 
00098   public Q_SLOTS:
00104     void undo ();
00105 
00111     void redo ();
00112 
00113     void clearUndo ();
00114     void clearRedo ();
00115 
00119     void editStart();
00120 
00124     void editEnd();
00125 
00129     void slotTextInserted(int line, int col, const QString &s);
00130 
00134     void slotTextRemoved(int line, int col, const QString &s);
00135 
00139     void slotMarkLineAutoWrapped(int line, bool autowrapped);
00140 
00144     void slotLineWrapped(int line, int col, int pos, bool newLine);
00145 
00149     void slotLineUnWrapped(int line, int col, int length, bool lineRemoved);
00150 
00154     void slotLineInserted(int line, const QString &s);
00155 
00159     void slotLineRemoved(int line, const QString &s);
00160 
00161   Q_SIGNALS:
00162     void undoChanged ();
00163 
00164   private:
00170     void addUndoItem(KateUndo *undo);
00171 
00172     void updateModified();
00173 
00174   private Q_SLOTS:
00175     void undoCancel();
00176     void viewCreated (KTextEditor::Document *, KTextEditor::View *newView);
00177 
00178   private:
00179     KateDocument *m_document;
00180     bool m_undoComplexMerge;
00181     KateUndoGroup* m_editCurrentUndo;
00182     QList<KateUndoGroup*> undoItems;
00183     QList<KateUndoGroup*> redoItems;
00184     bool m_undoDontMerge;
00185     // these two variables are for resetting the document to
00186     // non-modified if all changes have been undone...
00187     KateUndoGroup* lastUndoGroupWhenSaved;
00188     KateUndoGroup* lastRedoGroupWhenSaved;
00189     bool docWasSavedWhenUndoWasEmpty;
00190     bool docWasSavedWhenRedoWasEmpty;
00191 };
00192 
00193 #endif
00194 
00195 // 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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