Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katesyntaxdocument.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katesyntaxdocument.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h new file mode 100644 index 0000000..5c5c5a4 --- a/dev/null +++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /*************************************************************************** | ||
2 | katesyntaxdocument.h - description | ||
3 | ------------------- | ||
4 | begin : Sat 31 March 2001 | ||
5 | copyright : (C) 2001,2002 by Joseph Wenninger | ||
6 | email : jowenn@kde.org | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #ifndef SYNTAXDOCUMENT_H | ||
19 | #define SYNTAXDOCUMENT_H | ||
20 | |||
21 | #include <opie/xmltree.h> | ||
22 | #include <qlist.h> | ||
23 | #include <qstringlist.h> | ||
24 | |||
25 | |||
26 | class syntaxModeListItem | ||
27 | { | ||
28 | public: | ||
29 | QString name; | ||
30 | QString section; | ||
31 | QString mimetype; | ||
32 | QString extension; | ||
33 | QString identifier; | ||
34 | }; | ||
35 | |||
36 | class syntaxContextData | ||
37 | { | ||
38 | public: | ||
39 | Opie::XMLElement *parent; | ||
40 | Opie::XMLElement *currentGroup; | ||
41 | Opie::XMLElement *item; | ||
42 | }; | ||
43 | |||
44 | typedef QList<syntaxModeListItem> SyntaxModeList; | ||
45 | |||
46 | class SyntaxDocument | ||
47 | { | ||
48 | public: | ||
49 | SyntaxDocument(); | ||
50 | ~SyntaxDocument(); | ||
51 | |||
52 | QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true); | ||
53 | SyntaxModeList modeList(); | ||
54 | |||
55 | syntaxContextData* getGroupInfo(const QString& langName, const QString &group); | ||
56 | void freeGroupInfo(syntaxContextData* data); | ||
57 | syntaxContextData* getConfig(const QString& mainGroupName, const QString &Config); | ||
58 | bool nextItem(syntaxContextData* data); | ||
59 | bool nextGroup(syntaxContextData* data); | ||
60 | syntaxContextData* getSubItems(syntaxContextData* data); | ||
61 | QString groupItemData(syntaxContextData* data,QString name); | ||
62 | QString groupData(syntaxContextData* data,QString name); | ||
63 | void setIdentifier(const QString& identifier); | ||
64 | |||
65 | private: | ||
66 | Opie::XMLElement *m_root; | ||
67 | void setupModeList(bool force=false); | ||
68 | QString currentFile; | ||
69 | SyntaxModeList myModeList; | ||
70 | QStringList m_data; | ||
71 | }; | ||
72 | |||
73 | #endif | ||