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

KTextEditor

  • interfaces
  • ktexteditor
highlightinterface.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2009 Milian Wolff <mail@milianw.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KDELIBS_KTEXTEDITOR_HIGHLIGHTINTERFACE_H
21#define KDELIBS_KTEXTEDITOR_HIGHLIGHTINTERFACE_H
22
23#include <ktexteditor/ktexteditor_export.h>
24
25#include <ktexteditor/attribute.h>
26#include <ktexteditor/cursor.h>
27
28namespace KTextEditor
29{
30
31class Document;
32
64class KTEXTEDITOR_EXPORT HighlightInterface
65{
66 public:
68 enum DefaultStyle {
69 dsNormal,
70 dsKeyword,
71 dsDataType,
72 dsDecVal,
73 dsBaseN,
74 dsFloat,
75 dsChar,
76 dsString,
77 dsComment,
78 dsOthers,
79 dsAlert,
80 dsFunction,
81 dsRegionMarker,
82 dsError
83 };
84
88 HighlightInterface();
89
93 virtual ~HighlightInterface();
94
98 virtual Attribute::Ptr defaultStyle(const DefaultStyle ds) const = 0;
99
106 struct AttributeBlock {
107 AttributeBlock(const int _start, const int _length, const Attribute::Ptr & _attribute)
108 : start(_start), length(_length), attribute(_attribute)
109 {
110 }
112 int start;
114 int length;
116 Attribute::Ptr attribute;
117 };
118
124 virtual QList<AttributeBlock> lineAttributes(const unsigned int line) = 0;
125
138 virtual QStringList embeddedHighlightingModes() const = 0;
139
151 virtual QString highlightingModeAt(const Cursor &position) = 0;
152};
153
154}
155
156Q_DECLARE_INTERFACE(KTextEditor::HighlightInterface, "org.kde.KTextEditor.HighlightInterface")
157
158#endif // KDELIBS_KTEXTEDITOR_HIGHLIGHTINTERFACE_H
159
160// kate: space-indent on; indent-width 2; replace-tabs on;
attribute.h
KSharedPtr< Attribute >
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:62
KTextEditor::HighlightInterface
Highlighting information interface for the Document.
Definition: highlightinterface.h:65
KTextEditor::HighlightInterface::embeddedHighlightingModes
virtual QStringList embeddedHighlightingModes() const =0
Get all available highlighting modes for the current document.
KTextEditor::HighlightInterface::defaultStyle
virtual Attribute::Ptr defaultStyle(const DefaultStyle ds) const =0
Returns the attribute used for the style ds.
KTextEditor::HighlightInterface::lineAttributes
virtual QList< AttributeBlock > lineAttributes(const unsigned int line)=0
Get the list of AttributeBlocks for a given line in the document.
KTextEditor::HighlightInterface::DefaultStyle
DefaultStyle
TODO: Documentation.
Definition: highlightinterface.h:68
KTextEditor::HighlightInterface::dsBaseN
@ dsBaseN
Definition: highlightinterface.h:73
KTextEditor::HighlightInterface::dsNormal
@ dsNormal
Definition: highlightinterface.h:69
KTextEditor::HighlightInterface::dsAlert
@ dsAlert
Definition: highlightinterface.h:79
KTextEditor::HighlightInterface::dsChar
@ dsChar
Definition: highlightinterface.h:75
KTextEditor::HighlightInterface::dsOthers
@ dsOthers
Definition: highlightinterface.h:78
KTextEditor::HighlightInterface::dsString
@ dsString
Definition: highlightinterface.h:76
KTextEditor::HighlightInterface::dsFunction
@ dsFunction
Definition: highlightinterface.h:80
KTextEditor::HighlightInterface::dsRegionMarker
@ dsRegionMarker
Definition: highlightinterface.h:81
KTextEditor::HighlightInterface::dsKeyword
@ dsKeyword
Definition: highlightinterface.h:70
KTextEditor::HighlightInterface::dsDecVal
@ dsDecVal
Definition: highlightinterface.h:72
KTextEditor::HighlightInterface::dsDataType
@ dsDataType
Definition: highlightinterface.h:71
KTextEditor::HighlightInterface::dsFloat
@ dsFloat
Definition: highlightinterface.h:74
KTextEditor::HighlightInterface::dsComment
@ dsComment
Definition: highlightinterface.h:77
KTextEditor::HighlightInterface::highlightingModeAt
virtual QString highlightingModeAt(const Cursor &position)=0
Get the highlight mode used at a given position in the document.
QList
cursor.h
ktexteditor_export.h
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
KTextEditor::HighlightInterface::AttributeBlock
An AttributeBlock represents an Attribute with its dimension in a given line.
Definition: highlightinterface.h:106
KTextEditor::HighlightInterface::AttributeBlock::length
int length
The number of columns this attribute spans.
Definition: highlightinterface.h:114
KTextEditor::HighlightInterface::AttributeBlock::attribute
Attribute::Ptr attribute
The attribute for the current range.
Definition: highlightinterface.h:116
KTextEditor::HighlightInterface::AttributeBlock::AttributeBlock
AttributeBlock(const int _start, const int _length, const Attribute::Ptr &_attribute)
Definition: highlightinterface.h:107
KTextEditor::HighlightInterface::AttributeBlock::start
int start
The column this attribute starts at.
Definition: highlightinterface.h:112
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
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