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

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • syntax
katesyntaxdocument.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
3  Copyright (C) 2000 Scott Manson <sdmanson@alltel.net>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
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 __KATE_SYNTAXDOCUMENT_H__
21 #define __KATE_SYNTAXDOCUMENT_H__
22 
23 #include <QtCore/QList>
24 #include <QtCore/QStringList>
25 #include <QtXml/QDomDocument>
26 
27 class KConfig;
28 
34 class KateSyntaxModeListItem
35 {
36  public:
37  QString name;
38  QString nameTranslated;
39  QString section;
40  QString mimetype;
41  QString extension;
42  QString identifier;
43  QString version;
44  QString priority;
47  QString style;
48  QString author;
49  QString license;
50  QString indenter;
51  bool hidden;
52 };
53 
57 typedef QList<KateSyntaxModeListItem*> KateSyntaxModeList;
58 
62 class KateSyntaxContextData
63 {
64  public:
65  QDomElement parent;
66  QDomElement currentGroup;
67  QDomElement item;
68 };
69 
73 class KateSyntaxDocument : public QDomDocument
74 {
75  public:
81  explicit KateSyntaxDocument(KConfig *config, bool force = false);
82 
86  ~KateSyntaxDocument();
87 
94  bool setIdentifier(const QString& identifier);
95 
100  const KateSyntaxModeList &modeList() { return myModeList; }
101 
107  bool nextGroup(KateSyntaxContextData* data);
108 
114  bool nextItem(KateSyntaxContextData* data);
115 
119  QString groupItemData(const KateSyntaxContextData* data,const QString& name);
120  QString groupData(const KateSyntaxContextData* data,const QString& name);
121 
122  void freeGroupInfo(KateSyntaxContextData* data);
123  KateSyntaxContextData* getSubItems(KateSyntaxContextData* data);
124 
129  KateSyntaxContextData* getConfig(const QString& mainGroupName, const QString &config);
130 
135  KateSyntaxContextData* getGroupInfo(const QString& mainGroupName, const QString &group);
136 
140  QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true);
141 
142  private:
147  void setupModeList(bool force);
148 
153  bool getElement (QDomElement &element, const QString &mainGroupName, const QString &config);
154 
158  KateSyntaxModeList myModeList;
159 
163  QString currentFile;
164 
168  QStringList m_data;
169 
173  KConfig *m_config;
174 };
175 
176 #endif
177 
178 // kate: space-indent on; indent-width 2; replace-tabs on;
KateSyntaxDocument::freeGroupInfo
void freeGroupInfo(KateSyntaxContextData *data)
Definition: katesyntaxdocument.cpp:196
KateSyntaxDocument::getSubItems
KateSyntaxContextData * getSubItems(KateSyntaxContextData *data)
Definition: katesyntaxdocument.cpp:201
KateSyntaxModeListItem::style
QString style
Default styles provided by the highlighter.
Definition: katesyntaxdocument.h:47
KateSyntaxModeListItem::section
QString section
Submenu section (eg. Assembly)
Definition: katesyntaxdocument.h:39
KateSyntaxModeListItem::hidden
bool hidden
Hides the mode from Kate's menus.
Definition: katesyntaxdocument.h:51
KateSyntaxModeListItem::mimetype
QString mimetype
Mimetypes this mode applies to.
Definition: katesyntaxdocument.h:40
KateSyntaxDocument::KateSyntaxDocument
KateSyntaxDocument(KConfig *config, bool force=false)
Constructor Sets the current file to nothing and build the ModeList (katesyntaxhighlightingrc) ...
Definition: katesyntaxdocument.cpp:41
KateSyntaxDocument::nextGroup
bool nextGroup(KateSyntaxContextData *data)
Jump to the next group, KateSyntaxContextData::currentGroup will point to the next group...
Definition: katesyntaxdocument.cpp:102
KateSyntaxModeListItem::version
QString version
Definition: katesyntaxdocument.h:43
KateSyntaxModeListItem::nameTranslated
QString nameTranslated
i18n of same, for display purposes
Definition: katesyntaxdocument.h:38
KateSyntaxModeListItem::priority
QString priority
Priority (mapped to an integer?) for conflict- resolution when the same file extension has multiple h...
Definition: katesyntaxdocument.h:44
KateSyntaxDocument::~KateSyntaxDocument
~KateSyntaxDocument()
Desctructor.
Definition: katesyntaxdocument.cpp:49
KateSyntaxDocument::groupData
QString groupData(const KateSyntaxContextData *data, const QString &name)
Definition: katesyntaxdocument.cpp:181
KateSyntaxDocument::nextItem
bool nextItem(KateSyntaxContextData *data)
Jump to the next item, KateSyntaxContextData::item will point to the next item.
Definition: katesyntaxdocument.cpp:133
KateSyntaxDocument::modeList
const KateSyntaxModeList & modeList()
Get the mode list.
Definition: katesyntaxdocument.h:100
KateSyntaxDocument::getConfig
KateSyntaxContextData * getConfig(const QString &mainGroupName, const QString &config)
Get the KateSyntaxContextData of the DomElement Config inside mainGroupName It just fills KateSyntaxC...
Definition: katesyntaxdocument.cpp:262
KateSyntaxContextData::parent
QDomElement parent
Definition: katesyntaxdocument.h:65
KateSyntaxDocument
Store and manage the information about Syntax Highlighting.
Definition: katesyntaxdocument.h:73
KateSyntaxModeListItem::author
QString author
Author's name.
Definition: katesyntaxdocument.h:48
KateSyntaxDocument::finddata
QStringList & finddata(const QString &mainGroup, const QString &type, bool clearList=true)
Returns a list with all the keywords inside the list type.
Definition: katesyntaxdocument.cpp:293
QString
QList< KateSyntaxModeListItem * >
QStringList
QDomDocument
KateSyntaxModeListItem::identifier
QString identifier
Definition: katesyntaxdocument.h:42
KateSyntaxDocument::setIdentifier
bool setIdentifier(const QString &identifier)
If the open hl file is different from the one needed, it opens the new one and assign some other thin...
Definition: katesyntaxdocument.cpp:59
KateSyntaxContextData::currentGroup
QDomElement currentGroup
Definition: katesyntaxdocument.h:66
KateSyntaxModeListItem
Information about each syntax hl Mode.
Definition: katesyntaxdocument.h:34
KateSyntaxModeListItem::extension
QString extension
Semicolon-separated list of file extensions.
Definition: katesyntaxdocument.h:41
KateSyntaxModeListItem::indenter
QString indenter
Indenter to use for this highlighting.
Definition: katesyntaxdocument.h:50
KateSyntaxModeList
QList< KateSyntaxModeListItem * > KateSyntaxModeList
List of the KateSyntaxModeListItems holding all the syntax mode list items.
Definition: katesyntaxdocument.h:57
QDomElement
KateSyntaxContextData::item
QDomElement item
Definition: katesyntaxdocument.h:67
KateSyntaxContextData
Class holding the data around the current QDomElement.
Definition: katesyntaxdocument.h:62
KateSyntaxModeListItem::name
QString name
Name of the mode (eg. Asm6502)
Definition: katesyntaxdocument.h:37
KateSyntaxModeListItem::license
QString license
License; for example: "LGPL".
Definition: katesyntaxdocument.h:49
KateSyntaxDocument::getGroupInfo
KateSyntaxContextData * getGroupInfo(const QString &mainGroupName, const QString &group)
Get the KateSyntaxContextData of the QDomElement Config inside mainGroupName KateSyntaxContextData::p...
Definition: katesyntaxdocument.cpp:278
KateSyntaxDocument::groupItemData
QString groupItemData(const KateSyntaxContextData *data, const QString &name)
This function is used to fetch the atributes of the tags.
Definition: katesyntaxdocument.cpp:161
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 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