katefactory.h

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 
00081     KParts::Part *createPartObject ( QWidget *parentWidget, const char *widgetName,
00082                                      QObject *parent, const char *name, const char *classname,
00083                                      const QStringList &args );
00084 
00089     inline KInstance *instance () { return &m_instance; };
00090 
00096     void registerDocument ( KateDocument *doc );
00097 
00102     void deregisterDocument ( KateDocument *doc );
00103 
00109     void registerView ( KateView *view );
00110 
00115     void deregisterView ( KateView *view );
00116 
00122     void registerRenderer ( KateRenderer  *renderer );
00123 
00128     void deregisterRenderer ( KateRenderer  *renderer );
00129 
00134     inline QPtrList<KateDocument> *documents () { return &m_documents; };
00135 
00140     inline QPtrList<KateView> *views () { return &m_views; };
00141 
00146     inline QPtrList<KateRenderer> *renderers () { return &m_renderers; };
00147 
00152     inline const KTrader::OfferList &plugins () { return m_plugins; };
00153 
00158     inline KDirWatch *dirWatch () { return m_dirWatch; };
00159 
00165     inline KateFileTypeManager *fileTypeManager () { return m_fileTypeManager; };
00166 
00171     inline KateSchemaManager *schemaManager () { return m_schemaManager; };
00172 
00177     inline KateDocumentConfig *documentConfig () { return m_documentConfig; }
00178 
00183     inline KateViewConfig *viewConfig () { return m_viewConfig; }
00184 
00189     inline KateRendererConfig *rendererConfig () { return m_rendererConfig; }
00190 
00195     inline KVMAllocator *vm () { return m_vm; }
00196 
00200     KateJScript *jscript ();
00201 
00205     KateJScriptManager *jscriptManager () { return m_jscriptManager; }
00206 
00207 
00212     KateIndentScript indentScript (const QString &scriptname);
00213 
00214   private:
00218     static KateFactory *s_self;
00219 
00223     KAboutData m_aboutData;
00224 
00228     KInstance m_instance;
00229 
00233     QPtrList<KateDocument> m_documents;
00234 
00238     QPtrList<KateView> m_views;
00239 
00243     QPtrList<KateRenderer> m_renderers;
00244 
00248     KDirWatch *m_dirWatch;
00249 
00253     KateFileTypeManager *m_fileTypeManager;
00254 
00258     KateSchemaManager *m_schemaManager;
00259 
00263     KTrader::OfferList m_plugins;
00264 
00268     KateDocumentConfig *m_documentConfig;
00269 
00273     KateViewConfig *m_viewConfig;
00274 
00278     KateRendererConfig *m_rendererConfig;
00279 
00283     KVMAllocator *m_vm;
00284 
00288     QValueList<Kate::Command *> m_cmds;
00289 
00293     KateJScript *m_jscript;
00294 
00295 
00299     KateJScriptManager *m_jscriptManager;
00300 
00301 
00305     QPtrList<KateIndentScriptManagerAbstract> m_indentScriptManagers;
00306 
00307 };
00308 
00309 #endif
00310 
00311 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE Home | KDE Accessibility Home | Description of Access Keys