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/phpfile.h | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 languages/php/phpfile.h (limited to 'languages/php/phpfile.h') diff --git a/languages/php/phpfile.h b/languages/php/phpfile.h new file mode 100644 index 00000000..cb1573f3 --- /dev/null +++ b/languages/php/phpfile.h @@ -0,0 +1,119 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + + 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 PHPFILE_H +#define PHPFILE_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "phpsupportpart.h" +#include "phperrorview.h" +#include "phpparser.h" +#include "phpsupport_event.h" + +/** +@author Escuder Nicolas +*/ +class PHPFile : public QObject { +Q_OBJECT + +public: + PHPFile(PHPSupportPart *phpSupport, const QString& fileName); + ~PHPFile(); + + QStringList getContents(); + + bool isModified(); + void setModified(bool value); + QString fileName(); + void Analyse(); + void ParseStdout(QString phpOutput); +/* + ClassDom classByName(QString filename, QString classname); + QValueList classByName(QString classname); +*/ + +/* +private slots: + void slotReceivedPHPCheckStderr (KProcess* proc, char* buffer, int buflen); + void slotReceivedPHPCheckStdout (KProcess* proc, char* buffer, int buflen); + void slotPHPCheckExited (KProcess* proc); +*/ +private: + QStringList readFromEditor(); + QStringList readFromDisk(); + + bool ParseClass(QString line, int lineNo); + bool ParseFunction(QString line, int lineNo); + bool ParseVariable(QString line, int lineNo); + + bool ParseThisMember(QString line, int lineNo); + bool ParseMember(QString line, int lineNo); + bool ParseReturn(QString line, int lineNo); + bool ParseTodo(QString line, int lineNo); + bool ParseFixme(QString line, int lineNo); + + void ParseSource(); + void PHPCheck(); + + void postEvent(FileParseEvent *event); + + bool AddClass(QString name, QString extends, int start); + bool SetClass(QString arguments); + bool CloseClass(int end); + + bool AddFunction(QString name, QString arguments, int start); + bool SetFunction(QString name, QString arguments = ""); + bool CloseFunction(int end); + + bool AddVariable(QString name, QString type, int position, bool classvar = FALSE); + bool SetVariable(QString arguments); + + bool AddTodo(QString arguments, int position); + bool AddFixme(QString arguments, int position); + + PHPSupportPart *m_part; + + bool modified; + + bool inClass; + bool inMethod; + + QFileInfo* m_fileinfo; + QStringList m_contents; + QString m_phpCheckOutput; +// KShellProcess* phpCheckProc; +}; + +#endif -- cgit v1.2.3