# class KTextEditor.SmartCursorNotifier

###

Table of contents
Modules
ktexteditor Classes
All Classes

Module | ktexteditor
Namespace | ktexteditor
Class | KTextEditor.SmartCursorNotifier
Inherits | QObject

A class which provides notifications of state changes to a SmartCursor via QObject signals.

This class provides notifications of changes to a SmartCursor such as the position in the document, and deletion or insertion of text immediately before or after the cursor.

If you prefer to receive notifications via virtual inheritance, see SmartCursorWatcher.

See also SmartCursor, SmartCursorNotifier

Author Hamish Rodda \<rodda@kde.org\>

### methods

- SmartCursorNotifier ()

  returns nothing

  Default constructor.

- characterDeleted (cursor, deletedBefore) signal

  returns nothing
  SIGNAL ("characterDeleted (KTextEditor.SmartCursor*, bool)")

  Argument | Type | Default
  --- | --- | ---
  cursor | KTextEditor.SmartCursor |
  deletedBefore | bool |

  One character immediately surrounding the cursor was deleted. If both characters are simultaneously deleted, positionDeleted() is called instead.

  cursor - pointer to the cursor which generated the notification.

  deletedBefore - true if the character immediately before was deleted, false if the character immediately after was deleted.

- characterInserted (cursor, insertedBefore) signal

  returns nothing
  SIGNAL ("characterInserted (KTextEditor.SmartCursor*, bool)")

  Argument | Type | Default
  --- | --- | ---
  cursor | KTextEditor.SmartCursor |
  insertedBefore | bool |

  A character was inserted immediately before or after the cursor, as given by insertedBefore.

  cursor - pointer to the cursor which generated the notification.

  insertedBefore - true if a character was inserted before cursor, false if a character was inserted after

- deleted (cursor) signal

  returns nothing
  SIGNAL ("deleted (KTextEditor.SmartCursor*)")

  Argument | Type | Default
  --- | --- | ---
  cursor | KTextEditor.SmartCursor |

  The SmartCursor instance specified by cursor is being deleted.

  cursor - pointer to the cursor which is about to be deleted. It is still safe to access information at this point.

- positionChanged (cursor) signal

  returns nothing
  SIGNAL ("positionChanged (KTextEditor.SmartCursor*)")

  Argument | Type | Default
  --- | --- | ---
  cursor | KTextEditor.SmartCursor |

  The cursor's position was changed.

  cursor - pointer to the cursor which generated the notification.

- positionDeleted (cursor) signal

  returns nothing
  SIGNAL ("positionDeleted (KTextEditor.SmartCursor*)")

  Argument | Type | Default
  --- | --- | ---
  cursor | KTextEditor.SmartCursor |

  The cursor's surrounding characters were both deleted simultaneously. The cursor is automatically placed at the start of the deleted region.

  cursor - pointer to the cursor which generated the notification.

- setWantsDirectChanges (wantsDirectChanges)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  wantsDirectChanges | bool |

  Set whether this notifier should notify of changes that happen directly to the cursor, e.g. by calls to SmartCursor.setPosition(), rather than just when surrounding text changes.

  wantsDirectChanges - whether this notifier should provide notifications for direct changes.

- wantsDirectChanges ()

  returns (bool)

  Returns whether this notifier will notify of changes that happen directly to the cursor, e.g. by calls to SmartCursor.setPosition(), rather than just when surrounding text changes.