Ananas Library 0.9.5
aextsql.h
1/****************************************************************************
2** $Id: aextsql.h,v 1.2 2007/09/10 08:47:58 app Exp $
3**
4** Header file of the Report Result Object of Ananas
5** Designer and Engine applications
6**
7** Created : 20070819
8**
9** Copyright (C) 2005-2007 Grigory Panov <grigory.panov at gmail.com>, Moscow.
10** Copyright (C) 2005-2007 Ananas Project.
11**
12** This file is part of the Library of the Ananas
13** automation accounting system.
14**
15** This file may be distributed and/or modified under the terms of the
16** GNU General Public License version 2 as published by the Free Software
17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file.
19**
20** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22**
23** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
24** See http://www.leaderit.ru/gpl/ for GPL licensing information.
25**
26** Contact org@leaderit.ru if any conditions of this licensing are
27** not clear to you.
28**
29**********************************************************************/
30#ifndef AEXTSQL_H
31#define AEXTSQL_H
32
33
34#include <qobject.h>
35#include <qsqlselectcursor.h>
36#include "adatabase.h"
37#include "aextension.h"
38#include "aobject.h"
39
125class ANANAS_EXPORT aExtSQL: public AExtension
126{
127 Q_OBJECT
128public:
129 aExtSQL();
130 virtual int init( aDatabase *database );
131 ~aExtSQL();
132private:
133 QSqlSelectCursor *cursor;
134public slots:
135 QSqlSelectCursor * Cursor() const;
136 QVariant Value(int col) const;
137 int Size() const;
138 int Count() const;
139 bool ExecQuery( const QString & query);
140 QVariant ExecScalar( const QString & query);
141 bool First();
142 bool Next();
143 bool Last();
144 bool Prev();
145 QString SqlFieldName(aObject * obj, const QString & userFieldName, const QString &tableType="") const;
146 QString SqlTableName(aObject * obj, const QString &tableType="") const;
147 QString SqlTableName(const QString & objName) const;
148 QString SqlFieldName(const QString & fieldName) const;
149 QString LastError() const;
150};
151
152#endif
Definition aextension.h:46
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject.
Definition adatabase.h:78
Предоставляет возможность использования SQL запросов в отчетах.
Definition aextsql.h:126
Базовый класс для невизуальных классов (моделей в терминологии MVC) Ананаса, которым необходим доступ...
Definition aobject.h:64