|
QGIS API Documentation
master-6227475
|
00001 /*************************************************************************** 00002 qgspythonrunner.h 00003 --------------------- 00004 begin : May 2011 00005 copyright : (C) 2011 by Martin Dobias 00006 email : wonder dot sk at gmail dot com 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 #ifndef QGSPYTHONRUNNER_H 00016 #define QGSPYTHONRUNNER_H 00017 00018 #include <QString> 00019 00029 class CORE_EXPORT QgsPythonRunner 00030 { 00031 public: 00032 00035 static bool isValid(); 00036 00038 static bool run( QString command, QString messageOnError = QString() ); 00039 00041 static bool eval( QString command, QString& result ); 00042 00046 static void setInstance( QgsPythonRunner* runner ); 00047 00048 protected: 00050 QgsPythonRunner(); 00051 virtual ~QgsPythonRunner(); 00052 00053 virtual bool runCommand( QString command, QString messageOnError = QString() ) = 0; 00054 00055 virtual bool evalCommand( QString command, QString& result ) = 0; 00056 00057 static QgsPythonRunner* mInstance; 00058 }; 00059 00060 #endif // QGSPYTHONRUNNER_H