|
| 1 | +/** |
| 2 | + * \class QgsProcessingFeedback |
| 3 | + * \ingroup core |
| 4 | + * Base class for providing feedback from a processing algorithm. |
| 5 | + * |
| 6 | + * This base class implementation silently ignores all feedback reported by algorithms. |
| 7 | + * Subclasses of QgsProcessingFeedback can be used to log this feedback or report |
| 8 | + * it to users via the GUI. |
| 9 | + * \note added in QGIS 3.0 |
| 10 | + */ |
| 11 | +class QgsProcessingFeedback : public QgsFeedback |
| 12 | +{ |
| 13 | +%TypeHeaderCode |
| 14 | +#include <qgsprocessingfeedback.h> |
| 15 | +%End |
| 16 | + |
| 17 | + public: |
| 18 | + |
| 19 | + /** |
| 20 | + * Sets the algorithm's progress. The progress |
| 21 | + * argument is limited to the range 0-100 and reflects the percentage |
| 22 | + * progress through the task. |
| 23 | + * @see setProgressText() |
| 24 | + */ |
| 25 | + virtual void setProgress( double progress ); |
| 26 | + |
| 27 | + /** |
| 28 | + * Sets a progress report text string. This can be used in conjunction with |
| 29 | + * setProgress() to provide detailed progress reports, such as "Transformed |
| 30 | + * 4 of 5 layers". |
| 31 | + * @see setProgress() |
| 32 | + */ |
| 33 | + virtual void setProgressText( const QString& text ); |
| 34 | + |
| 35 | + /** |
| 36 | + * Reports that the algorithm encountered an error which prevented it |
| 37 | + * from successfully executing. |
| 38 | + */ |
| 39 | + virtual void reportError( const QString& error ); |
| 40 | + |
| 41 | + /** |
| 42 | + * Pushes a general informational message from the algorithm. This can |
| 43 | + * be used to report feedback which is neither a status report or an |
| 44 | + * error, such as "Found 47 matching features". |
| 45 | + * @see pushCommandInfo() |
| 46 | + * @see pushDebugInfo() |
| 47 | + * @see pushConsoleInfo() |
| 48 | + */ |
| 49 | + virtual void pushInfo( const QString& info ); |
| 50 | + |
| 51 | + /** |
| 52 | + * Pushes an informational message containing a command from the algorithm. |
| 53 | + * This is usually used to report commands which are executed in an external |
| 54 | + * application or as subprocesses. |
| 55 | + * @see pushInfo() |
| 56 | + * @see pushDebugInfo() |
| 57 | + * @see pushConsoleInfo() |
| 58 | + */ |
| 59 | + virtual void pushCommandInfo( const QString& info ); |
| 60 | + |
| 61 | + /** |
| 62 | + * Pushes an informational message containing debugging helpers from |
| 63 | + * the algorithm. |
| 64 | + * @see pushInfo() |
| 65 | + * @see pushCommandInfo() |
| 66 | + * @see pushConsoleInfo() |
| 67 | + */ |
| 68 | + virtual void pushDebugInfo( const QString& info ); |
| 69 | + |
| 70 | + |
| 71 | + /** |
| 72 | + * Pushes a console feedback message from the algorithm. This is used to |
| 73 | + * report the output from executing an external command or subprocess. |
| 74 | + * @see pushInfo() |
| 75 | + * @see pushDebugInfo() |
| 76 | + * @see pushCommandInfo() |
| 77 | + */ |
| 78 | + virtual void pushConsoleInfo( const QString& info ); |
| 79 | + |
| 80 | +}; |
0 commit comments