Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/reports/KexiDBReportDataSource.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Kexi Report Plugin | 2 | * Kexi Report Plugin | ||
3 | * Copyright (C) 2007-2017 by Adam Pigg <adam@piggz.co.uk> | 3 | * Copyright (C) 2007-2017 by Adam Pigg <adam@piggz.co.uk> | ||
4 | * Copyright (C) 2017 Jarosław Staniek <staniek@kde.org> | 4 | * Copyright (C) 2017-2018 Jarosław Staniek <staniek@kde.org> | ||
5 | * | 5 | * | ||
6 | * This library is free software; you can redistribute it and/or | 6 | * This library is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU Lesser General Public | 7 | * modify it under the terms of the GNU Lesser General Public | ||
8 | * License as published by the Free Software Foundation; either | 8 | * License as published by the Free Software Foundation; either | ||
9 | * version 2.1 of the License, or (at your option) any later version. | 9 | * version 2.1 of the License, or (at your option) any later version. | ||
10 | * | 10 | * | ||
11 | * This library is distributed in the hope that it will be useful, | 11 | * This library is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 33 | public: | |||
61 | virtual bool moveNext(); | 61 | virtual bool moveNext(); | ||
62 | virtual bool movePrevious(); | 62 | virtual bool movePrevious(); | ||
63 | virtual bool moveFirst(); | 63 | virtual bool moveFirst(); | ||
64 | virtual bool moveLast(); | 64 | virtual bool moveLast(); | ||
65 | 65 | | |||
66 | virtual qint64 at() const; | 66 | virtual qint64 at() const; | ||
67 | virtual qint64 recordCount() const; | 67 | virtual qint64 recordCount() const; | ||
68 | 68 | | |||
69 | /** | ||||
70 | * Runs aggregate function @a function on the data source | ||||
71 | * | ||||
72 | * @param function name such as max, min, avg | ||||
73 | * @param field name of field for which the aggregation should be executed | ||||
74 | * @param conditions optional conditions that limit the record set | ||||
75 | * @return value of the function, 0.0 on failure | ||||
76 | * | ||||
77 | * @warning SQL injection warning: validity of @a function name is not checked, this should not | ||||
78 | * be part of a public API. | ||||
79 | * @todo Move SQL aggregate functions to KDb. Current code depends on support for subqueries. | ||||
80 | */ | ||||
81 | double runAggregateFunction(const QString &function, const QString &field, | ||||
82 | const QMap<QString, QVariant> &conditions); | ||||
83 | | ||||
69 | //Utility Functions | 84 | //Utility Functions | ||
70 | virtual QStringList dataSourceNames() const; | 85 | virtual QStringList dataSourceNames() const; | ||
71 | virtual KReportDataSource* create(const QString& source) const Q_REQUIRED_RESULT; | 86 | virtual KReportDataSource* create(const QString& source) const Q_REQUIRED_RESULT; | ||
72 | 87 | | |||
73 | private: | 88 | private: | ||
74 | class Private; | 89 | class Private; | ||
75 | Private * const d; | 90 | Private * const d; | ||
76 | 91 | | |||
77 | bool getSchema(const QString& pluginId); | 92 | bool getSchema(const QString& pluginId); | ||
78 | }; | 93 | }; | ||
79 | 94 | | |||
80 | #endif | 95 | #endif | ||
81 | 96 | |