KDevelop API Documentation

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 <qdict.h>
00035 #include <qobject.h>
00036 
00037 #include <kurl.h>
00038 
00039 class KDialogBase;
00040 class KDevPlugin;
00041 class KDevLicense;
00042 class KAction;
00043 class CodeModelItem;
00044 
00045 namespace KParts
00046 {
00047     class Part;
00048 }
00049 
00050 class QStatusBar;
00051 class QPopupMenu;
00052 
00059 class Context
00060 {
00061 public:
00068     enum 
00069     { 
00070     EditorContext, 
00071     DocumentationContext, 
00072     FileContext,
00073     CodeModelItemContext
00074     };
00075 
00079     virtual int type() const = 0;
00080 
00085     bool hasType( int type ) const;
00086 
00087 protected:
00091     Context();
00092 
00096     virtual ~Context();
00097 };
00098 
00102 class EditorContext : public Context
00103 {
00104 public:
00113     EditorContext( const KURL &url, int line, int col,
00114         const QString &linestr, const QString &wordstr );
00118     virtual ~EditorContext();
00119 
00120     virtual int type() const;
00121 
00125     const KURL &url() const;
00126 
00130     int line() const;
00131 
00135     int col() const;
00136 
00141     QString currentLine() const;
00142 
00147     QString currentWord() const;
00148 
00149 private:
00150     class Private;
00151     Private *d;
00152 
00153     EditorContext( const EditorContext &);
00154     EditorContext &operator=( const EditorContext &);
00155 };
00156 
00157 
00161 class DocumentationContext : public Context
00162 {
00163 public:
00169     DocumentationContext( const QString &url, const QString &selection );
00173     DocumentationContext( const DocumentationContext &);
00174     DocumentationContext &operator=( const DocumentationContext &);
00175 
00179     virtual ~DocumentationContext();
00180 
00181     virtual int type() const;
00182 
00186     QString url() const;
00187 
00191     QString selection() const;
00192 
00193 private:
00194     class Private;
00195     Private *d;
00196 };
00197 
00207 class FileContext : public Context
00208 {
00209 public:
00216     FileContext( const QString &fileName, bool isDirectory );
00221     FileContext( const KURL::List &someURLs );
00225     virtual ~FileContext();
00226 
00227     virtual int type() const;
00228 
00235     QString fileName() const;
00242     bool isDirectory() const;
00243 
00244     /*
00245     * Returns a reference to the bunch of URLs
00246     */
00247     const KURL::List &urls() const;
00248 
00249 private:
00250     class Private;
00251     Private *d;
00252 
00253     FileContext( const FileContext &);
00254     FileContext &operator=( const FileContext &);
00255 };
00256 
00260 class CodeModelItemContext : public Context
00261 {
00262 public:
00267     CodeModelItemContext( const CodeModelItem* item );
00268 
00272     virtual ~CodeModelItemContext();
00273 
00274     virtual int type() const;
00275 
00279     const CodeModelItem* item() const;
00280 
00281 private:
00282     class Private;
00283     Private *d;
00284 
00285     CodeModelItemContext( const CodeModelItemContext &);
00286     CodeModelItemContext &operator=( const CodeModelItemContext &);
00287 };
00288 
00295 class KDevCore : public QObject
00296 {
00297     Q_OBJECT
00298 
00299 public:
00304     enum Embedding { Replace, SplitHorizontal, SplitVertical };
00305 
00311     KDevCore( QObject *parent=0, const char *name=0 );
00312 
00316     virtual ~KDevCore();
00317 
00321     virtual void insertNewAction( KAction* action ) = 0;
00322 
00331     virtual void fillContextMenu(QPopupMenu *popup, const Context *context) = 0;
00332 
00336     virtual void openProject( const QString& projectFileName ) = 0;
00337 
00343     virtual void running( KDevPlugin *which, bool runs ) = 0;
00344 
00348     virtual QDict< KDevLicense > licenses() = 0;
00349     
00350 signals:
00351 
00356     void coreInitialized();
00360     void projectOpened();
00364     void projectClosed();
00365 
00369     void languageChanged();
00370 
00375     void stopButtonClicked( KDevPlugin *which );
00383     void contextMenu( QPopupMenu *popupMenu, const Context *context );
00389     void configWidget( KDialogBase *dlg );
00395     void projectConfigWidget( KDialogBase *dlg );
00396 };
00397 
00398 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:36 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003