#ifndef PYTHONQTWRAPPER_QSQLDRIVER_H #define PYTHONQTWRAPPER_QSQLDRIVER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class PythonQtShell_QSqlDriver : public QSqlDriver { public: PythonQtShell_QSqlDriver(QObject* parent = 0):QSqlDriver(parent),_wrapper(NULL) {}; virtual bool beginTransaction(); virtual void childEvent(QChildEvent* arg__1); virtual void close(); virtual bool commitTransaction(); virtual QSqlResult* createResult() const; virtual void customEvent(QEvent* arg__1); virtual QString escapeIdentifier(const QString& identifier, QSqlDriver::IdentifierType type) const; virtual bool event(QEvent* arg__1); virtual bool eventFilter(QObject* arg__1, QEvent* arg__2); virtual QString formatValue(const QSqlField& field, bool trimStrings = false) const; virtual QVariant handle() const; virtual bool hasFeature(QSqlDriver::DriverFeature f) const; virtual bool isOpen() const; virtual bool open(const QString& db, const QString& user = QString(), const QString& password = QString(), const QString& host = QString(), int port = -1, const QString& connOpts = QString()); virtual QSqlIndex primaryIndex(const QString& tableName) const; virtual QSqlRecord record(const QString& tableName) const; virtual bool rollbackTransaction(); virtual void setLastError(const QSqlError& e); virtual void setOpen(bool o); virtual void setOpenError(bool e); virtual QString sqlStatement(QSqlDriver::StatementType type, const QString& tableName, const QSqlRecord& rec, bool preparedStatement) const; virtual QStringList tables(QSql::TableType tableType) const; virtual void timerEvent(QTimerEvent* arg__1); PythonQtInstanceWrapper* _wrapper; }; class PythonQtPublicPromoter_QSqlDriver : public QSqlDriver { public: inline QString promoted_sqlStatement(QSqlDriver::StatementType type, const QString& tableName, const QSqlRecord& rec, bool preparedStatement) const { return QSqlDriver::sqlStatement(type, tableName, rec, preparedStatement); } inline QVariant promoted_handle() const { return QSqlDriver::handle(); } inline void promoted_setLastError(const QSqlError& e) { QSqlDriver::setLastError(e); } inline void promoted_setOpenError(bool e) { QSqlDriver::setOpenError(e); } inline QSqlRecord promoted_record(const QString& tableName) const { return QSqlDriver::record(tableName); } inline QStringList promoted_tables(QSql::TableType tableType) const { return QSqlDriver::tables(tableType); } inline bool promoted_isOpen() const { return QSqlDriver::isOpen(); } inline QString promoted_formatValue(const QSqlField& field, bool trimStrings = false) const { return QSqlDriver::formatValue(field, trimStrings); } inline bool promoted_beginTransaction() { return QSqlDriver::beginTransaction(); } inline bool promoted_commitTransaction() { return QSqlDriver::commitTransaction(); } inline QSqlIndex promoted_primaryIndex(const QString& tableName) const { return QSqlDriver::primaryIndex(tableName); } inline void promoted_setOpen(bool o) { QSqlDriver::setOpen(o); } inline QString promoted_escapeIdentifier(const QString& identifier, QSqlDriver::IdentifierType type) const { return QSqlDriver::escapeIdentifier(identifier, type); } inline bool promoted_rollbackTransaction() { return QSqlDriver::rollbackTransaction(); } }; class PythonQtWrapper_QSqlDriver : public QObject { Q_OBJECT public: Q_ENUMS(StatementType IdentifierType DriverFeature ) enum StatementType{ WhereStatement = QSqlDriver::WhereStatement, SelectStatement = QSqlDriver::SelectStatement, UpdateStatement = QSqlDriver::UpdateStatement, InsertStatement = QSqlDriver::InsertStatement, DeleteStatement = QSqlDriver::DeleteStatement}; enum IdentifierType{ FieldName = QSqlDriver::FieldName, TableName = QSqlDriver::TableName}; enum DriverFeature{ Transactions = QSqlDriver::Transactions, QuerySize = QSqlDriver::QuerySize, BLOB = QSqlDriver::BLOB, Unicode = QSqlDriver::Unicode, PreparedQueries = QSqlDriver::PreparedQueries, NamedPlaceholders = QSqlDriver::NamedPlaceholders, PositionalPlaceholders = QSqlDriver::PositionalPlaceholders, LastInsertId = QSqlDriver::LastInsertId, BatchOperations = QSqlDriver::BatchOperations, SimpleLocking = QSqlDriver::SimpleLocking, LowPrecisionNumbers = QSqlDriver::LowPrecisionNumbers, EventNotifications = QSqlDriver::EventNotifications, FinishQuery = QSqlDriver::FinishQuery, MultipleResultSets = QSqlDriver::MultipleResultSets}; public slots: QSqlDriver* new_QSqlDriver(QObject* parent = 0); void delete_QSqlDriver(QSqlDriver* obj) { delete obj; } QString sqlStatement(QSqlDriver* theWrappedObject, QSqlDriver::StatementType type, const QString& tableName, const QSqlRecord& rec, bool preparedStatement) const; bool subscribeToNotification(QSqlDriver* theWrappedObject, const QString& name); QVariant handle(QSqlDriver* theWrappedObject) const; bool isOpenError(QSqlDriver* theWrappedObject) const; void setLastError(QSqlDriver* theWrappedObject, const QSqlError& e); void setOpenError(QSqlDriver* theWrappedObject, bool e); QSqlRecord record(QSqlDriver* theWrappedObject, const QString& tableName) const; QStringList tables(QSqlDriver* theWrappedObject, QSql::TableType tableType) const; bool isOpen(QSqlDriver* theWrappedObject) const; QString formatValue(QSqlDriver* theWrappedObject, const QSqlField& field, bool trimStrings = false) const; QSqlError lastError(QSqlDriver* theWrappedObject) const; bool beginTransaction(QSqlDriver* theWrappedObject); QStringList subscribedToNotifications(QSqlDriver* theWrappedObject) const; bool commitTransaction(QSqlDriver* theWrappedObject); QSqlIndex primaryIndex(QSqlDriver* theWrappedObject, const QString& tableName) const; bool unsubscribeFromNotification(QSqlDriver* theWrappedObject, const QString& name); void setOpen(QSqlDriver* theWrappedObject, bool o); QString escapeIdentifier(QSqlDriver* theWrappedObject, const QString& identifier, QSqlDriver::IdentifierType type) const; bool rollbackTransaction(QSqlDriver* theWrappedObject); }; #endif // PYTHONQTWRAPPER_QSQLDRIVER_H