Kate
katesyntaxmanager.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org> 00003 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org> 00004 Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef __KATE_SYNTAXMANAGER_H__ 00022 #define __KATE_SYNTAXMANAGER_H__ 00023 00024 #include "katetextline.h" 00025 #include "kateextendedattribute.h" 00026 00027 #include <ktexteditor/highlightinterface.h> 00028 00029 #include <kconfig.h> 00030 #include <kactionmenu.h> 00031 00032 #include <QtCore/QVector> 00033 #include <QtCore/QList> 00034 #include <QtCore/QHash> 00035 #include <QtCore/QMap> 00036 00037 #include <QtCore/QRegExp> 00038 #include <QtCore/QObject> 00039 #include <QtCore/QStringList> 00040 #include <QtCore/QPointer> 00041 #include <QtCore/QDate> 00042 #include <QtCore/QLinkedList> 00043 00044 class KateSyntaxDocument; 00045 class KateHighlighting; 00046 00047 00048 class KateHlManager : public QObject 00049 { 00050 Q_OBJECT 00051 00052 public: 00053 KateHlManager(); 00054 ~KateHlManager(); 00055 00056 static KateHlManager *self(); 00057 00058 KateSyntaxDocument *syntaxDocument () { return syntax; } 00059 00060 inline KConfig *getKConfig() { return &m_config; } 00061 00062 KateHighlighting *getHl(int n); 00063 int nameFind(const QString &name); 00064 00065 QString identifierForName(const QString&); 00070 QString nameForIdentifier(const QString&); 00071 00072 // methodes to get the default style count + names 00073 static uint defaultStyles(); 00074 static QString defaultStyleName(int n, bool translateNames = false); 00075 00076 void getDefaults(const QString &schema, KateAttributeList &); 00077 void setDefaults(const QString &schema, KateAttributeList &); 00078 00079 int highlights(); 00080 QString hlName(int n); 00081 QString hlNameTranslated (int n); 00082 QString hlSection(int n); 00083 bool hlHidden(int n); 00084 00085 void incDynamicCtxs() { ++dynamicCtxsCount; } 00086 int countDynamicCtxs() { return dynamicCtxsCount; } 00087 void setForceNoDCReset(bool b) { forceNoDCReset = b; } 00088 00089 // be carefull: all documents hl should be invalidated after having successfully called this method! 00090 bool resetDynamicCtxs(); 00091 00092 Q_SIGNALS: 00093 void changed(); 00094 00095 private: 00096 friend class KateHighlighting; 00097 00098 // This list owns objects it holds, thus they should be deleted when the object is removed 00099 QList<KateHighlighting*> hlList; 00100 // This hash does not own the objects it holds, thus they should not be deleted 00101 QHash<QString, KateHighlighting*> hlDict; 00102 00103 KConfig m_config; 00104 QStringList commonSuffixes; 00105 00106 KateSyntaxDocument *syntax; 00107 00108 int dynamicCtxsCount; 00109 QTime lastCtxsReset; 00110 bool forceNoDCReset; 00111 }; 00112 00113 #endif 00114 00115 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE 4.6 API Reference