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

KTextEditor

  • sources
  • kde-4.12
  • kdelibs
  • 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 
28 namespace KTextEditor
29 {
30 
31 class Document;
32 
64 class 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 
156 Q_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;
KSharedPtr< Attribute >
KTextEditor::HighlightInterface::dsBaseN
Definition: highlightinterface.h:73
KTextEditor::HighlightInterface::AttributeBlock::AttributeBlock
AttributeBlock(const int _start, const int _length, const Attribute::Ptr &_attribute)
Definition: highlightinterface.h:107
KTextEditor::HighlightInterface::dsFunction
Definition: highlightinterface.h:80
KTextEditor::HighlightInterface::dsFloat
Definition: highlightinterface.h:74
cursor.h
KTextEditor::HighlightInterface::dsDataType
Definition: highlightinterface.h:71
QString
KTextEditor::HighlightInterface::dsNormal
Definition: highlightinterface.h:69
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:61
attribute.h
ktexteditor_export.h
KTextEditor::HighlightInterface::dsOthers
Definition: highlightinterface.h:78
QStringList
KTextEditor::HighlightInterface::dsDecVal
Definition: highlightinterface.h:72
KTextEditor::HighlightInterface::AttributeBlock::start
int start
The column this attribute starts at.
Definition: highlightinterface.h:112
KTextEditor::HighlightInterface
Highlighting information interface for the Document.
Definition: highlightinterface.h:64
KTextEditor::HighlightInterface::AttributeBlock::length
int length
The number of columns this attribute spans.
Definition: highlightinterface.h:114
KTextEditor::HighlightInterface::DefaultStyle
DefaultStyle
TODO: Documentation.
Definition: highlightinterface.h:68
KTextEditor::HighlightInterface::dsRegionMarker
Definition: highlightinterface.h:81
KTextEditor::HighlightInterface::dsAlert
Definition: highlightinterface.h:79
KTextEditor::HighlightInterface::dsString
Definition: highlightinterface.h:76
KTextEditor::HighlightInterface::dsKeyword
Definition: highlightinterface.h:70
KTextEditor::HighlightInterface::AttributeBlock
An AttributeBlock represents an Attribute with its dimension in a given line.
Definition: highlightinterface.h:106
KTextEditor::HighlightInterface::dsComment
Definition: highlightinterface.h:77
KTextEditor::HighlightInterface::AttributeBlock::attribute
Attribute::Ptr attribute
The attribute for the current range.
Definition: highlightinterface.h:116
KTextEditor::HighlightInterface::dsChar
Definition: highlightinterface.h:75
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:20 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

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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