~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/plugins/reports/krscriptfunctions.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
ImportĀ upstreamĀ versionĀ 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Kexi Report Plugin
 
3
 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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/>.
 
17
 */
 
18
 
 
19
#ifndef KRSCRIPTFUNCTIONS_H
 
20
#define KRSCRIPTFUNCTIONS_H
 
21
 
 
22
#include <KReportData>
 
23
#include <KReportGroupTracker>
 
24
 
 
25
#include <KDbEscapedString>
 
26
 
 
27
class KDbConnection;
 
28
class KDbCursor;
 
29
 
 
30
/**
 
31
 @author
 
32
*/
 
33
class KRScriptFunctions : public KReportGroupTracker
 
34
{
 
35
    Q_OBJECT
 
36
public:
 
37
    KRScriptFunctions(const KReportData *, KDbConnection*);
 
38
 
 
39
    ~KRScriptFunctions();
 
40
 
 
41
private:
 
42
    KDbConnection *m_connection;
 
43
    const KReportData *m_cursor;
 
44
    QString m_source;
 
45
    qreal math(const QString &, const QString &);
 
46
 
 
47
    QMap<QString, QVariant> m_groupData;
 
48
 
 
49
    KDbEscapedString where();
 
50
 
 
51
public Q_SLOTS:
 
52
    virtual void setGroupData(const QMap<QString, QVariant> &groupData);
 
53
 
 
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 &);
 
60
};
 
61
 
 
62
#endif