• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • interfaces
  • ktexteditor
movinginterface.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 2010 Christoph Cullmann <cullmann@kde.org>
4 *
5 * Based on code of the SmartCursor/Range by:
6 * Copyright (C) 2003-2005 Hamish Rodda <rodda@kde.org>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24#ifndef KDELIBS_KTEXTEDITOR_MOVINGINTERFACE_H
25#define KDELIBS_KTEXTEDITOR_MOVINGINTERFACE_H
26
27#include <ktexteditor/ktexteditor_export.h>
28#include <ktexteditor/movingcursor.h>
29#include <ktexteditor/movingrange.h>
30#include <ktexteditor/movingrangefeedback.h>
31
32namespace KTextEditor
33{
34
47class KTEXTEDITOR_EXPORT MovingInterface
48{
49 //
50 // Constructor/Destructor
51 //
52 public:
56 MovingInterface ();
57
61 virtual ~MovingInterface ();
62
63 //
64 // Normal API
65 //
66 public:
73 virtual MovingCursor *newMovingCursor (const Cursor &position, MovingCursor::InsertBehavior insertBehavior = MovingCursor::MoveOnInsert) = 0;
74
82 virtual MovingRange *newMovingRange (const Range &range, MovingRange::InsertBehaviors insertBehaviors = MovingRange::DoNotExpand
83 , MovingRange::EmptyBehavior emptyBehavior = MovingRange::AllowEmpty) = 0;
84
89 virtual qint64 revision () const = 0;
90
95 virtual qint64 lastSavedRevision () const = 0;
96
102 virtual void lockRevision (qint64 revision) = 0;
103
108 virtual void unlockRevision (qint64 revision) = 0;
109
117 virtual void transformCursor (KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision = -1) = 0;
118
127 virtual void transformCursor (int& line, int& column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision = -1) = 0;
128
137 virtual void transformRange (KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision = -1) = 0;
138
139 //
140 // Signals
141 //
142 public:
147 void aboutToDeleteMovingInterfaceContent (KTextEditor::Document *document);
148
154 void aboutToInvalidateMovingInterfaceContent (KTextEditor::Document *document);
155
156 private:
160 class MovingInterfacePrivate * const d;
161};
162
163}
164
165Q_DECLARE_INTERFACE(KTextEditor::MovingInterface, "org.kde.KTextEditor.MovingInterface")
166
167#endif
168
169// kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:62
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:112
KTextEditor::MovingCursor
A Cursor which is bound to a specific Document, and maintains its position.
Definition: movingcursor.h:67
KTextEditor::MovingCursor::InsertBehavior
InsertBehavior
Insert behavior of this cursor, should it stay if text is insert at its position or should it move.
Definition: movingcursor.h:76
KTextEditor::MovingInterface
Document interface for MovingCursors and MovingRanges.
Definition: movinginterface.h:48
KTextEditor::MovingInterface::lockRevision
virtual void lockRevision(qint64 revision)=0
Lock a revision, this will keep it around until released again.
KTextEditor::MovingInterface::transformCursor
virtual void transformCursor(KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1)=0
Transform a cursor from one revision to an other.
KTextEditor::MovingInterface::aboutToDeleteMovingInterfaceContent
void aboutToDeleteMovingInterfaceContent(KTextEditor::Document *document)
This signal is emitted before the cursors/ranges/revisions of a document are destroyed as the documen...
KTextEditor::MovingInterface::newMovingCursor
virtual MovingCursor * newMovingCursor(const Cursor &position, MovingCursor::InsertBehavior insertBehavior=MovingCursor::MoveOnInsert)=0
Create a new moving cursor for this document.
KTextEditor::MovingInterface::unlockRevision
virtual void unlockRevision(qint64 revision)=0
Release a revision.
KTextEditor::MovingInterface::transformCursor
virtual void transformCursor(int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1)=0
Transform a cursor from one revision to an other.
KTextEditor::MovingInterface::aboutToInvalidateMovingInterfaceContent
void aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *document)
This signal is emitted before the ranges of a document are invalidated and the revisions are deleted ...
KTextEditor::MovingInterface::revision
virtual qint64 revision() const =0
Current revision.
KTextEditor::MovingInterface::newMovingRange
virtual MovingRange * newMovingRange(const Range &range, MovingRange::InsertBehaviors insertBehaviors=MovingRange::DoNotExpand, MovingRange::EmptyBehavior emptyBehavior=MovingRange::AllowEmpty)=0
Create a new moving range for this document.
KTextEditor::MovingInterface::transformRange
virtual void transformRange(KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision=-1)=0
Transform a range from one revision to an other.
KTextEditor::MovingInterface::lastSavedRevision
virtual qint64 lastSavedRevision() const =0
Last revision the buffer got successful saved.
KTextEditor::MovingRange
A range that is bound to a specific Document, and maintains its position.
Definition: movingrange.h:123
KTextEditor::MovingRange::EmptyBehavior
EmptyBehavior
Behavior of range if it becomes empty.
Definition: movingrange.h:142
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:55
ktexteditor_export.h
movingcursor.h
movingrange.h
movingrangefeedback.h
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal