~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

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
#ifndef KRSCRIPTFUNCTIONS_H
 
19
#define KRSCRIPTFUNCTIONS_H
 
20
#include <QScriptEngine>
 
21
#include <QObject>
 
22
#include <QString>
 
23
#include <kexidb/connection.h>
 
24
#include <kexidb/cursor.h>
 
25
#include <KoReportData.h>
 
26
 
 
27
/**
 
28
 @author
 
29
*/
 
30
class KRScriptFunctions : public QObject
 
31
{
 
32
    Q_OBJECT
 
33
public:
 
34
    KRScriptFunctions(const KoReportData *, KexiDB::Connection*);
 
35
 
 
36
    ~KRScriptFunctions();
 
37
    
 
38
private:
 
39
    KexiDB::Connection *m_connection;
 
40
    const KoReportData *m_cursor;
 
41
    QString m_source;
 
42
    qreal math(const QString &, const QString &);
 
43
 
 
44
    QString m_where;
 
45
public slots:
 
46
    void setWhere(const QString&);
 
47
    
 
48
    qreal sum(const QString &);
 
49
    qreal avg(const QString &);
 
50
    qreal min(const QString &);
 
51
    qreal max(const QString &);
 
52
    qreal count(const QString &);
 
53
    QVariant value(const QString &);
 
54
};
 
55
 
 
56
#endif