katesyntaxdocument.h
/* This file is part of the KDE libraries
Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
Copyright (C) 2000 Scott Manson <sdmanson@alltel.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __KATE_SYNTAXDOCUMENT_H__
#define __KATE_SYNTAXDOCUMENT_H__
#include <qdom.h>
#include <qstringlist.h>
class KateSyntaxModeListItem
{
public:
QString name;
QString nameTranslated;
QString section;
QString mimetype;
QString extension;
QString identifier;
QString version;
QString priority;
QString author;
QString license;
bool hidden;
};
typedef QValueList<KateSyntaxModeListItem*> KateSyntaxModeList;
class KateSyntaxContextData
{
public:
QDomElement parent;
QDomElement currentGroup;
QDomElement item;
};
class KateSyntaxDocument : public QDomDocument
{
public:
KateSyntaxDocument(bool force = false);
~KateSyntaxDocument();
bool setIdentifier(const QString& identifier);
const KateSyntaxModeList &modeList() { return myModeList; }
bool nextGroup(KateSyntaxContextData* data);
bool nextItem(KateSyntaxContextData* data);
QString groupItemData(const KateSyntaxContextData* data,const QString& name);
QString groupData(const KateSyntaxContextData* data,const QString& name);
void freeGroupInfo(KateSyntaxContextData* data);
KateSyntaxContextData* getSubItems(KateSyntaxContextData* data);
KateSyntaxContextData* getConfig(const QString& mainGroupName, const QString &config);
KateSyntaxContextData* getGroupInfo(const QString& mainGroupName, const QString &group);
QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true);
private:
void setupModeList(bool force);
bool getElement (QDomElement &element, const QString &mainGroupName, const QString &config);
KateSyntaxModeList myModeList;
QString currentFile;
QStringList m_data;
};
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
KateSyntaxDocument::KateSyntaxDocument
KateSyntaxDocument(bool force=false)
Constructor Sets the current file to nothing and build the ModeList (katesyntaxhighlightingrc) ...
Definition: katesyntaxdocument.cpp:34
KateSyntaxDocument::nextGroup
bool nextGroup(KateSyntaxContextData *data)
Jump to the next group, KateSyntaxContextData::currentGroup will point to the next group...
Definition: katesyntaxdocument.cpp:94
KateSyntaxDocument::~KateSyntaxDocument
~KateSyntaxDocument()
Desctructor.
Definition: katesyntaxdocument.cpp:41
KateSyntaxDocument::nextItem
bool nextItem(KateSyntaxContextData *data)
Jump to the next item, KateSyntaxContextData::item will point to the next item.
Definition: katesyntaxdocument.cpp:125
KateSyntaxDocument::modeList
const KateSyntaxModeList & modeList()
Get the mode list.
Definition: katesyntaxdocument.h:91
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:247
KateSyntaxDocument
Store and manage the information about Syntax Highlighting.
Definition: katesyntaxdocument.h:64
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:278
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:51
KateSyntaxModeListItem
Information about each syntax hl Mode.
Definition: katesyntaxdocument.h:29
KateSyntaxContextData
Class holding the data around the current QDomElement.
Definition: katesyntaxdocument.h:53
KateSyntaxDocument::getGroupInfo
KateSyntaxContextData * getGroupInfo(const QString &mainGroupName, const QString &group)
Get the KateSyntaxContextData of the QDomElement Config inside mainGroupName KateSyntaxContextData::p...
Definition: katesyntaxdocument.cpp:263
KateSyntaxDocument::groupItemData
QString groupItemData(const KateSyntaxContextData *data, const QString &name)
This function is used to fetch the atributes of the tags.
Definition: katesyntaxdocument.cpp:153

KDE Home | KDE Accessibility Home | Description of Access Keys