kate Library API Documentation

katedefaultproject.cpp

00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 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 #include "katedefaultproject.h" 00020 #include "katedefaultproject.moc" 00021 00022 #include <qfileinfo.h> 00023 #include <kgenericfactory.h> 00024 #include <kaction.h> 00025 #include <klocale.h> 00026 #include <kdebug.h> 00027 #include <kurl.h> 00028 #include <kio/netaccess.h> 00029 00030 class PluginView : public KXMLGUIClient 00031 { 00032 friend class PluginKateDefaultProject; 00033 00034 public: 00035 Kate::MainWindow *win; 00036 }; 00037 00038 K_EXPORT_COMPONENT_FACTORY( katedefaultprojectplugin, KGenericFactory<PluginKateDefaultProject>( "katedefaultproject" ) ) 00039 00040 PluginKateDefaultProject::PluginKateDefaultProject( QObject* parent, const char* name, const QStringList& ) 00041 : Kate::ProjectPlugin ( (Kate::Project *)parent, name ) 00042 { 00043 } 00044 00045 PluginKateDefaultProject::~PluginKateDefaultProject() 00046 { 00047 } 00048 00049 void PluginKateDefaultProject::addView(Kate::MainWindow *win) 00050 { 00051 // TODO: doesn't this have to be deleted? 00052 PluginView *view = new PluginView (); 00053 00054 view->setInstance (new KInstance("kate")); 00055 view->setXMLFile( "plugins/katedefaultproject/ui.rc" ); 00056 win->guiFactory()->addClient (view); 00057 view->win = win; 00058 00059 m_views.append (view); 00060 } 00061 00062 void PluginKateDefaultProject::removeView(Kate::MainWindow *win) 00063 { 00064 for (uint z=0; z < m_views.count(); z++) 00065 if (m_views.at(z)->win == win) 00066 { 00067 PluginView *view = m_views.at(z); 00068 m_views.remove (view); 00069 win->guiFactory()->removeClient (view); 00070 delete view; 00071 } 00072 }
KDE Logo
This file is part of the documentation for kate Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 13 21:47:01 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003