• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • kde-4.14
  • applications
  • kate
  • 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 
32 namespace KTextEditor
33 {
34 
47 class 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 
165 Q_DECLARE_INTERFACE(KTextEditor::MovingInterface, "org.kde.KTextEditor.MovingInterface")
166 
167 #endif
168 
169 // kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::MovingRange::EmptyBehavior
EmptyBehavior
Behavior of range if it becomes empty.
Definition: movingrange.h:152
KTextEditor::MovingCursor
A Cursor which is bound to a specific Document, and maintains its position.
Definition: movingcursor.h:66
movingrange.h
movingrangefeedback.h
KTextEditor::MovingRange
A range that is bound to a specific Document, and maintains its position.
Definition: movingrange.h:132
KTextEditor::MovingRange::DoNotExpand
Don't expand to encapsulate new characters in either direction. This is the default.
Definition: movingrange.h:141
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:55
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_export.h
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:111
KTextEditor::MovingInterface
Document interface for MovingCursors and MovingRanges.
Definition: movinginterface.h:47
KTextEditor::MovingRange::AllowEmpty
allow range to be empty
Definition: movingrange.h:153
KTEXTEDITOR_EXPORT
#define KTEXTEDITOR_EXPORT
Definition: ktexteditor_export.h:35
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:54
KTextEditor::MovingCursor::MoveOnInsert
move on insert
Definition: movingcursor.h:78
movingcursor.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



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