KDevelop API Documentation

phpcodecompletion.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           phpcodecompletion.h  -  description
00003                              -------------------
00004     begin                : Tue Jul 17 2001
00005     copyright            : (C) 2001 by Sandy Meier
00006     email                : smeier@kdevelop.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:50 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003