kate
documentmanager.cpp
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 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 #include "documentmanager.h" 00020 #include "documentmanager.moc" 00021 00022 #include "plugin.h" 00023 #include "viewmanager.h" 00024 #include "toolviewmanager.h" 00025 #include "pluginmanager.h" 00026 00027 #include "application.h" 00028 00029 #include "../app/katedocmanager.h" 00030 00031 namespace Kate 00032 { 00033 00034 class PrivateDocumentManager 00035 { 00036 public: 00037 PrivateDocumentManager () 00038 { 00039 } 00040 00041 ~PrivateDocumentManager () 00042 { 00043 } 00044 00045 KateDocManager *docMan; 00046 }; 00047 00048 DocumentManager::DocumentManager (void *documentManager) : QObject ((KateDocManager*) documentManager) 00049 { 00050 d = new PrivateDocumentManager (); 00051 d->docMan = (KateDocManager*) documentManager; 00052 } 00053 00054 DocumentManager::~DocumentManager () 00055 { 00056 delete d; 00057 } 00058 00059 Document *DocumentManager::document (uint n) 00060 { 00061 return d->docMan->document (n); 00062 } 00063 00064 Document *DocumentManager::activeDocument () 00065 { 00066 return d->docMan->activeDocument (); 00067 } 00068 00069 Document *DocumentManager::documentWithID (uint id) 00070 { 00071 return d->docMan->documentWithID (id); 00072 } 00073 00074 int DocumentManager::findDocument (const KURL &url) 00075 { 00076 return d->docMan->findDocument (url); 00077 } 00078 00079 bool DocumentManager::isOpen (const KURL &url) 00080 { 00081 return d->docMan->isOpen (url); 00082 } 00083 00084 uint DocumentManager::documents () 00085 { 00086 return d->docMan->documents (); 00087 } 00088 00089 Document *DocumentManager::openURL(const KURL&url,const QString &encoding,uint *id) 00090 { 00091 return d->docMan->openURL (url, encoding, id); 00092 } 00093 00094 bool DocumentManager::closeDocument(Document *document) 00095 { 00096 return d->docMan->closeDocument (document); 00097 } 00098 00099 bool DocumentManager::closeDocument(uint n) 00100 { 00101 return d->docMan->closeDocument (n); 00102 } 00103 00104 bool DocumentManager::closeDocumentWithID(uint id) 00105 { 00106 return d->docMan->closeDocument (id); 00107 } 00108 00109 bool DocumentManager::closeAllDocuments() 00110 { 00111 return d->docMan->closeAllDocuments (); 00112 } 00113 00114 DocumentManager *documentManager () 00115 { 00116 return application()->documentManager (); 00117 } 00118 00119 } 00120