lib/interfaces/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 <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
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
This file is part of the documentation for KDevelop Version 3.0.4.