KTextEditor::AnnotationViewInterface

KTextEditor::AnnotationViewInterface Class Referenceabstract

#include <annotationinterface.h>

Inheritance diagram for KTextEditor::AnnotationViewInterface:

Public Member Functions

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.

Introduction

The AnnotationViewInterface allows to do two things:

  • (1) show/hide the annotation border along with the possibility to add actions into its context menu.
  • (2) set a separate AnnotationModel for the View: Note that this interface inherits the AnnotationInterface.

For a more detailed explanation about whether you want an AnnotationModel in the Document or the View, read the detailed documentation about the AnnotationInterface.

Accessing the AnnotationViewInterface

The AnnotationViewInterface 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::AnnotationViewInterface*>(view);
if (iface) {
// the implementation supports the interface
// do stuff
} else {
// the implementation does not support the interface
}
Since
4.1

Definition at line 209 of file annotationinterface.h.

Member Function Documentation

virtual void KTextEditor::AnnotationViewInterface::annotationActivated ( KTextEditor::View view,
int  line 
)
pure virtual

This signal is emitted when an entry on the annotation border was activated, for example by clicking or double-clicking it.

This follows the KDE wide setting for activation via click or double-clcik

Parameters
viewthe view to which the activated border belongs to
linethe document line that the activated position belongs to
virtual void KTextEditor::AnnotationViewInterface::annotationBorderVisibilityChanged ( KTextEditor::View view,
bool  visible 
)
pure virtual

This signal is emitted when the annotation border is shown or hidden.

Parameters
viewthe view to which the border belongs to
visiblethe current visibility state
virtual void KTextEditor::AnnotationViewInterface::annotationContextMenuAboutToShow ( KTextEditor::View view,
QMenu menu,
int  line 
)
pure virtual

This signal is emitted before a context menu is shown on the annotation border for the given line and view.

Note
Kate Part implementation detail: In Kate Part, the menu has an entry to hide the annotation border.
Parameters
viewthe view that the annotation border belongs to
menuthe context menu that will be shown
linethe annotated line for which the context menu is shown
virtual bool KTextEditor::AnnotationViewInterface::isAnnotationBorderVisible ( ) const
pure virtual

Checks whether the View's annotation border is visible.

virtual void KTextEditor::AnnotationViewInterface::setAnnotationBorderVisible ( bool  visible)
pure virtual

This function can be used to show or hide the annotation border The annotation border is hidden by default.

Parameters
visibleif true the annotation border is shown, otherwise hidden

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 Sat Nov 21 2020 22:57:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.