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

KTextEditor

  • KTextEditor
  • HighlightInterface
Classes | Public Types | Public Member Functions

KTextEditor::HighlightInterface Class Reference
Document Extension Interfaces

Highlighting information interface for the Document. More...

#include <highlightinterface.h>

List of all members.

Classes

struct  AttributeBlock
 An AttributeBlock represents an Attribute with its dimension in a given line. More...

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@milianw.de>
Since:
4.4

Definition at line 64 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 68 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

KTextEditor

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal