languages/php/phpcodecompletion.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
#ifndef PHPCODECOMPLETION_H
00019
#define PHPCODECOMPLETION_H
00020
00021
#include <codemodel.h>
00022
00023
#include <qobject.h>
00024
#include <kregexp.h>
00025
#include <kparts/part.h>
00026
00027
#include <ktexteditor/editinterface.h>
00028
#include <ktexteditor/viewcursorinterface.h>
00029
#include <ktexteditor/codecompletioninterface.h>
00030
#include <ktexteditor/selectioninterface.h>
00031
00032
00033
class KDevCore;
00034
class PHPSupportPart;
00035
class PHPConfigData;
00036
00041 class FunctionCompletionEntry :
public KTextEditor::CompletionEntry {
00042
public:
00043 QString prototype;
00044 };
00045
00046 class PHPCodeCompletion :
public QObject {
00047 Q_OBJECT
00048
00049
public:
00050
PHPCodeCompletion(
PHPConfigData *config,
KDevCore* core,
CodeModel* model);
00051
~PHPCodeCompletion();
00052
void setActiveEditorPart(
KParts::Part *part);
00053
00054
protected slots:
00055
void cursorPositionChanged();
00056
void argHintHided();
00057
void completionBoxHided();
00058
00059
protected:
00060
bool checkForVariable(
QString lineStr,
int col,
int line);
00061
bool checkForGlobalFunction(
QString lineStr,
int col);
00062
bool checkForNewInstance(
QString lineStr,
int col,
int line);
00063
00064
bool checkForGlobalFunctionArgHint(
QString lineStr,
int col,
int line);
00065
bool checkForMethodArgHint(
QString lineStr,
int col,
int line);
00066
bool checkForNewInstanceArgHint(
QString lineStr,
int col,
int line);
00067
00068
void readGlobalPHPFunctionsFile();
00069
00070
QValueList<KTextEditor::CompletionEntry> getClassMethodsAndVariables(
QString className);
00071
QString getClassName(
QString varName,
QString maybeInstanceOf);
00072
QString searchCurrentClassName();
00073
QString searchClassNameForVariable(
QString varName);
00074
bool doGlobalMethodCompletion(
QString methodStart);
00075
private:
00076 int m_currentLine;
00077 QValueList<FunctionCompletionEntry> m_globalFunctions;
00078 KDevCore*
m_core;
00079 CodeModel*
m_model;
00080 bool m_argWidgetShow;
00081 bool m_completionBoxShow;
00082 KTextEditor::EditInterface *
m_editInterface;
00083 KTextEditor::CodeCompletionInterface *
m_codeInterface;
00084 KTextEditor::ViewCursorInterface *
m_cursorInterface;
00085 KTextEditor::SelectionInterface *
m_selectionInterface;
00086 PHPConfigData*
m_config;
00087 };
00088
00089
#endif
This file is part of the documentation for KDevelop Version 3.0.4.