kate Library API Documentation

kateprojectmanager.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 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., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, USA.
00017 */
00018 
00019 #ifndef __KATE_PROJECTMANAGER_H__
00020 #define __KATE_PROJECTMANAGER_H__
00021 
00022 #include "katemain.h"
00023 #include "../interfaces/project.h"
00024 #include "../interfaces/projectmanager.h"
00025 
00026 #include <qobject.h>
00027 #include <qvaluelist.h>
00028 #include <qptrlist.h>
00029 #include <qstringlist.h>
00030 #include <ktrader.h>
00031 #include <qguardedptr.h>
00032 #include <kdialogbase.h>
00033 
00034 class KComboBox;
00035 class KLineEdit;
00036 class KURLRequester;
00037 
00038 class KateInternalProjectData
00039 {
00040   public:
00041     class KateProjectManager *proMan;
00042     QString fileName;
00043 };
00044 
00045 class ProjectPluginInfo
00046 {
00047   public:
00048     KService::Ptr service;
00049     QString projectType;
00050 };
00051 
00052 class ProjectInfo
00053 {
00054   public:
00055     QString type;
00056     QString name;
00057     QString fileName;
00058 };
00059 
00060 typedef QPtrList<ProjectPluginInfo> ProjectPluginList;
00061 
00062 class KateProjectManager : public QObject
00063 {
00064   Q_OBJECT
00065 
00066   public:
00067     KateProjectManager(QObject *parent);
00068     ~KateProjectManager();
00069 
00070     Kate::ProjectManager *projectManager ()const { return m_projectManager; };
00071 
00072     Kate::Project *create (const QString &type, const QString &name, const QString &filename);
00073 
00074     Kate::Project *open (const QString &filename);
00075 
00076     bool close (Kate::Project *project, bool force = false);
00077 
00078     Kate::Project *project (uint n = 0);
00079 
00080     uint projects ();
00081 
00082     Kate::ProjectPlugin *createPlugin (Kate::Project *project);
00083 
00084     void enableProjectGUI (Kate::Project *project, class KateMainWindow *win);
00085     void disableProjectGUI (Kate::Project *project, class KateMainWindow *win);
00086 
00087     ProjectInfo *newProjectDialog (QWidget *parent);
00088 
00089     QStringList pluginStringList ();
00090 
00091     void setCurrentProject (Kate::Project *project);
00092 
00093     bool queryCloseAll ();
00094     bool closeAll ();
00095 
00096     void saveProjectList (class KConfig *config);
00097     void restoreProjectList (class KConfig *config);
00098 
00099   private:
00100     Kate::ProjectManager *m_projectManager;
00101 
00102     void setupPluginList ();
00103 
00104     ProjectPluginList m_pluginList;
00105 
00106     // INTERNAL USE OF KateProject !!!
00107     QPtrList<Kate::Project> m_projects;
00108     QGuardedPtr<Kate::Project> m_currentProject;
00109 };
00110 
00111 class KateProjectDialogNew : public KDialogBase
00112 {
00113     Q_OBJECT
00114   public:
00115     KateProjectDialogNew (QWidget *parent, KateProjectManager *projectMan);
00116     ~KateProjectDialogNew ();
00117 
00118     int exec();
00119 
00120 private slots:
00121     void slotTextChanged();
00122 
00123   private:
00124     KateProjectManager *m_projectMan;
00125 
00126     KComboBox *m_typeCombo;
00127     KLineEdit *m_nameEdit;
00128     KURLRequester *m_urlRequester;
00129 
00130   public:
00131     QString type;
00132     QString name;
00133     QString fileName;
00134 };
00135 
00136 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 8 02:43:14 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003