KTextEditor::AnnotationViewInterfaceV2

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

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

Returns the currently used AbstractAnnotationItemDelegate.

Returns
the current AbstractAnnotationItemDelegate
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
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
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-2020 The KDE developers.
Generated on Thu Dec 3 2020 22:58:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.