00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifndef __ktexteditor_codecompletioninterface_h__
00020
#define __ktexteditor_codecompletioninterface_h__
00021
00022
#include <qstring.h>
00023
#include <qstringlist.h>
00024
00025
#include <kdelibs_export.h>
00026
00027
namespace KTextEditor
00028 {
00029
00042 class KTEXTEDITOR_EXPORT CompletionEntry
00043 {
00044
public:
00045
QString type;
00046
QString text;
00047
QString prefix;
00048
QString postfix;
00049
QString comment;
00050
00051
QString userdata;
00052
00053
bool operator==(
const CompletionEntry &c )
const {
00054
return ( c.
type == type &&
00055 c.
text == text &&
00056 c.
postfix == postfix &&
00057 c.
prefix == prefix &&
00058 c.
comment == comment &&
00059 c.
userdata == userdata);
00060 }
00061 };
00062
00086 class KTEXTEDITOR_EXPORT CodeCompletionInterface
00087 {
00088
friend class PrivateCodeCompletionInterface;
00089
00090
public:
00091 CodeCompletionInterface();
00092
virtual ~CodeCompletionInterface();
00093
00094
unsigned int codeCompletionInterfaceNumber ()
const;
00095
00096
protected:
00097
void setCodeCompletionInterfaceDCOPSuffix (
const QCString &suffix);
00098
00099
00100
public:
00101
00102
00103
00107
virtual void showArgHint (
QStringList functionList,
const QString& strWrapping,
const QString& strDelimiter) = 0;
00108
00115
virtual void showCompletionBox (
QValueList<CompletionEntry> complList,
int offset=0,
bool casesensitive=
true)=0;
00116
00117
00118
00119
00120
public:
00121
00122
00133
virtual void completionAborted()=0;
00134
00146
virtual void completionDone()=0;
00147
00162
virtual void completionDone(CompletionEntry)=0;
00163
00174
virtual void argHintHidden()=0;
00175
00189
virtual void filterInsertString(CompletionEntry*,
QString*)=0;
00190
00191
00192
private:
00193
class PrivateCodeCompletionInterface *d;
00194
static unsigned int globalCodeCompletionInterfaceNumber;
00195
unsigned int myCodeCompletionInterfaceNumber;
00196 };
00197
00198 KTEXTEDITOR_EXPORT CodeCompletionInterface *codeCompletionInterface (
class View *view);
00199
00200 }
00201
00202
#endif