Kate
katemodemanager.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef KATE_MODEMANAGER_H__ 00020 #define KATE_MODEMANAGER_H__ 00021 00022 #include <QtCore/QStringList> 00023 #include <QtCore/QPointer> 00024 #include <QtCore/QHash> 00025 00026 #include "katedialogs.h" 00027 00028 class KateDocument; 00029 00030 class KateFileType 00031 { 00032 public: 00033 int number; 00034 QString name; 00035 QString section; 00036 QStringList wildcards; 00037 QStringList mimetypes; 00038 int priority; 00039 QString varLine; 00040 QString hl; 00041 bool hlGenerated; 00042 QString version; 00043 QString indenter; 00044 00045 KateFileType() 00046 : number(-1), priority(0), hlGenerated(false) 00047 {} 00048 }; 00049 00050 class KateModeManager 00051 { 00052 public: 00053 KateModeManager (); 00054 ~KateModeManager (); 00055 00059 void update (); 00060 00061 void save (const QList<KateFileType *>& v); 00062 00067 QString fileType (KateDocument *doc); 00068 00072 const KateFileType& fileType (const QString &name) const; 00073 00077 const QList<KateFileType *>& list() const { return m_types; } 00078 00079 private: 00080 QString wildcardsFind (const QString &fileName); 00081 00082 private: 00083 QList<KateFileType *> m_types; 00084 QHash<QString, KateFileType *> m_name2Type; 00085 00086 }; 00087 00088 #endif 00089 00090 // kate: space-indent on; indent-width 2; replace-tabs on;