KDevelop API Documentation

lib/interfaces/kdevcore.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001-2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> 00003 Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org> 00004 Copyright (C) 2001 Sandy Meier <smeier@kdevelop.org> 00005 Copyright (C) 2002 Daniel Engelschalt <daniel.engelschalt@gmx.net> 00006 Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> 00007 Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org> 00008 Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it> 00009 Copyright (C) 2003 Harald Fernengel <harry@kdevelop.org> 00010 Copyright (C) 2003 Hamish Rodda <rodda@kde.org> 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 /* The interface to the application core */ 00029 00030 #ifndef _KDEVCORE_H_ 00031 #define _KDEVCORE_H_ 00032 00033 #include <qstringlist.h> 00034 #include <qobject.h> 00035 00036 #include <kurl.h> 00037 00038 class KDialogBase; 00039 class KDevPlugin; 00040 class KAction; 00041 class CodeModelItem; 00042 00043 namespace KParts 00044 { 00045 class Part; 00046 } 00047 00048 class QStatusBar; 00049 class QPopupMenu; 00050 00057 class Context 00058 { 00059 public: 00066 enum 00067 { 00068 EditorContext, 00069 DocumentationContext, 00070 FileContext, 00071 CodeModelItemContext 00072 }; 00073 00077 virtual int type() const = 0; 00078 00083 bool hasType( int type ) const; 00084 00085 protected: 00089 Context(); 00090 00094 virtual ~Context(); 00095 }; 00096 00100 class EditorContext : public Context 00101 { 00102 public: 00111 EditorContext( const KURL &url, int line, int col, 00112 const QString &linestr, const QString &wordstr ); 00116 virtual ~EditorContext(); 00117 00118 virtual int type() const; 00119 00123 const KURL &url() const; 00124 00128 int line() const; 00129 00133 int col() const; 00134 00139 QString currentLine() const; 00140 00145 QString currentWord() const; 00146 00147 private: 00148 class Private; 00149 Private *d; 00150 00151 EditorContext( const EditorContext &); 00152 EditorContext &operator=( const EditorContext &); 00153 }; 00154 00155 00159 class DocumentationContext : public Context 00160 { 00161 public: 00167 DocumentationContext( const QString &url, const QString &selection ); 00171 DocumentationContext( const DocumentationContext &); 00172 DocumentationContext &operator=( const DocumentationContext &); 00173 00177 virtual ~DocumentationContext(); 00178 00179 virtual int type() const; 00180 00184 QString url() const; 00185 00189 QString selection() const; 00190 00191 private: 00192 class Private; 00193 Private *d; 00194 }; 00195 00205 class FileContext : public Context 00206 { 00207 public: 00214 FileContext( const QString &fileName, bool isDirectory ); 00219 FileContext( const KURL::List &someURLs ); 00223 virtual ~FileContext(); 00224 00225 virtual int type() const; 00226 00233 QString fileName() const; 00240 bool isDirectory() const; 00241 00242 /* 00243 * Returns a reference to the bunch of URLs 00244 */ 00245 const KURL::List &urls() const; 00246 00247 private: 00248 class Private; 00249 Private *d; 00250 00251 FileContext( const FileContext &); 00252 FileContext &operator=( const FileContext &); 00253 }; 00254 00258 class CodeModelItemContext : public Context 00259 { 00260 public: 00265 CodeModelItemContext( const CodeModelItem* item ); 00266 00270 virtual ~CodeModelItemContext(); 00271 00272 virtual int type() const; 00273 00277 const CodeModelItem* item() const; 00278 00279 private: 00280 class Private; 00281 Private *d; 00282 00283 CodeModelItemContext( const CodeModelItemContext &); 00284 CodeModelItemContext &operator=( const CodeModelItemContext &); 00285 }; 00286 00293 class KDevCore : public QObject 00294 { 00295 Q_OBJECT 00296 00297 public: 00302 enum Embedding { Replace, SplitHorizontal, SplitVertical }; 00303 00309 KDevCore( QObject *parent=0, const char *name=0 ); 00310 00314 virtual ~KDevCore(); 00315 00319 virtual void insertNewAction( KAction* action ) = 0; 00320 00329 virtual void fillContextMenu(QPopupMenu *popup, const Context *context) = 0; 00330 00334 virtual void openProject( const QString& projectFileName ) = 0; 00335 00341 virtual void running( KDevPlugin *which, bool runs ) = 0; 00342 00343 signals: 00344 00349 void coreInitialized(); 00353 void projectOpened(); 00357 void projectClosed(); 00358 00362 void languageChanged(); 00363 00368 void stopButtonClicked( KDevPlugin *which ); 00376 void contextMenu( QPopupMenu *popupMenu, const Context *context ); 00382 void configWidget( KDialogBase *dlg ); 00388 void projectConfigWidget( KDialogBase *dlg ); 00389 }; 00390 00391 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:01:48 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003