From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/php/phpcodecompletion.h | 103 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 languages/php/phpcodecompletion.h (limited to 'languages/php/phpcodecompletion.h') diff --git a/languages/php/phpcodecompletion.h b/languages/php/phpcodecompletion.h new file mode 100644 index 00000000..41d79934 --- /dev/null +++ b/languages/php/phpcodecompletion.h @@ -0,0 +1,103 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#ifndef PHPCODECOMPLETION_H +#define PHPCODECOMPLETION_H + +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + + +class KDevCore; +class PHPSupportPart; +class PHPConfigData; + +class FunctionCompletionEntry : public KTextEditor::CompletionEntry { +public: + QString prototype; +}; + +class PHPCodeCompletion : public QObject { + Q_OBJECT + +public: + PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config); + ~PHPCodeCompletion(); + void setActiveEditorPart(KParts::Part *part); + +public slots: + void cursorPositionChanged(); + +protected slots: + void argHintHided(); + void completionBoxHided(); + +protected: + bool showCompletionBox(QValueList list, unsigned long max); + + bool checkForVariable(QString line, int col); + bool checkForStaticFunction(QString line, int col); + bool checkForNew(QString line, int col); + bool checkForExtends(QString line, int col); + bool checkForGlobalFunction(QString line, int col); + + bool checkForArgHint(QString line, int col); + + QValueList getClasses(QString name); + QValueList getFunctionsAndVars(QString classname, QString str); + QStringList getArguments(QString classname, QString function); + QString getCurrentClassName(); + QString getClassName(QString varName, QString classname); + QValueList getClassByName(QString classname); + + void readGlobalPHPFunctionsFile(); + void setStatusBar(QString expr, QString type); + + private: + int m_currentLine; + QValueList m_globalFunctions; + + PHPSupportPart* m_phpSupport; + PHPConfigData* m_config; + CodeModel* m_model; + + bool m_argWidgetShow; + bool m_completionBoxShow; + + KTextEditor::EditInterface *m_editInterface; + KTextEditor::CodeCompletionInterface *m_codeInterface; + KTextEditor::ViewCursorInterface *m_cursorInterface; + KTextEditor::SelectionInterface *m_selectionInterface; + + QString findDeclaration(QString name, int line = -1); +}; + +#endif -- cgit v1.2.1