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

KTextEditor

  • kde-4.14
  • applications
  • kate
  • 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 
33 //
34 // TODO: KDE5
35 // The highlight information depends on the chosen Schema.
36 // Currently, each view can have a different Schema.
37 // Thus, for KDE5, this interface should be a view_extension and not a document_extension.
38 // Discussed by: Milian, Dominik
39 //
40 
72 class KTEXTEDITOR_EXPORT HighlightInterface
73 {
74  public:
76  enum DefaultStyle {
77  dsNormal,
78  dsKeyword,
79  dsDataType,
80  dsDecVal,
81  dsBaseN,
82  dsFloat,
83  dsChar,
84  dsString,
85  dsComment,
86  dsOthers,
87  dsAlert,
88  dsFunction,
89  dsRegionMarker,
90  dsError
91  };
92 
96  HighlightInterface();
97 
101  virtual ~HighlightInterface();
102 
106  virtual Attribute::Ptr defaultStyle(const DefaultStyle ds) const = 0;
107 
114  struct AttributeBlock {
115  AttributeBlock(const int _start, const int _length, const Attribute::Ptr & _attribute)
116  : start(_start), length(_length), attribute(_attribute)
117  {
118  }
120  int start;
122  int length;
124  Attribute::Ptr attribute;
125  };
126 
132  virtual QList<AttributeBlock> lineAttributes(const unsigned int line) = 0;
133 
146  virtual QStringList embeddedHighlightingModes() const = 0;
147 
159  virtual QString highlightingModeAt(const Cursor &position) = 0;
160 };
161 
162 }
163 
164 Q_DECLARE_INTERFACE(KTextEditor::HighlightInterface, "org.kde.KTextEditor.HighlightInterface")
165 
166 #endif // KDELIBS_KTEXTEDITOR_HIGHLIGHTINTERFACE_H
167 
168 // kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::HighlightInterface::dsBaseN
Definition: highlightinterface.h:81
KTextEditor::HighlightInterface::AttributeBlock::AttributeBlock
AttributeBlock(const int _start, const int _length, const Attribute::Ptr &_attribute)
Definition: highlightinterface.h:115
KTextEditor::HighlightInterface::dsFunction
Definition: highlightinterface.h:88
KTextEditor::HighlightInterface::dsFloat
Definition: highlightinterface.h:82
cursor.h
KTextEditor::HighlightInterface::dsDataType
Definition: highlightinterface.h:79
KTextEditor::HighlightInterface::dsNormal
Definition: highlightinterface.h:77
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:55
attribute.h
ktexteditor_export.h
KTextEditor::Attribute::Ptr
KSharedPtr< Attribute > Ptr
Definition: attribute.h:61
KTextEditor::HighlightInterface::dsOthers
Definition: highlightinterface.h:86
KTextEditor::HighlightInterface::dsDecVal
Definition: highlightinterface.h:80
KTEXTEDITOR_EXPORT
#define KTEXTEDITOR_EXPORT
Definition: ktexteditor_export.h:35
QString
QList
QStringList
KTextEditor::HighlightInterface::AttributeBlock::start
int start
The column this attribute starts at.
Definition: highlightinterface.h:120
KTextEditor::HighlightInterface
Highlighting information interface for the Document.
Definition: highlightinterface.h:72
KTextEditor::HighlightInterface::AttributeBlock::length
int length
The number of columns this attribute spans.
Definition: highlightinterface.h:122
KTextEditor::HighlightInterface::DefaultStyle
DefaultStyle
TODO: Documentation.
Definition: highlightinterface.h:76
KTextEditor::HighlightInterface::dsRegionMarker
Definition: highlightinterface.h:89
KTextEditor::HighlightInterface::dsAlert
Definition: highlightinterface.h:87
KTextEditor::HighlightInterface::dsString
Definition: highlightinterface.h:84
KTextEditor::HighlightInterface::dsKeyword
Definition: highlightinterface.h:78
KTextEditor::HighlightInterface::AttributeBlock
An AttributeBlock represents an Attribute with its dimension in a given line.
Definition: highlightinterface.h:114
KTextEditor::HighlightInterface::dsComment
Definition: highlightinterface.h:85
KTextEditor::HighlightInterface::AttributeBlock::attribute
Attribute::Ptr attribute
The attribute for the current range.
Definition: highlightinterface.h:124
KTextEditor::HighlightInterface::dsChar
Definition: highlightinterface.h:83
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