1
/***************************************************************************
2
simplebackend - description
4
begin : Thu May 10 2007
5
copyright : (C) 2007 by Thomas Friedrichsmeier
6
email : tfry@users.sourceforge.net
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
18
#ifndef SIMPLEBACKEND_H
19
#define SIMPLEBACKEND_H
21
#include "scriptbackend.h"
23
#include <qstringlist.h>
25
/** @brief A very simple script backend
27
This class provides a very simple alternative to the PHP backend. Right now it's basically just used as a hack to reduce the overhead of starting a PHP process for each color_chooser component (which is often embedded many times inside a single plugin).
29
This class is very hackish and NOT sure to stay! It might be obsoleted by another scripting solution.
31
@author Thomas Friedrichsmeier
33
class SimpleBackend : public ScriptBackend {
38
void setPreprocessTemplate (const QString &template_string) { preprocess_template = template_string; };
39
void setCalculateTemplate (const QString &template_string) { calculate_template = template_string; };
40
void setPrintoutTemplate (const QString &template_string) { printout_template = template_string; };
41
void setPreviewTemplate (const QString &template_string) { preview_template = template_string; };
43
bool initialize (RKComponentPropertyCode *code_property=0, bool add_headings=true);
46
void preprocess (int flags);
47
void calculate (int flags);
48
void printout (int flags);
49
void preview (int flags);
51
void writeData (const QString &data);
52
void tryNextFunction ();
54
QString preprocess_template;
55
QString calculate_template;
56
QString printout_template;
57
QString preview_template;
58
QString current_template;
62
QStringList current_values;
65
void finishCall (const QString &conditions);