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

KTextEditor

  • KTextEditor
  • AnnotationInterface
Public Member Functions | List of all members
KTextEditor::AnnotationInterface Class Referenceabstract
Document Extension Interfaces

#include <annotationinterface.h>

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

Public Member Functions

virtual ~AnnotationInterface ()
 
virtual AnnotationModel * annotationModel () const =0
 
virtual void setAnnotationModel (AnnotationModel *model)=0
 

Detailed Description

A Document extension interface for handling Annotations.

Introduction

The AnnotationInterface is designed to provide line annotation information for a document. This interface provides means to associate a document with a annotation model, which provides some annotation information for each line in the document.

Setting a model for a Document makes the model data available for all views. If you only want to provide annotations in exactly one view, you can use the AnnotationViewInterface directly. See the AnnotationViewInterface for further details. To summarize, the two use cases are

  • (1) show annotations in all views. This means you set an AnnotationModel with this interface, and then call setAnnotationBorderVisible() for each view.
  • (2) show annotations only in one view. This means to not use this interface. Instead, use the AnnotationViewInterface, which inherits this interface. This means you set a model for the specific View.

If you set a model to the Document and the View, the View's model has higher priority.

Accessing the AnnotationInterface

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

// document is of type KTextEditor::Document*
KTextEditor::AnnotationInterface *iface =
qobject_cast<KTextEditor::AnnotationInterface*>( document );
if( iface ) {
// the implementation supports the interface
// do stuff
}

Using the AnnotationInterface

Since
4.1
See also
KTextEditor::AnnotationModel, KTextEditor::AnnotationViewInterface

Definition at line 157 of file annotationinterface.h.

Constructor & Destructor Documentation

virtual KTextEditor::AnnotationInterface::~AnnotationInterface ( )
inlinevirtual

Definition at line 160 of file annotationinterface.h.

Member Function Documentation

virtual AnnotationModel* KTextEditor::AnnotationInterface::annotationModel ( ) const
pure virtual

returns the currently set AnnotationModel or 0 if there's none set

Returns
the current AnnotationModel
virtual void KTextEditor::AnnotationInterface::setAnnotationModel ( AnnotationModel *  model)
pure virtual

Sets a new AnnotationModel for this document to provide annotation information for each line.

Parameters
modelthe new AnnotationModel

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