KDevelop API Documentation

lib/interfaces/kdevplugin.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> 00003 Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> 00004 Copyright (C) 2002 Harald Fernengel <harry@kdevelop.org> 00005 Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org> 00006 Copyright (C) 2003 Julian Rockey <linux@jrockey.com> 00007 Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org> 00008 Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se> 00009 Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it> 00010 Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net> 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Library General Public 00014 License as published by the Free Software Foundation; either 00015 version 2 of the License, or (at your option) any later version. 00016 00017 This library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 Library General Public License for more details. 00021 00022 You should have received a copy of the GNU Library General Public License 00023 along with this library; see the file COPYING.LIB. If not, write to 00024 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00025 Boston, MA 02111-1307, USA. 00026 */ 00027 00028 #include "kdevplugin.h" 00029 #include "kdevpartcontroller.h" 00030 #include "kdevapi.h" 00031 #include "kdevcore.h" 00032 #include "kdevversioncontrol.h" 00033 00034 #include <kaction.h> 00035 00036 #include <dcopclient.h> 00037 #include <qdom.h> 00038 #include <qmap.h> 00039 00040 #include <assert.h> 00041 00043 // struct KDevPlugin::Private 00045 00046 struct KDevPlugin::Private 00047 { 00048 DCOPClient *dcopClient; 00049 QCString name; 00050 QString pluginName; 00051 QString icon; 00052 }; 00053 00055 // class KDevPlugin 00057 00058 KDevPlugin::KDevPlugin( const QString& pluginName, const QString& icon, QObject *parent, const char *name) 00059 : QObject( parent, name ), d( new Private ) 00060 { 00061 assert( parent->inherits( "KDevApi" ) ); 00062 m_api = static_cast<KDevApi *>( parent ); 00063 00064 actionCollection()->setHighlightingEnabled( true ); 00065 00066 d->name = name; 00067 d->icon = icon; 00068 d->pluginName = pluginName; 00069 d->dcopClient = 0L; 00070 } 00071 00073 00074 KDevPlugin::~KDevPlugin() 00075 { 00076 delete( d->dcopClient ); 00077 delete( d ); 00078 } 00079 00081 00082 QString KDevPlugin::pluginName() const 00083 { 00084 return d->pluginName; 00085 } 00086 00088 00089 QString KDevPlugin::icon() const 00090 { 00091 return d->icon; 00092 } 00093 00095 00096 QString KDevPlugin::shortDescription() const 00097 { 00098 return QString::null; 00099 } 00100 00102 00103 QString KDevPlugin::description() const 00104 { 00105 return QString::null; 00106 } 00107 00109 00110 DCOPClient* KDevPlugin::dcopClient() const 00111 { 00112 if (!d->dcopClient) 00113 { 00114 d->dcopClient = new DCOPClient(); 00115 d->dcopClient->registerAs(d->name, false); 00116 } 00117 00118 return d->dcopClient; 00119 } 00120 00122 00123 KDevMainWindow *KDevPlugin::mainWindow() 00124 { 00125 return m_api->mainWindow(); 00126 } 00127 00129 00130 bool KDevPlugin::mainWindowValid() 00131 { 00132 return m_api->mainWindowValid(); 00133 } 00134 00136 00137 KDevCore *KDevPlugin::core() const 00138 { 00139 return m_api->core(); 00140 } 00141 00143 00144 KDevProject *KDevPlugin::project() const 00145 { 00146 return m_api->project(); 00147 } 00148 00150 00151 CodeModel *KDevPlugin::codeModel() const 00152 { 00153 return m_api->codeModel(); 00154 } 00155 00157 00158 QDomDocument *KDevPlugin::projectDom() const 00159 { 00160 return m_api->projectDom(); 00161 } 00162 00164 00165 KDevLanguageSupport *KDevPlugin::languageSupport() const 00166 { 00167 return m_api->languageSupport(); 00168 } 00169 00171 00172 KDevMakeFrontend *KDevPlugin::makeFrontend() const 00173 { 00174 return m_api->makeFrontend(); 00175 } 00176 00178 00179 KDevDiffFrontend *KDevPlugin::diffFrontend() const 00180 { 00181 return m_api->diffFrontend(); 00182 } 00183 00185 00186 KDevAppFrontend *KDevPlugin::appFrontend() const 00187 { 00188 return m_api->appFrontend(); 00189 } 00190 00192 00193 KDevPartController *KDevPlugin::partController() const 00194 { 00195 return m_api->partController(); 00196 } 00197 00199 00200 KDevDebugger *KDevPlugin::debugger() const 00201 { 00202 return m_api->debugger(); 00203 } 00204 00206 00207 KDevCreateFile *KDevPlugin::createFileSupport() const 00208 { 00209 return m_api->createFile(); 00210 } 00211 00213 00214 KDevVersionControl *KDevPlugin::versionControl() const 00215 { 00216 return m_api->versionControl(); 00217 } 00218 00220 00221 void KDevPlugin::setVersionControl( KDevVersionControl *vcsToUse ) 00222 { 00223 return m_api->setVersionControl( vcsToUse ); 00224 } 00225 00227 00228 void KDevPlugin::registerVersionControl( KDevVersionControl *vcs ) 00229 { 00230 m_api->registerVersionControl( vcs ); 00231 } 00232 00234 00235 void KDevPlugin::unregisterVersionControl( KDevVersionControl *vcs ) 00236 { 00237 m_api->unregisterVersionControl( vcs ); 00238 } 00239 00241 00242 QStringList KDevPlugin::registeredVersionControls() const 00243 { 00244 return m_api->registeredVersionControls(); 00245 } 00246 00248 00249 KDevVersionControl *KDevPlugin::versionControlByName( const QString &uid ) const 00250 { 00251 return m_api->versionControlByName( uid ); 00252 } 00253 00255 00256 void KDevPlugin::restorePartialProjectSession(const QDomElement* /*el*/) 00257 { 00258 // there's still nothing to do in the base class 00259 } 00260 00262 00263 void KDevPlugin::savePartialProjectSession(QDomElement* /*el*/) 00264 { 00265 // there's still nothing to do in the base class 00266 } 00267 00269 00270 void KDevPlugin::showPart() 00271 { 00272 if( part() ) 00273 partController()->showPart( part(), d->pluginName, shortDescription() ); 00274 } 00275 00277 00278 KDevSourceFormatter * KDevPlugin::sourceFormatter( ) const 00279 { 00280 return m_api->sourceFormatter(); 00281 } 00282 00284 00285 KDevCodeRepository * KDevPlugin::codeRepository( ) const 00286 { 00287 return m_api->codeRepository(); 00288 } 00289 00290 #include "kdevplugin.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:08 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003