00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef __kate_app_h__
00021
#define __kate_app_h__
00022
00023
#include "katemain.h"
00024
#include "../interfaces/application.h"
00025
#include "../interfaces/mainwindow.h"
00026
#include "../interfaces/documentmanager.h"
00027
#include "../interfaces/viewmanager.h"
00028
#include "../interfaces/plugin.h"
00029
#include <qptrlist.h>
00030
00031
#include "katemainwindow.h"
00032
#include "katedocmanager.h"
00033
#include "kateprojectmanager.h"
00034
#include "katepluginmanager.h"
00035
00036
#include <kuniqueapplication.h>
00037
00038
class KateApp :
public KUniqueApplication
00039 {
00040 Q_OBJECT
00041
00042
public:
00043 KateApp (
bool forcedNewProcess,
bool oldState);
00044 ~KateApp ();
00045
00046
Kate::Application *
application () {
return m_application; };
00047
00048
public:
00049
int newInstance();
00050
00051 KatePluginManager *katePluginManager() {
return m_pluginManager; };
00052 KateDocManager *kateDocumentManager () {
return m_docManager; };
00053
00054
class KateMainWindow *newMainWindow ();
00055
class KateMainWindow *newMainWindow (
bool visible);
00056
00057
void removeMainWindow (KateMainWindow *mainWindow);
00058
00059
void raiseCurrentMainWindow ();
00060
00061
Kate::DocumentManager *
documentManager () {
return m_docManager->documentManager(); };
00062
Kate::ProjectManager *
projectManager () {
return m_projectManager->projectManager(); };
00063
Kate::PluginManager *pluginManager () {
return m_pluginManager->pluginManager(); };
00064 Kate::InitPluginManager *initPluginManager () {
return m_initPluginManager; };
00065 Kate::MainWindow *activeMainWindow ();
00066 KateMainWindow *activeKateMainWindow ();
00067
00068 uint mainWindows () {
return m_mainWindows.count(); };
00069 Kate::MainWindow *mainWindow (uint n) {
if (m_mainWindows.at(n))
return m_mainWindows.at(n)->mainWindow();
else return 0; }
00070
00071 KateMainWindow *kateMainWindow (uint n) {
return m_mainWindows.at(n); }
00072
00073
void openURL (
const QString &name=0L);
00074
00075
virtual void performInit(
const QString &,
const KURL &);
00076
virtual Kate::InitPlugin *initPlugin() const;
00077 virtual KURL initScript() const;
00078
00079 static KConfig *kateSessionConfig () {
return m_sessionConfig; }
00080
00081 signals:
00082
void onEventLoopEnter();
00083
00084
private:
00085
Kate::Application *m_application;
00086 Kate::InitPluginManager *m_initPluginManager;
00087 KateDocManager *m_docManager;
00088 KateProjectManager *m_projectManager;
00089 KatePluginManager *m_pluginManager;
00090 QPtrList<class KateMainWindow> m_mainWindows;
00091
bool m_firstStart;
00092 Kate::InitPlugin *m_initPlugin;
00093
int m_doNotInitialize;
00094 KURL m_initURL;
00095 QString m_initLib;
00096 QString m_oldInitLib;
00097
class KateAppDCOPIface *m_obj;
00098 KMdi::MdiMode m_restoreGUIMode;
00099
static KConfig *m_sessionConfig;
00100
bool m_sessionConfigDelete;
00101
00102
protected slots:
00103
void performInit();
00104
void callOnEventLoopEnter();
00105 };
00106
00107
#endif