# class KTextEditor.SmartRangeWatcher

###

Table of contents
Modules
ktexteditor Classes
All Classes

Module | ktexteditor
Namespace | ktexteditor
Class | KTextEditor.SmartRangeWatcher
Inherits |

A class which provides notifications of state changes to a SmartRange via virtual inheritance.

This class provides notifications of changes to the position or contents of a SmartRange via virtual inheritance.

If you prefer to receive notifications via QObject signals, see SmartRangeNotifier.

See also SmartRange, SmartRangeNotifier

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

### methods

- SmartRangeWatcher ()

  returns nothing

  Default constructor

- caretEnteredRange (range, view)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  view | KTextEditor.View |

  The caret on view entered range.

  To do: For now, to receive this notification, the range heirachy must be registered with the SmartInterface as for arbitrary highlighting with dynamic highlighting. Need to add another (and probably simplify existing) method.

  range - pointer to the range which generated the notification.

  view - view over which the mouse moved to generate the notification

- caretExitedRange (range, view)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  view | KTextEditor.View |

  The caret on view exited range.

  To do: For now, to receive this notification, the range heirachy must be registered with the SmartInterface as for arbitrary highlighting with dynamic highlighting. Need to add another (and probably simplify existing) method.

  range - pointer to the range which generated the notification.

  view - view over which the mouse moved to generate the notification

- childRangeInserted (range, child)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  child | KTextEditor.SmartRange |

  The range child was inserted as a child range into the current range.

  range - pointer to the range which generated the notification.

  child - pointer to the range which was inserted as a child range.

- childRangeRemoved (range, child)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  child | KTextEditor.SmartRange |

  The child range child was removed from the current range.

  range - pointer to the range which generated the notification.

  child - pointer to the child range which was removed.

- mouseEnteredRange (range, view)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  view | KTextEditor.View |

  The mouse cursor on view entered range.

  To do: For now, to receive this notification, the range heirachy must be registered with the SmartInterface as for arbitrary highlighting with dynamic highlighting. Need to add another (and probably simplify existing) method.

  range - pointer to the range which generated the notification.

  view - view over which the mouse moved to generate the notification

- mouseExitedRange (range, view)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  view | KTextEditor.View |

  The mouse cursor on view exited range.

  To do: For now, to receive this notification, the range heirachy must be registered with the SmartInterface as for arbitrary highlighting with dynamic highlighting. Need to add another (and probably simplify existing) method.

  range - pointer to the range which generated the notification.

  view - view over which the mouse moved to generate the notification

- parentRangeChanged (range, newParent, oldParent)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  newParent | KTextEditor.SmartRange |
  oldParent | KTextEditor.SmartRange |

  The range's parent was changed.

  range - pointer to the range which generated the notification.

  newParent - pointer to the range which was is now the parent range.

  oldParent - pointer to the range which used to be the parent range.

- rangeAttributeChanged (range, currentAttribute, previousAttribute)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  currentAttribute | KTextEditor.Attribute.Ptr |
  previousAttribute | KTextEditor.Attribute.Ptr |

  The highlighting attribute of range was changed from previousAttribute to currentAttribute.

  range - pointer to the range which generated the notification.

  currentAttribute - the attribute newly assigned to this range

  previousAttribute - the attribute previously assigned to this range

- rangeContentsChanged (range)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |

  The contents of the range changed.

  range - pointer to the range which generated the notification.

- rangeContentsChanged (range, mostSpecificChild)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |
  mostSpecificChild | KTextEditor.SmartRange |

  The contents of the range changed. This notification is special in that it is only emitted by the top range of a heirachy, and also gives the furthest descendant child range which still encompasses the whole change (see contents).

  range - the range which has changed

  mostSpecificChild - the child range which both contains the entire change and is the furthest descendant of this range.

- rangeDeleted (range)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |

  The SmartRange instance specified by range is being deleted.

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

- rangeEliminated (range)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |

  The range now contains no characters (ie. the start and end cursors are the same).

  range - pointer to the range which generated the notification.

- rangePositionChanged (range)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  range | KTextEditor.SmartRange |

  The range's position changed.

  range - pointer to the range which generated the notification.

- setWantsDirectChanges (wantsDirectChanges)

  returns nothing

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

  Set whether this watcher should be notified of changes that happen directly to the range, e.g. by calls to SmartCursor.setRange(), or by direct assignment to either of the start() or end() cursors, rather than just when surrounding text changes.

  wantsDirectChanges - whether this watcher should receive notifications for direct changes.

- wantsDirectChanges ()

  returns (bool)

  Returns whether this watcher will be notified of changes that happen directly to the range, e.g. by calls to SmartCursor.setRange(), or by direct assignment to either of the start() or end() cursors, rather than just when surrounding text changes.