kate Library API Documentation

katesyntaxdocument.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00003    Copyright (C) 2000 Scott Manson <sdmanson@alltel.net>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef _KATE_SYNTAXDOCUMENT_H_
00021 #define _KATE_SYNTAXDOCUMENT_H_
00022 
00023 //BEGING INCLUDES
00024 #include <qdom.h>
00025 #include <qptrlist.h>
00026 #include <qstringlist.h>
00027 //END INCLUDES
00028 
00031 class syntaxModeListItem{
00032   public:
00033     QString name;
00034     QString section;
00035     QString mimetype;
00036     QString extension;
00037     QString identifier;
00038     QString version;
00039     QString priority;
00040 };
00041 
00044 typedef QPtrList<syntaxModeListItem> SyntaxModeList;
00045 
00048 class syntaxContextData{
00049   public:
00050     QDomElement parent;
00051     QDomElement currentGroup;
00052     QDomElement item;
00053 };
00054 
00057 class SyntaxDocument : public QDomDocument
00058 {
00059   public:
00064     SyntaxDocument(bool force = false);
00065 
00069     ~SyntaxDocument();
00070 
00075     bool setIdentifier(const QString& identifier);
00076 
00080     SyntaxModeList modeList();
00081 
00085     bool nextGroup(syntaxContextData* data);
00086 
00090     bool nextItem(syntaxContextData* data);
00091 
00095     QString groupItemData(const syntaxContextData* data,const QString& name);
00096     QString groupData(const syntaxContextData* data,const QString& name);
00097 
00098     void freeGroupInfo(syntaxContextData* data);
00099     syntaxContextData* getSubItems(syntaxContextData* data);
00100 
00105     syntaxContextData* getConfig(const QString& mainGroupName, const QString &config);
00106 
00111     syntaxContextData* getGroupInfo(const QString& mainGroupName, const QString &group);
00112 
00116     QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true);
00117 
00118 
00119   private:
00124     void setupModeList(bool force);
00125 
00130     bool getElement (QDomElement &element, const QString &mainGroupName, const QString &config);
00131 
00135     SyntaxModeList myModeList;
00136 
00137     QString currentFile;
00138     QStringList m_data;
00139 };
00140 
00141 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun May 16 22:07:08 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003