Kexi API Documentation (2.0 alpha)

driver_p.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2003-2004 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 KEXIDB_DRIVER_P_H
00021 #define KEXIDB_DRIVER_P_H
00022 
00023 #ifndef __KEXIDB__
00024 # error "Do not include: this is KexiDB internal file"
00025 #endif
00026 
00027 #include <qstring.h>
00028 #include <qvariant.h>
00029 #include <qmap.h>
00030 #include <qptrdict.h>
00031 #include <qasciidict.h>
00032 #include <qvaluevector.h>
00033 #include <kgenericfactory.h>
00034 
00035 #include "connection.h"
00036 #include "admin.h"
00037 
00038 class KService;
00039 
00040 namespace KexiDB {
00041 
00047 class KEXI_DB_EXPORT DriverBehaviour
00048 {
00049     public:
00050         DriverBehaviour();
00051             
00053     QString UNSIGNED_TYPE_KEYWORD;
00054     
00057     QString AUTO_INCREMENT_FIELD_OPTION;
00058 
00061     QString AUTO_INCREMENT_PK_FIELD_OPTION;
00062 
00065     QString AUTO_INCREMENT_TYPE;
00066 
00071     bool SPECIAL_AUTO_INCREMENT_DEF : 1;
00072 
00075     bool AUTO_INCREMENT_REQUIRES_PK : 1;
00076 
00084     QString ROW_ID_FIELD_NAME;
00085     
00102     bool ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE : 1;
00103 
00112     QString ALWAYS_AVAILABLE_DATABASE_NAME;
00113     
00117     QChar QUOTATION_MARKS_FOR_IDENTIFIER;
00118     
00125     bool USING_DATABASE_REQUIRED_TO_CONNECT : 1;
00126 
00130     bool _1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY : 1;
00131 
00134     bool SELECT_1_SUBQUERY_SUPPORTED : 1;
00135 
00138     const char** SQL_KEYWORDS;
00139 };
00140 
00142 class DriverPrivate
00143 {
00144     public:
00145         DriverPrivate();
00146         virtual ~DriverPrivate();
00147 
00148         QPtrDict<Connection> connections;
00149 
00150 //(js)now QObject::name() is reused:
00151 //      /*! The name equal to the service name (X-Kexi-DriverName) 
00152 //       stored in given service .desktop file. Set this in subclasses. */
00153 //      QString m_driverName;
00154         
00158         QString fileDBDriverMimeType;
00159 
00161         KService *service;
00162 
00164         bool isFileDriver : 1;
00165 
00169         bool isDBOpenedAfterCreate : 1;
00170 
00175 //      QStringList m_systemObjectNames;
00176 
00180 //      QStringList m_systemFieldNames;
00181 
00186         int features;
00187 
00189         QValueVector<QString> typeNames;
00190 
00194         QMap<QCString,QVariant> properties;
00195 
00199         QMap<QCString,QString> propertyCaptions;
00200 
00202         AdminTools *adminTools;
00203 
00210     static QAsciiDict<bool>* kexiSQLDict;
00211     static const char *kexiSQLKeywords[];
00212     
00222     QAsciiDict<bool>* driverSQLDict;
00223     
00225     void initKexiKeywords();
00229     void initDriverKeywords(const char* keywords[], int hashSize);
00230     
00231     protected:
00234         void initInternalProperties();
00235     
00236     private:
00237         void initKeywords(const char* keywords[], QAsciiDict<bool>& dict);
00238     
00239     friend class DriverManagerInternal;
00240 };
00241 
00242 // escaping types for Driver::escapeBLOBInternal()
00243 #define BLOB_ESCAPING_TYPE_USE_X     0 
00244 #define BLOB_ESCAPING_TYPE_USE_0x    1 
00245 #define BLOB_ESCAPING_TYPE_USE_OCTAL 2 
00246 
00247 class KEXI_DB_EXPORT AdminTools::Private
00248 {
00249     public:
00250         Private();
00251         ~Private();
00252 };
00253 
00254 }
00255 
00258 #define KEXIDB_DRIVER_INFO( class_name, internal_name ) \
00259     DatabaseVersionInfo class_name::version() const { return KEXIDB_VERSION; } \
00260     K_EXPORT_COMPONENT_FACTORY(kexidb_ ## internal_name ## driver, KGenericFactory<KexiDB::class_name>( "kexidb_" #internal_name ))
00261 
00262 #endif
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:48:00 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003