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

KTextEditor

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

#include <highlightinterface.h>

Classes

struct  AttributeBlock
 

Public Types

enum  DefaultStyle {
  dsNormal, dsKeyword, dsDataType, dsDecVal,
  dsBaseN, dsFloat, dsChar, dsString,
  dsComment, dsOthers, dsAlert, dsFunction,
  dsRegionMarker, dsError
}
 

Public Member Functions

 HighlightInterface ()
 
virtual ~HighlightInterface ()
 
virtual Attribute::Ptr defaultStyle (const DefaultStyle ds) const =0
 
virtual QStringList embeddedHighlightingModes () const =0
 
virtual QString highlightingModeAt (const Cursor &position)=0
 
virtual QList< AttributeBlock > lineAttributes (const unsigned int line)=0
 

Detailed Description

Highlighting information interface for the Document.

Introduction

The HighlightInterface provides methods to access the Attributes used for highlighting the Document.

Accessing the HighlightInterface

The HighlightInterface is supposed to be 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:

// doc is of type KTextEditor::Document*
KTextEditor::HighlightInterface *iface =
qobject_cast<KTextEditor::HighlightInterface*>( doc );
if( iface ) {
// the implementation supports the interface
// do stuff
}
See also
KTextEditor::Document
Author
Milian Wolff <mail@.nosp@m.mili.nosp@m.anw.d.nosp@m.e>
Since
4.4

Definition at line 72 of file highlightinterface.h.

Member Enumeration Documentation

enum KTextEditor::HighlightInterface::DefaultStyle

TODO: Documentation.

Enumerator
dsNormal 
dsKeyword 
dsDataType 
dsDecVal 
dsBaseN 
dsFloat 
dsChar 
dsString 
dsComment 
dsOthers 
dsAlert 
dsFunction 
dsRegionMarker 
dsError 

Definition at line 76 of file highlightinterface.h.

Constructor & Destructor Documentation

HighlightInterface::HighlightInterface ( )

Constructor.

Definition at line 24 of file highlightinterface.cpp.

HighlightInterface::~HighlightInterface ( )
virtual

Virtual destructor.

Definition at line 28 of file highlightinterface.cpp.

Member Function Documentation

virtual Attribute::Ptr KTextEditor::HighlightInterface::defaultStyle ( const DefaultStyle  ds) const
pure virtual

Returns the attribute used for the style ds.

virtual QStringList KTextEditor::HighlightInterface::embeddedHighlightingModes ( ) const
pure virtual

Get all available highlighting modes for the current document.

Each document can be highlighted using an arbitrary number of highlighting contexts. This method will return the names for each of the used modes.

Example: The "PHP (HTML)" mode includes the highlighting for PHP, HTML, CSS and JavaScript.

Returns
Returns a list of embedded highlighting modes for the current Document.
See also
KTextEditor::Document::highlightingMode()
virtual QString KTextEditor::HighlightInterface::highlightingModeAt ( const Cursor &  position)
pure virtual

Get the highlight mode used at a given position in the document.

Retrieve the name of the applied highlight mode at a given position in the current document.

See also
highlightingModes()

TODO: I intended to make this const but Kate's implementation needs to call kateTextline which is non-const. Solution?

virtual QList<AttributeBlock> KTextEditor::HighlightInterface::lineAttributes ( const unsigned int  line)
pure virtual

Get the list of AttributeBlocks for a given line in the document.

Returns
list of AttributeBlocks for given line.

The documentation for this class was generated from the following files:
  • highlightinterface.h
  • highlightinterface.cpp
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