kexi

sqltypes.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003, 2006 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef SQLTYPES_H
00021 #define SQLTYPES_H
00022 
00023 #include <qvariant.h>
00024 
00025 extern int current;
00026 extern QString ctoken;
00027 
00028 struct dateType
00029 {
00030         int year;
00031         int month;
00032         int day;
00033 };
00034 
00035 struct realType
00036 {
00037     int integer;
00038     int fractional;
00039 };
00040 
00042 struct OrderByColumnInternal
00043 {
00044     typedef QValueList<OrderByColumnInternal> List;
00045     typedef QValueListConstIterator<OrderByColumnInternal> ListConstIterator;
00046     OrderByColumnInternal()
00047      : columnNumber(-1)
00048      , ascending(true)
00049     {
00050     }
00051     
00052     void setColumnByNameOrNumber(const QVariant& nameOrNumber) {
00053         if (nameOrNumber.type()==QVariant::String) {
00054             aliasOrName = nameOrNumber.toString();
00055             columnNumber = -1;
00056         }
00057         else {
00058             columnNumber = nameOrNumber.toInt();
00059             aliasOrName = QString::null;
00060         }
00061     }
00062     
00063     QString aliasOrName; 
00064     int columnNumber; 
00065 
00066     bool ascending : 1;
00067 };
00068 
00070 struct SelectOptionsInternal
00071 {
00072     SelectOptionsInternal() : whereExpr(0), orderByColumns(0) {}
00073     ~SelectOptionsInternal() { 
00074         delete orderByColumns; // delete because this is internal temp. structure
00075     }
00076     KexiDB::BaseExpr* whereExpr;
00077     OrderByColumnInternal::List* orderByColumns;
00078 };
00079 
00080 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys