kate
kateapp.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org> 00003 Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef __KATE_APP_H__ 00021 #define __KATE_APP_H__ 00022 00023 #include "katemain.h" 00024 00025 #include <kapplication.h> 00026 00027 #include <qvaluelist.h> 00028 00029 class KateSessionManager; 00030 class KateAppDCOPIface; 00031 00032 namespace Kate { 00033 class Application; 00034 } 00035 00036 class KCmdLineArgs; 00037 00042 class KDE_EXPORT KateApp : public KApplication 00043 { 00044 Q_OBJECT 00045 00049 public: 00054 KateApp (KCmdLineArgs *args); 00055 00059 ~KateApp (); 00060 00065 static KateApp *self (); 00066 00071 Kate::Application *application (); 00072 00078 static QString kateVersion (bool fullVersion = true); 00079 00083 private: 00087 void restoreKate (); 00088 00093 bool startupKate (); 00094 00098 public: 00103 void shutdownKate (KateMainWindow *win); 00104 00109 bool shouldExit () { return m_shouldExit; } 00110 00114 public: 00119 KatePluginManager *pluginManager(); 00120 00125 KateDocManager *documentManager (); 00126 00131 KateSessionManager *sessionManager (); 00132 00136 public: 00143 KateMainWindow *newMainWindow (KConfig *sconfig = 0, const QString &sgroup = ""); 00144 00149 void removeMainWindow (KateMainWindow *mainWindow); 00150 00156 KateMainWindow *activeMainWindow (); 00157 00162 uint mainWindows () const; 00163 00169 KateMainWindow *mainWindow (uint n); 00170 00174 public: 00183 bool openURL (const KURL &url, const QString &encoding, bool isTempFile ); 00184 00191 bool setCursor (int line, int column); 00192 00199 bool openInput (const QString &text); 00200 00201 private: 00205 KCmdLineArgs *m_args; 00206 00210 Kate::Application *m_application; 00211 00215 KateDocManager *m_docManager; 00216 00220 KatePluginManager *m_pluginManager; 00221 00225 KateSessionManager *m_sessionManager; 00226 00230 QValueList<KateMainWindow*> m_mainWindows; 00231 00235 KateAppDCOPIface *m_obj; 00236 00240 bool m_shouldExit; 00241 }; 00242 00243 #endif