KTextEditor::AnnotationViewInterfaceV2

Search for usage in LXR

KTextEditor::AnnotationViewInterfaceV2 Class Referenceabstract

#include <annotationinterface.h>

Inheritance diagram for KTextEditor::AnnotationViewInterfaceV2:

Public Member Functions

virtual KTextEditor::AbstractAnnotationItemDelegateannotationItemDelegate () const =0
 
virtual void setAnnotationItemDelegate (KTextEditor::AbstractAnnotationItemDelegate *delegate)=0
 
virtual void setAnnotationUniformItemSizes (bool uniformItemSizes)=0
 
virtual bool uniformAnnotationItemSizes () const =0
 
- Public Member Functions inherited from KTextEditor::AnnotationViewInterface
virtual void annotationActivated (KTextEditor::View *view, int line)=0
 
virtual void annotationBorderVisibilityChanged (KTextEditor::View *view, bool visible)=0
 
virtual void annotationContextMenuAboutToShow (KTextEditor::View *view, QMenu *menu, int line)=0
 
virtual bool isAnnotationBorderVisible () const =0
 
virtual void setAnnotationBorderVisible (bool visible)=0
 
- Public Member Functions inherited from KTextEditor::AnnotationInterface
virtual AnnotationModelannotationModel () const =0
 
virtual void setAnnotationModel (AnnotationModel *model)=0
 

Detailed Description

Annotation interface for the View, version 2.

Introduction

The AnnotationViewInterfaceV2 allows to do the same as AnnotationViewInterface and additionally

For a more detailed explanation about whether you want to set a custom delegate for rendering the annotations, read the detailed documentation about the AbstractAnnotationItemDelegate.

Accessing the AnnotationViewInterface

The AnnotationViewInterfaceV2 is an extension interface for a View, i.e. the View inherits the interface provided that the used KTextEditor library implements the interface. Use qobject_cast to access the interface:

// view is of type KTextEditor::View*
auto iface = qobject_cast<KTextEditor::AnnotationViewInterfaceV2*>(view);
if (iface) {
// the implementation supports the interface
// do stuff
iface->setAnnotationItemDelegate(myDelegate);
iface->setAnnotationUniformItemSizes(true);
} else {
// the implementation does not support the interface
}
Since
5.53

Definition at line 302 of file annotationinterface.h.

Member Function Documentation

◆ annotationItemDelegate()

virtual KTextEditor::AbstractAnnotationItemDelegate* KTextEditor::AnnotationViewInterfaceV2::annotationItemDelegate ( ) const
pure virtual

Returns the currently used AbstractAnnotationItemDelegate.

Returns
the current AbstractAnnotationItemDelegate

◆ setAnnotationItemDelegate()

virtual void KTextEditor::AnnotationViewInterfaceV2::setAnnotationItemDelegate ( KTextEditor::AbstractAnnotationItemDelegate delegate)
pure virtual

Sets the AbstractAnnotationItemDelegate for this view and the model to provide custom rendering of annotation information for each line.

Ownership is not transferred.

Parameters
delegatethe new AbstractAnnotationItemDelegate, or nullptr to reset to the default delegate

◆ setAnnotationUniformItemSizes()

virtual void KTextEditor::AnnotationViewInterfaceV2::setAnnotationUniformItemSizes ( bool  uniformItemSizes)
pure virtual

This function can be used to declare whether it is known that the annotation items rendered by the set delegate all have the same size.

This enables the view to do some optimizations for performance purposes.

By default the value of this property is false .

Parameters
uniformItemSizesif true the annotation items are considered to all have the same size

◆ uniformAnnotationItemSizes()

virtual bool KTextEditor::AnnotationViewInterfaceV2::uniformAnnotationItemSizes ( ) const
pure virtual

Checks whether the annotation items all have the same size.


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

KDE's Doxygen guidelines are available online.