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 <kconfig.h> 00028 #include <kactionmenu.h> 00029 00030 #include <QtCore/QVector> 00031 #include <QtCore/QList> 00032 #include <QtCore/QHash> 00033 #include <QtCore/QMap> 00034 00035 #include <QtCore/QRegExp> 00036 #include <QtCore/QObject> 00037 #include <QtCore/QStringList> 00038 #include <QtCore/QPointer> 00039 #include <QtCore/QDate> 00040 #include <QtCore/QLinkedList> 00041 00042 class KateSyntaxDocument; 00043 class KateHighlighting; 00044 00045 00046 class KateHlManager : public QObject 00047 { 00048 Q_OBJECT 00049 00050 public: 00051 KateHlManager(); 00052 ~KateHlManager(); 00053 00054 static KateHlManager *self(); 00055 00056 KateSyntaxDocument *syntaxDocument () { return syntax; } 00057 00058 inline KConfig *getKConfig() { return &m_config; } 00059 00060 KateHighlighting *getHl(int n); 00061 int nameFind(const QString &name); 00062 00063 QString identifierForName(const QString&); 00064 00065 // methodes to get the default style count + names 00066 static uint defaultStyles(); 00067 static QString defaultStyleName(int n, bool translateNames = false); 00068 00069 void getDefaults(const QString &schema, KateAttributeList &); 00070 void setDefaults(const QString &schema, KateAttributeList &); 00071 00072 int highlights(); 00073 QString hlName(int n); 00074 QString hlNameTranslated (int n); 00075 QString hlSection(int n); 00076 bool hlHidden(int n); 00077 00078 void incDynamicCtxs() { ++dynamicCtxsCount; } 00079 int countDynamicCtxs() { return dynamicCtxsCount; } 00080 void setForceNoDCReset(bool b) { forceNoDCReset = b; } 00081 00082 // be carefull: all documents hl should be invalidated after having successfully called this method! 00083 bool resetDynamicCtxs(); 00084 00085 Q_SIGNALS: 00086 void changed(); 00087 00088 private: 00089 friend class KateHighlighting; 00090 00091 // This list owns objects it holds, thus they should be deleted when the object is removed 00092 QList<KateHighlighting*> hlList; 00093 // This hash does not own the objects it holds, thus they should not be deleted 00094 QHash<QString, KateHighlighting*> hlDict; 00095 00096 KConfig m_config; 00097 QStringList commonSuffixes; 00098 00099 KateSyntaxDocument *syntax; 00100 00101 int dynamicCtxsCount; 00102 QTime lastCtxsReset; 00103 bool forceNoDCReset; 00104 }; 00105 00106 #endif 00107 00108 // kate: space-indent on; indent-width 2; replace-tabs on;