kdevcore.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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
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
This file is part of the documentation for KDevelop Version 3.1.2.