KTextEditor.MovingInterface

KDE 4.9 PyKDE API Reference

- KDE's Python API

# MovingInterface Class Reference

`from PyKDE4.ktexteditor import *`

Namespace: KTextEditor

## Detailed Description

Document interface for MovingCursor%s and MovingRange%s.

This class provides the interface for KTextEditor.Documents to create MovingCursors/Ranges.

Author:
  Christoph Cullmann <cullmann@kde.org>

Since:
  4.5

## Methods
| __init__ (self)
long | lastSavedRevision (self)
| lockRevision (self, long revision)
KTextEditor.MovingCursor | newMovingCursor (self, KTextEditor.Cursor position, KTextEditor.MovingCursor.InsertBehavior insertBehavior=KTextEditor.MovingCursor.MoveOnInsert)
KTextEditor.MovingRange | newMovingRange (self, KTextEditor.Range range, KTextEditor.MovingRange.InsertBehaviors insertBehaviors=KTextEditor.MovingRange.DoNotExpand, KTextEditor.MovingRange.EmptyBehavior emptyBehavior=KTextEditor.MovingRange.AllowEmpty)
long | revision (self)
| transformCursor (self, KTextEditor.Cursor cursor, KTextEditor.MovingCursor.InsertBehavior insertBehavior, long fromRevision, long toRevision=-1)
| transformCursor (self, int line, int column, KTextEditor.MovingCursor.InsertBehavior insertBehavior, long fromRevision, long toRevision=-1)
| transformRange (self, KTextEditor.Range range, KTextEditor.MovingRange.InsertBehaviors insertBehaviors, KTextEditor.MovingRange.EmptyBehavior emptyBehavior, long fromRevision, long toRevision=-1)
| unlockRevision (self, long revision)

## Method Documentation

__init__ | ( |  | self ) |

Default constructor

long lastSavedRevision | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Last revision the buffer got successful saved

Returns:
  last revision buffer got saved, -1 if none

lockRevision | ( | self, |
|  | long | revision
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Lock a revision, this will keep it around until released again. But all revisions will always be cleared on buffer clear() (and therefor load())

Parameters:

  | revision | revision to lock

KTextEditor.MovingCursor newMovingCursor | ( | self, |
|  | KTextEditor.Cursor | position,
|  | KTextEditor.MovingCursor.InsertBehavior | insertBehavior=KTextEditor.MovingCursor.MoveOnInsert
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Create a new moving cursor for this document.

Parameters:

  | position | position of the moving cursor to create
  | insertBehavior | insertion behavior

Returns:
  new moving cursor for the document

KTextEditor.MovingRange newMovingRange | ( | self, |
|  | KTextEditor.Range | range,
|  | KTextEditor.MovingRange.InsertBehaviors | insertBehaviors=KTextEditor.MovingRange.DoNotExpand,
|  | KTextEditor.MovingRange.EmptyBehavior | emptyBehavior=KTextEditor.MovingRange.AllowEmpty
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Create a new moving range for this document.

Parameters:

  | range | range of the moving range to create
  | insertBehaviors | insertion behaviors
  | emptyBehavior | behavior on becoming empty

Returns:
  new moving range for the document

long revision | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Current revision

Returns:
  current revision

transformCursor | ( | self, |
|  | KTextEditor.Cursor | cursor,
|  | KTextEditor.MovingCursor.InsertBehavior | insertBehavior,
|  | long | fromRevision,
|  | long | toRevision=-1
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Transform a cursor from one revision to an other.

Parameters:

  | line | line number of the cursor to transform
  | column | column number of the cursor to transform
  | insertBehavior | behavior of this cursor on insert of text at its position
  | fromRevision | from this revision we want to transform
  | toRevision | to this revision we want to transform, default of -1 is current revision

transformCursor | ( | self, |
|  | int | line,
|  | int | column,
|  | KTextEditor.MovingCursor.InsertBehavior | insertBehavior,
|  | long | fromRevision,
|  | long | toRevision=-1
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Transform a cursor from one revision to an other.

Parameters:

  | line | line number of the cursor to transform
  | column | column number of the cursor to transform
  | insertBehavior | behavior of this cursor on insert of text at its position
  | fromRevision | from this revision we want to transform
  | toRevision | to this revision we want to transform, default of -1 is current revision

transformRange | ( | self, |
|  | KTextEditor.Range | range,
|  | KTextEditor.MovingRange.InsertBehaviors | insertBehaviors,
|  | KTextEditor.MovingRange.EmptyBehavior | emptyBehavior,
|  | long | fromRevision,
|  | long | toRevision=-1
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Transform a range from one revision to an other.

Parameters:

  | range | range to transform
  | insertBehaviors | behavior of this range on insert of text at its position
  | emptyBehavior | behavior on becoming empty
  | fromRevision | from this revision we want to transform
  | toRevision | to this revision we want to transform, default of -1 is current revision

unlockRevision | ( | self, |
|  | long | revision
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Release a revision.

Parameters:

  | revision | revision to release