diff options
Diffstat (limited to 'kexi/kexidb/driver.h')
-rw-r--r-- | kexi/kexidb/driver.h | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/kexi/kexidb/driver.h b/kexi/kexidb/driver.h index ef946e65..c889d475 100644 --- a/kexi/kexidb/driver.h +++ b/kexi/kexidb/driver.h @@ -20,9 +20,9 @@ #ifndef KEXIDB_DRIVER_H #define KEXIDB_DRIVER_H -#include <qobject.h> -#include <qdatetime.h> -#include <qdict.h> +#include <tqobject.h> +#include <tqdatetime.h> +#include <tqdict.h> #include <kexidb/global.h> #include <kexidb/object.h> @@ -43,7 +43,7 @@ class DriverPrivate; //! Generic database abstraction. /*! This class is a prototype of the database driver for implementations. Driver allows new connections to be created, and groups - these as a parent. + these as a tqparent. Before destruction, all connections are destructed. Notes: @@ -63,16 +63,17 @@ class DriverPrivate; \sa SQLiteDriver MySqlDriver, pqxxSqlDriver */ -class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object +class KEXI_DB_EXPORT Driver : public TQObject, public KexiDB::Object { Q_OBJECT + TQ_OBJECT public: /*! Helpful for retrieving info about driver from using KexiDB::DriverManager::driversInfo() without loading driver libraries. */ class Info { public: Info(); - QString name, caption, comment, fileDBMimeType; + TQString name, caption, comment, fileDBMimeType; //! true is the driver is for file-based database backend bool fileBased : 1; /*! true is the driver is for a backend that allows importing. @@ -80,7 +81,7 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object Used for migration. */ bool allowImportingTo : 1; }; - typedef QMap<QString,Info> InfoMap; + typedef TQMap<TQString,Info> InfoMap; /*! Features supported by driver (sum of few Features enum items). */ enum Features { @@ -125,25 +126,25 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object Connection *createConnection( ConnectionData &conn_data, int options = 0 ); /*! \return List of created connections. */ - const QPtrList<Connection> connectionsList() const; + const TQPtrList<Connection> connectionsList() const; // /*! \return a name equal to the service name (X-Kexi-DriverName) // stored in given service .desktop file. */ -// QString driverName() { return m_driverName; } +// TQString driverName() { return m_driverName; } /*! \return a name of MIME type of files handled by this driver if it is a file-based database's driver (equal X-Kexi-FileDBDriverMime service property) otherwise returns null string. \sa isFileDriver() */ - QString fileDBDriverMimeType() const; + TQString fileDBDriverMimeType() const; /*! \return default file-based driver mime type (typically something like "application/x-kexiproject-sqlite") */ - static QString defaultFileBasedDriverMimeType(); + static TQString defaultFileBasedDriverMimeType(); /*! \return default file-based driver name (currently, "sqlite3"). */ - static QString defaultFileBasedDriverName(); + static TQString defaultFileBasedDriverName(); /*! Info about the driver as a service. */ const KService* service() const; @@ -160,12 +161,12 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object from your reimplementation. \sa isSystemFieldName(). */ - virtual bool isSystemObjectName( const QString& n ) const; + virtual bool isSystemObjectName( const TQString& n ) const; /*! \return true if \a n is a kexibd-related 'system' object's name, i.e. when \a n starts with "kexi__" prefix. */ - static bool isKexiDBSystemObjectName( const QString& n ); + static bool isKexiDBSystemObjectName( const TQString& n ); /*! \return true if \a n is a system database's name, eg. name of build-in, system database that cannot be used or created by a user, @@ -173,7 +174,7 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object a given driver implementation. For implementation. \sa isSystemObjectName(). */ - virtual bool isSystemDatabaseName( const QString& n ) const = 0; + virtual bool isSystemDatabaseName( const TQString& n ) const = 0; /*! \return true if \a n is a system field's name, build-in system field that cannot be used or created by a user, @@ -181,7 +182,7 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object a given driver implementation. \sa isSystemObjectName(). */ - bool isSystemFieldName( const QString& n ) const; + bool isSystemFieldName( const TQString& n ) const; /*! \return Driver's features that are combination of Driver::Features enum. */ @@ -197,10 +198,10 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object AdminTools& adminTools() const; /*! SQL-implementation-dependent name of given type */ - virtual QString sqlTypeName(int id_t, int p=0) const; + virtual TQString sqlTypeName(int id_t, int p=0) const; /*! used when we do not have Driver instance yet */ - static QString defaultSQLTypeName(int id_t); + static TQString defaultSQLTypeName(int id_t); /*! \return true if this driver's implementation is valid. Just few constriants are checked to ensure that driver @@ -219,21 +220,21 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object Reimplement this if you need other behaviour (eg. for 'date' type handling) This implementation return date, datetime and time values in ISO format, what seems to be accepted by SQL servers. - @see Qt::DateFormat */ - virtual QString valueToSQL( uint ftype, const QVariant& v ) const; + @see TQt::DateFormat */ + virtual TQString valueToSQL( uint ftype, const TQVariant& v ) const; //! Like above but with the fildtype as string. - inline QString valueToSQL( const QString& ftype, const QVariant& v ) const { + inline TQString valueToSQL( const TQString& ftype, const TQVariant& v ) const { return valueToSQL(Field::typeForString(ftype), v); } //! Like above method, for \a field. - inline QString valueToSQL( const Field *field, const QVariant& v ) const { + inline TQString valueToSQL( const Field *field, const TQVariant& v ) const { return valueToSQL( (field ? field->type() : Field::InvalidType), v ); } /*! not compatible with all drivers - reimplement */ - inline virtual QString dateTimeToSQL(const QDateTime& v) const { + inline virtual TQString dateTimeToSQL(const TQDateTime& v) const { /*! (was compatible with SQLite: http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions) Now it's ISO 8601 DateTime format - with "T" delimiter: @@ -241,27 +242,27 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object (e.g. "1994-11-05T13:15:30" not "1994-11-05 13:15:30") @todo add support for time zones? */ -//old const QDateTime dt( v.toDateTime() ); -//old return QString("\'")+dt.date().toString(Qt::ISODate)+" "+dt.time().toString(Qt::ISODate)+"\'"; - return QString("\'")+v.toString(Qt::ISODate)+"\'"; +//old const TQDateTime dt( v.toDateTime() ); +//old return TQString("\'")+dt.date().toString(Qt::ISODate)+" "+dt.time().toString(Qt::ISODate)+"\'"; + return TQString("\'")+v.toString(Qt::ISODate)+"\'"; } /*! Driver-specific SQL string escaping. Implement escaping for any character like " or ' as your database engine requires. Prepend and append quotation marks. */ - virtual QString escapeString( const QString& str ) const = 0; + virtual TQString escapeString( const TQString& str ) const = 0; - /*! This is overloaded version of escapeString( const QString& str ) + /*! This is overloaded version of escapeString( const TQString& str ) to be implemented in the same way. */ - virtual QCString escapeString( const QCString& str ) const = 0; + virtual TQCString escapeString( const TQCString& str ) const = 0; /*! Driver-specific SQL BLOB value escaping. Implement escaping for any character like " or ' and \\0 as your database engine requires. Prepend and append quotation marks. */ - virtual QString escapeBLOB(const QByteArray& array) const = 0; + virtual TQString escapeBLOB(const TQByteArray& array) const = 0; //todo enum EscapeType { EscapeDriver = 0x00, EscapeKexi = 0x01}; //todo enum EscapePolicy { EscapeAsNecessary = 0x00, EscapeAlways = 0x02 }; @@ -276,22 +277,22 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object \a options is the union of the EscapeType and EscapePolicy types. If no escaping options are given, defaults to driver escaping as necessary. */ - QString escapeIdentifier( const QString& str, + TQString escapeIdentifier( const TQString& str, int options = EscapeDriver|EscapeAsNecessary) const; - QCString escapeIdentifier( const QCString& str, + TQCString escapeIdentifier( const TQCString& str, int options = EscapeDriver|EscapeAsNecessary) const; //! \return property value for \a propeName available for this driver. - //! If there's no such property defined for driver, Null QVariant value is returned. - QVariant propertyValue( const QCString& propName ) const; + //! If there's no such property defined for driver, Null TQVariant value is returned. + TQVariant propertyValue( const TQCString& propName ) const; //! \return translated property caption for \a propeName. //! If there's no such property defined for driver, empty string value is returned. - QString propertyCaption( const QCString& propName ) const; + TQString propertyCaption( const TQCString& propName ) const; //! \return a list of property names available for this driver. - QValueList<QCString> propertyNames() const; + TQValueList<TQCString> propertyNames() const; protected: /*! Used by DriverManager. @@ -304,7 +305,7 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object You may also want to change options in DriverBehaviour *beh member. See drivers/mySQL/mysqldriver.cpp for usage example. */ - Driver( QObject *parent, const char *name, const QStringList &args = QStringList() ); + Driver( TQObject *tqparent, const char *name, const TQStringList &args = TQStringList() ); /*! For reimplemenation: creates and returns connection object with additional structures specific for a given driver. @@ -318,20 +319,20 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object Implement escaping for any character like " or ' as your database engine requires. Do not append or prepend any quotation marks characters - it is automatically done by escapeIdentifier() using - DriverBehaviour::QUOTATION_MARKS_FOR_IDENTIFIER. + DriverBehaviour::TQUOTATION_MARKS_FOR_IDENTIFIER. */ - virtual QString drv_escapeIdentifier( const QString& str ) const = 0; + virtual TQString drv_escapeIdentifier( const TQString& str ) const = 0; - /*! This is overloaded version of drv_escapeIdentifier( const QString& str ) + /*! This is overloaded version of drv_escapeIdentifier( const TQString& str ) to be implemented in the same way. */ - virtual QCString drv_escapeIdentifier( const QCString& str ) const = 0; + virtual TQCString drv_escapeIdentifier( const TQCString& str ) const = 0; /*! \return true if \a n is a system field's name, build-in system field that cannot be used or created by a user, and in most cases user even shouldn't see this. The list is specific for a given driver implementation. For implementation.*/ - virtual bool drv_isSystemFieldName( const QString& n ) const = 0; + virtual bool drv_isSystemFieldName( const TQString& n ) const = 0; /* Creates admin tools object providing a number of database administration tools for the driver. This is called once per driver. @@ -366,7 +367,7 @@ class KEXI_DB_EXPORT Driver : public QObject, public KexiDB::Object } //namespace KexiDB /*! Driver's static version information, automatically impemented for KexiDB drivers. - Put this into driver class declaration just like Q_OBJECT macro. */ + Put this into driver class declaration just like TQ_OBJECT macro. */ #define KEXIDB_DRIVER \ public: \ virtual DatabaseVersionInfo version() const; |