Search for usage in LXR

KTextEditor::InlineNoteInterface Class Referenceabstract

#include <KTextEditor/InlineNoteInterface>

Inherited by KTextEditor::ViewPrivate.

Public Member Functions

virtual void registerInlineNoteProvider (KTextEditor::InlineNoteProvider *provider)=0
virtual void unregisterInlineNoteProvider (KTextEditor::InlineNoteProvider *provider)=0

Detailed Description

Inline notes interface for rendering notes in the text.


The inline notes interface provides a way to render arbitrary things in the text. The text layout of the line is adapted to create space for the note. Possible applications include showing a name of a function parameter in a function call or rendering a square with a color preview next to CSS color property.

Inline note showing a CSS color preview

To register as inline note provider, call registerInlineNoteProvider() with an instance that inherits InlineNoteProvider. Finally, make sure you remove your inline note provider by calling unregisterInlineNoteProvider().

Accessing the InlineNoteInterface

The InlineNoteInterface is an extension interface for a View, i.e. the View inherits the interface. Use qobject_cast to access the interface:

// view is of type KTextEditor::View*
auto iface = qobject_cast<KTextEditor::InlineNoteInterface*>(view);
if (iface) {
// the implementation supports the interface
// myProvider inherits KTextEditor::InlineNoteProvider
} else {
// the implementation does not support the interface
See also
Sven Brauch, Michal Srb

Definition at line 69 of file inlinenoteinterface.h.

Member Function Documentation

◆ registerInlineNoteProvider()

virtual void KTextEditor::InlineNoteInterface::registerInlineNoteProvider ( KTextEditor::InlineNoteProvider provider)
pure virtual

Register the inline note provider provider.

Whenever a line is painted, the provider will be queried for notes that should be painted in it. When the provider is about to be destroyed, make sure to call unregisterInlineNoteProvider() to avoid a dangling pointer.

providerinline note provider
See also
unregisterInlineNoteProvider(), InlineNoteProvider

◆ unregisterInlineNoteProvider()

virtual void KTextEditor::InlineNoteInterface::unregisterInlineNoteProvider ( KTextEditor::InlineNoteProvider provider)
pure virtual

Unregister the inline note provider provider.

providerinline note provider to unregister
See also
registerInlineNoteProvider(), InlineNoteProvider

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 30 2023 03:58:48 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.