3
* Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef KRSCRIPTFUNCTIONS_H
20
#define KRSCRIPTFUNCTIONS_H
22
#include <KReportData>
23
#include <KReportGroupTracker>
25
#include <KDbEscapedString>
33
class KRScriptFunctions : public KReportGroupTracker
37
KRScriptFunctions(const KReportData *, KDbConnection*);
42
KDbConnection *m_connection;
43
const KReportData *m_cursor;
45
qreal math(const QString &, const QString &);
47
QMap<QString, QVariant> m_groupData;
49
KDbEscapedString where();
52
virtual void setGroupData(const QMap<QString, QVariant> &groupData);
54
qreal sum(const QString &);
55
qreal avg(const QString &);
56
qreal min(const QString &);
57
qreal max(const QString &);
58
qreal count(const QString &);
59
QVariant value(const QString &);