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

Kate

kateedit.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2005 Hamish Rodda <rodda@kde.org>
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 KATEEDIT_H
00020 #define KATEEDIT_H
00021 
00022 #include <QtCore/QStringList>
00023 #include <QtCore/QObject>
00024 #include <QtCore/QMap>
00025 
00026 #include <ktexteditor/range.h>
00027 
00028 #include "katenamespace.h"
00029 
00030 class KateDocument;
00031 
00037 class KateEditInfo
00038 {
00039   public:
00040     KateEditInfo(Kate::EditSource source, const KTextEditor::Range& oldRange, const QStringList& oldText, const KTextEditor::Range& newRange, const QStringList& newText);
00041     virtual ~KateEditInfo();
00042 
00044     bool isRemoval() const;
00045 
00050     Kate::EditSource editSource() const;
00051 
00057     const KTextEditor::Cursor& start() const { return m_oldRange.start(); }
00058 
00062     const KTextEditor::Range& oldRange() const;
00063 
00068     virtual QStringList oldText(const KTextEditor::Range& range) const;
00069 
00074     const QStringList& oldText() const;
00075 
00079     const KTextEditor::Range& newRange() const;
00080 
00085     virtual QStringList newText(const KTextEditor::Range& range) const;
00086 
00092     const QStringList& newText() const;
00093 
00094     inline const KTextEditor::Cursor& translate() const { return m_translate; }
00095 
00096     void referenceRevision();
00097     void dereferenceRevision();
00098     bool isReferenced() const;
00099 
00100   private:
00101     Kate::EditSource m_editSource;
00102     KTextEditor::Range m_oldRange;
00103     QStringList m_oldText;
00104     KTextEditor::Range m_newRange;
00105     QStringList m_newText;
00106     KTextEditor::Cursor m_translate;
00107     int m_revisionTokenCounter;
00108 };
00109 
00113 class KateEditHistory : public QObject
00114 {
00115   Q_OBJECT
00116 
00117   public:
00118     explicit KateEditHistory(KateDocument* doc);
00119     virtual ~KateEditHistory();
00120 
00121     int revision();
00122     void releaseRevision(int revision);
00123 
00124     QList<KateEditInfo*> editsBetweenRevisions(int from, int to = -1) const;
00125 
00126     void doEdit(KateEditInfo* edit) { m_edits.append(edit); emit editDone(edit); }
00127 
00128   Q_SIGNALS:
00129     void editDone(KateEditInfo* edit);
00130 
00131   private:
00132     QList<KateEditInfo*> m_edits;
00133 
00134     QMap<int, KateEditInfo*> m_revisions;
00135     int m_revision;
00136 };
00137 
00138 #endif

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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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