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

Kate

Classes | Public Types | Public Member Functions | List of all members
KateHighlighting Class Reference

#include <katehighlight.h>

Classes

struct  ContextChange
 

Public Types

enum  CSLPos { CSLPosColumn0 =0, CSLPosAfterWhitespace =1 }
 

Public Member Functions

 KateHighlighting (const KateSyntaxModeListItem *def)
 
 ~KateHighlighting ()
 
bool allowsFolding ()
 
int attribute (int context) const
 
bool attributeRequiresSpellchecking (int attr)
 
QList
< KTextEditor::Attribute::Ptr > 
attributes (const QString &schema)
 
const QString & author () const
 
bool canBreakAt (QChar c, int attrib=0) const
 
bool canComment (int startAttr, int endAttr) const
 
const QHash< QString, QChar > & characterEncodings (int attrib=0) const
 
void clearAttributeArrays ()
 
signed char commentRegion (int attr) const
 
KateHlContext * contextNum (int n)
 
int defaultStyleForAttribute (int attrib) const
 
void doHighlight (const Kate::TextLineData *prevLine, Kate::TextLineData *textLine, const Kate::TextLineData *nextLine, bool &ctxChanged, int tabWidth=0, QVector< ContextChange > *contextChanges=0)
 
void dropDynamicContexts ()
 
QLinkedList< QRegExp > emptyLines (int attribute=0) const
 
bool foldingIndentationSensitive ()
 
const QHash< QString, QChar > & getCharacterEncodings (int attrib) const
 
const KatePrefixStore & getCharacterEncodingsPrefixStore (int attrib) const
 
QString getCommentEnd (int attrib=0) const
 
CSLPos getCommentSingleLinePosition (int attrib=0) const
 
QString getCommentSingleLineStart (int attrib=0) const
 
QString getCommentStart (int attrib=0) const
 
QStringList getEmbeddedHighlightingModes () const
 
int getEncodedCharactersInsertionPolicy (int attrib) const
 
const QString & getIdentifier () const
 
void getKateExtendedAttributeList (const QString &schema, QList< KateExtendedAttribute::Ptr > &, KConfig *cfg=0)
 
void getKateExtendedAttributeListCopy (const QString &schema, QList< KateExtendedAttribute::Ptr > &, KConfig *cfg=0)
 
const QHash< QChar, QString > & getReverseCharacterEncodings (int attrib) const
 
bool hidden () const
 
QString hlKeyForAttrib (int attrib) const
 
QString hlKeyForContext (int attrib) const
 
QString indentation ()
 
bool isEmptyLine (const Kate::TextLineData *textline) const
 
bool isInWord (QChar c, int attrib=0) const
 
const QString & license () const
 
const QString & name () const
 
const QString & nameTranslated () const
 
bool noHighlighting () const
 
void release ()
 
const QString & section () const
 
void setKateExtendedAttributeList (const QString &schema, QList< KateExtendedAttribute::Ptr > &, KConfig *cfg=0, bool writeDefaultsToo=false)
 
const QString & style () const
 
void use ()
 
const QString & version () const
 

Detailed Description

Definition at line 119 of file katehighlight.h.

Member Enumeration Documentation

enum KateHighlighting::CSLPos

This enum is used for storing the information where a single line comment marker should be inserted.

Enumerator
CSLPosColumn0 
CSLPosAfterWhitespace 

Definition at line 227 of file katehighlight.h.

Constructor & Destructor Documentation

KateHighlighting::KateHighlighting ( const KateSyntaxModeListItem *  def)

Definition at line 83 of file katehighlight.cpp.

KateHighlighting::~KateHighlighting ( )

Definition at line 115 of file katehighlight.cpp.

Member Function Documentation

bool KateHighlighting::allowsFolding ( )
inline

Definition at line 408 of file katehighlight.h.

int KateHighlighting::attribute ( int  context) const
Returns
the attribute for context.

Definition at line 1078 of file katehighlight.cpp.

bool KateHighlighting::attributeRequiresSpellchecking ( int  attr)

Definition at line 1083 of file katehighlight.cpp.

QList< KTextEditor::Attribute::Ptr > KateHighlighting::attributes ( const QString &  schema)

Definition at line 2172 of file katehighlight.cpp.

const QString& KateHighlighting::author ( ) const
inline

Definition at line 167 of file katehighlight.h.

bool KateHighlighting::canBreakAt ( QChar  c,
int  attrib = 0 
) const
Returns
true if the character c is a wordwrap deliminator as specified in the general keyword section of the xml file.

Definition at line 1129 of file katehighlight.cpp.

bool KateHighlighting::canComment ( int  startAttr,
int  endAttr 
) const
Returns
true if beginAttr and endAttr are members of the same highlight, and there are comment markers of either type in that.

Definition at line 1149 of file katehighlight.cpp.

const QHash< QString, QChar > & KateHighlighting::characterEncodings ( int  attrib = 0) const

Definition at line 1177 of file katehighlight.cpp.

void KateHighlighting::clearAttributeArrays ( )

Definition at line 2140 of file katehighlight.cpp.

signed char KateHighlighting::commentRegion ( int  attr) const
Returns
0 if highlighting which attr is a member of does not define a comment region, otherwise the region is returned

Definition at line 1144 of file katehighlight.cpp.

KateHlContext* KateHighlighting::contextNum ( int  n)
inline

Definition at line 275 of file katehighlight.h.

int KateHighlighting::defaultStyleForAttribute ( int  attrib) const
void KateHighlighting::doHighlight ( const Kate::TextLineData *  prevLine,
Kate::TextLineData *  textLine,
const Kate::TextLineData *  nextLine,
bool &  ctxChanged,
int  tabWidth = 0,
QVector< ContextChange > *  contextChanges = 0 
)

Parse the text and fill in the context array and folding list array.

Parameters
prevLineThe previous line, the context array is picked up from that if present.
textLineThe text line to parse
nextLineThe next line, to check if indentation changed for indentation based folding.
ctxChangedwill be set to reflect if the context changed
tabWidthtab width for indentation based folding, if wanted, else 0

check if the folding begin/ends are balanced! constructed on demand!

loop over line content!

for each end region, decrement counter for that type, erase if count reaches 0!

increment counter for each begin region!

check if folding is not balanced and we have more starts then ends then this line is a possible folding start!

possible folding start, if imbalanced, aka hash not empty!

kill hash

has the context stack changed?

try to share the simple stack that contains only 0

next try: try to share data with last line

ok, really use newly constructed stack!

compute if we increase indentation in next line

Definition at line 279 of file katehighlight.cpp.

void KateHighlighting::dropDynamicContexts ( )

Drop all dynamic contexts.

Shall be called with extreme care, and shall be immediately followed by a full HL invalidation.

Definition at line 264 of file katehighlight.cpp.

QLinkedList< QRegExp > KateHighlighting::emptyLines ( int  attribute = 0) const

Definition at line 1135 of file katehighlight.cpp.

bool KateHighlighting::foldingIndentationSensitive ( )
inline

Definition at line 407 of file katehighlight.h.

const QHash< QString, QChar > & KateHighlighting::getCharacterEncodings ( int  attrib) const

Definition at line 718 of file katehighlight.cpp.

const KatePrefixStore & KateHighlighting::getCharacterEncodingsPrefixStore ( int  attrib) const

Definition at line 723 of file katehighlight.cpp.

QString KateHighlighting::getCommentEnd ( int  attrib = 0) const
Returns
the muiltiline comment end marker for the highlight corresponding to attrib.

Definition at line 1162 of file katehighlight.cpp.

KateHighlighting::CSLPos KateHighlighting::getCommentSingleLinePosition ( int  attrib = 0) const
Returns
the single comment marker position for the highlight corresponding to attrib.

Definition at line 1172 of file katehighlight.cpp.

QString KateHighlighting::getCommentSingleLineStart ( int  attrib = 0) const
Returns
the single comment marker for the highlight corresponding to attrib.

Definition at line 1167 of file katehighlight.cpp.

QString KateHighlighting::getCommentStart ( int  attrib = 0) const
Returns
the mulitiline comment start marker for the highlight corresponding to attrib.

Definition at line 1157 of file katehighlight.cpp.

QStringList KateHighlighting::getEmbeddedHighlightingModes ( ) const

Returns a list of names of embedded modes.

Definition at line 2204 of file katehighlight.cpp.

int KateHighlighting::getEncodedCharactersInsertionPolicy ( int  attrib) const

Definition at line 733 of file katehighlight.cpp.

const QString& KateHighlighting::getIdentifier ( ) const
inline

Definition at line 169 of file katehighlight.h.

void KateHighlighting::getKateExtendedAttributeList ( const QString &  schema,
QList< KateExtendedAttribute::Ptr > &  list,
KConfig *  cfg = 0 
)

Definition at line 619 of file katehighlight.cpp.

void KateHighlighting::getKateExtendedAttributeListCopy ( const QString &  schema,
QList< KateExtendedAttribute::Ptr > &  list,
KConfig *  cfg = 0 
)

Definition at line 668 of file katehighlight.cpp.

const QHash< QChar, QString > & KateHighlighting::getReverseCharacterEncodings ( int  attrib) const

Definition at line 728 of file katehighlight.cpp.

bool KateHighlighting::hidden ( ) const
inline

Definition at line 164 of file katehighlight.h.

QString KateHighlighting::hlKeyForAttrib ( int  attrib) const

map attribute to its highlighting file.

the returned string is used as key for m_additionalData.

Definition at line 1106 of file katehighlight.cpp.

QString KateHighlighting::hlKeyForContext ( int  attrib) const

Definition at line 1092 of file katehighlight.cpp.

QString KateHighlighting::indentation ( )
inline

Definition at line 260 of file katehighlight.h.

bool KateHighlighting::isEmptyLine ( const Kate::TextLineData *  textline) const

Definition at line 2209 of file katehighlight.cpp.

bool KateHighlighting::isInWord ( QChar  c,
int  attrib = 0 
) const
Returns
true if the character c is not a deliminator character for the corresponding highlight.

Definition at line 1122 of file katehighlight.cpp.

const QString& KateHighlighting::license ( ) const
inline

Definition at line 168 of file katehighlight.h.

const QString& KateHighlighting::name ( ) const
inline

Definition at line 161 of file katehighlight.h.

const QString& KateHighlighting::nameTranslated ( ) const
inline

Definition at line 162 of file katehighlight.h.

bool KateHighlighting::noHighlighting ( ) const
inline

Definition at line 255 of file katehighlight.h.

void KateHighlighting::release ( )

Decrease the usage count, and trigger cleanup if needed.

Definition at line 759 of file katehighlight.cpp.

const QString& KateHighlighting::section ( ) const
inline

Definition at line 163 of file katehighlight.h.

void KateHighlighting::setKateExtendedAttributeList ( const QString &  schema,
QList< KateExtendedAttribute::Ptr > &  list,
KConfig *  cfg = 0,
bool  writeDefaultsToo = false 
)

Saves the attribute definitions to the config file.

Parameters
schemaThe id of the schema group to save
listQList<KateExtendedAttribute::Ptr> containing the data to be used

Definition at line 686 of file katehighlight.cpp.

const QString& KateHighlighting::style ( ) const
inline

Definition at line 166 of file katehighlight.h.

void KateHighlighting::use ( )

Increase the usage count, and trigger initialization if needed.

Definition at line 748 of file katehighlight.cpp.

const QString& KateHighlighting::version ( ) const
inline

Definition at line 165 of file katehighlight.h.


The documentation for this class was generated from the following files:
  • katehighlight.h
  • katehighlight.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:57:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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