• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • KTextEditor
  • AnnotationViewInterface
Public Member Functions | List of all members
KTextEditor::AnnotationViewInterface Class Referenceabstract
View Extension Interfaces

#include <annotationinterface.h>

Inheritance diagram for KTextEditor::AnnotationViewInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~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 ~AnnotationInterface ()
 
virtual AnnotationModel * annotationModel () 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*
KTextEditor::AnnotationViewInterface *iface =
qobject_cast<KTextEditor::AnnotationViewInterface*>( view );
if( iface ) {
// the implementation supports the interface
// do stuff
iface->setAnnotationBorderVisible( true );
}
Since
4.1

Definition at line 217 of file annotationinterface.h.

Constructor & Destructor Documentation

virtual KTextEditor::AnnotationViewInterface::~AnnotationViewInterface ( )
inlinevirtual

Definition at line 220 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 posistion 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:
  • annotationinterface.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal