• Skip to content
  • Skip to link menu
KDE 4.4 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 
00055     KateDocument *document();
00056 
00062     uint undoCount () const;
00063 
00069     uint redoCount () const;
00070 
00074     void undoSafePoint();
00075 
00076     bool undoDontMerge() const;
00077 
00083     void setUndoDontMerge(bool dontMerge);
00084 
00093     void setAllowComplexMerge(bool allow);
00094 
00095     bool allowComplexMerge() const;
00096 
00097     bool isUndoTrackingEnabled() const { return m_isUndoTrackingEnabled; }
00098 
00099     void setModified( bool m );
00100     void updateConfig ();
00101 
00102   public Q_SLOTS:
00108     void undo ();
00109 
00115     void redo ();
00116 
00117     void clearUndo ();
00118     void clearRedo ();
00119 
00123     void editStart();
00124 
00128     void editEnd();
00129 
00130     void undoStart();
00131     void undoEnd();
00132 
00133     void inputMethodStart();
00134     void inputMethodEnd();
00135 
00139     void slotTextInserted(int line, int col, const QString &s);
00140 
00144     void slotTextRemoved(int line, int col, const QString &s);
00145 
00149     void slotMarkLineAutoWrapped(int line, bool autowrapped);
00150 
00154     void slotLineWrapped(int line, int col, int pos, bool newLine);
00155 
00159     void slotLineUnWrapped(int line, int col, int length, bool lineRemoved);
00160 
00164     void slotLineInserted(int line, const QString &s);
00165 
00169     void slotLineRemoved(int line, const QString &s);
00170 
00171   Q_SIGNALS:
00172     void undoChanged ();
00173     void undoTrackingEnabledChanged(bool enabled);
00174 
00175   private:
00181     void addUndoItem(KateUndo *undo);
00182 
00183     void setUndoTrackingEnabled(bool enabled);
00184 
00185     void updateModified();
00186 
00187   private Q_SLOTS:
00188     void undoCancel();
00189     void viewCreated (KTextEditor::Document *, KTextEditor::View *newView);
00190 
00191   private:
00192     KateDocument *m_document;
00193     bool m_undoComplexMerge;
00194     bool m_isUndoTrackingEnabled;
00195     KateUndoGroup* m_editCurrentUndo;
00196     QList<KateUndoGroup*> undoItems;
00197     QList<KateUndoGroup*> redoItems;
00198     bool m_undoDontMerge;
00199     // these two variables are for resetting the document to
00200     // non-modified if all changes have been undone...
00201     KateUndoGroup* lastUndoGroupWhenSaved;
00202     KateUndoGroup* lastRedoGroupWhenSaved;
00203     bool docWasSavedWhenUndoWasEmpty;
00204     bool docWasSavedWhenRedoWasEmpty;
00205 };
00206 
00207 #endif
00208 
00209 // 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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  •     Sodep
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.9-20090814
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