Kate
katefactory.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2001-2004 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_FACTORY_H__ 00020 #define __KATE_FACTORY_H__ 00021 00022 #include "katejscript.h" 00023 #include <kparts/factory.h> 00024 00025 #include <ktrader.h> 00026 #include <kinstance.h> 00027 #include <kaboutdata.h> 00028 00029 // katepart version must be a string in double quotes, format: "x.x" 00030 #define KATEPART_VERSION "2.5" 00031 00032 class KateCmd; 00033 class KateFileTypeManager; 00034 class KateSchemaManager; 00035 class KateDocumentConfig; 00036 class KateViewConfig; 00037 class KateRendererConfig; 00038 class KateDocument; 00039 class KateRenderer; 00040 class KateView; 00041 class KateJScript; 00042 class KateJScriptManager; 00043 class KateIndentScriptManagerAbstract; 00044 class KDirWatch; 00045 class KVMAllocator; 00046 00047 namespace Kate { 00048 class Command; 00049 } 00050 00051 00052 class KateFactory 00053 { 00054 private: 00058 KateFactory (); 00059 00060 public: 00064 ~KateFactory (); 00065 00070 static KateFactory *self (); 00071 00082 KParts::Part *createPartObject ( QWidget *parentWidget, const char *widgetName, 00083 QObject *parent, const char *name, const char *classname, 00084 const QStringList &args ); 00085 00090 inline KInstance *instance () { return &m_instance; }; 00091 00097 void registerDocument ( KateDocument *doc ); 00098 00103 void deregisterDocument ( KateDocument *doc ); 00104 00110 void registerView ( KateView *view ); 00111 00116 void deregisterView ( KateView *view ); 00117 00123 void registerRenderer ( KateRenderer *renderer ); 00124 00129 void deregisterRenderer ( KateRenderer *renderer ); 00130 00135 inline QPtrList<KateDocument> *documents () { return &m_documents; }; 00136 00141 inline QPtrList<KateView> *views () { return &m_views; }; 00142 00147 inline QPtrList<KateRenderer> *renderers () { return &m_renderers; }; 00148 00153 inline const KTrader::OfferList &plugins () { return m_plugins; }; 00154 00159 inline KDirWatch *dirWatch () { return m_dirWatch; }; 00160 00166 inline KateFileTypeManager *fileTypeManager () { return m_fileTypeManager; }; 00167 00172 inline KateSchemaManager *schemaManager () { return m_schemaManager; }; 00173 00178 inline KateDocumentConfig *documentConfig () { return m_documentConfig; } 00179 00184 inline KateViewConfig *viewConfig () { return m_viewConfig; } 00185 00190 inline KateRendererConfig *rendererConfig () { return m_rendererConfig; } 00191 00196 inline KVMAllocator *vm () { return m_vm; } 00197 00201 KateJScript *jscript (); 00202 00206 KateJScriptManager *jscriptManager () { return m_jscriptManager; } 00207 00208 00213 KateIndentScript indentScript (const QString &scriptname); 00214 00215 private: 00219 static KateFactory *s_self; 00220 00224 KAboutData m_aboutData; 00225 00229 KInstance m_instance; 00230 00234 QPtrList<KateDocument> m_documents; 00235 00239 QPtrList<KateView> m_views; 00240 00244 QPtrList<KateRenderer> m_renderers; 00245 00249 KDirWatch *m_dirWatch; 00250 00254 KateFileTypeManager *m_fileTypeManager; 00255 00259 KateSchemaManager *m_schemaManager; 00260 00264 KTrader::OfferList m_plugins; 00265 00269 KateDocumentConfig *m_documentConfig; 00270 00274 KateViewConfig *m_viewConfig; 00275 00279 KateRendererConfig *m_rendererConfig; 00280 00284 KVMAllocator *m_vm; 00285 00289 QValueList<Kate::Command *> m_cmds; 00290 00294 KateJScript *m_jscript; 00295 00296 00300 KateJScriptManager *m_jscriptManager; 00301 00302 00306 QPtrList<KateIndentScriptManagerAbstract> m_indentScriptManagers; 00307 00308 }; 00309 00310 #endif 00311 00312 // kate: space-indent on; indent-width 2; replace-tabs on;