From 8e640722c62692818ab840d50b3758f89a41a54e Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Wed, 25 Nov 2015 16:48:41 -0500 Subject: Imported Upstream version 3.0.7 --- Plugins/DbAndroid/dbandroidinstance.h | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Plugins/DbAndroid/dbandroidinstance.h (limited to 'Plugins/DbAndroid/dbandroidinstance.h') diff --git a/Plugins/DbAndroid/dbandroidinstance.h b/Plugins/DbAndroid/dbandroidinstance.h new file mode 100644 index 0000000..453b370 --- /dev/null +++ b/Plugins/DbAndroid/dbandroidinstance.h @@ -0,0 +1,51 @@ +#ifndef DBANDROIDINSTANCE_H +#define DBANDROIDINSTANCE_H + +#include "db/abstractdb.h" +#include +#include +#include + +class DbAndroidConnection; +class DbAndroid; + +class DbAndroidInstance : public AbstractDb +{ + Q_OBJECT + + public: + typedef std::function AsyncDbListResponseHandler; + + DbAndroidInstance(DbAndroid* plugin, const QString& name, const QString& path, const QHash& connOptions); + ~DbAndroidInstance(); + + SqlQueryPtr prepare(const QString& query); + QString getTypeLabel(); + bool deregisterFunction(const QString& name, int argCount); + bool registerScalarFunction(const QString& name, int argCount); + bool registerAggregateFunction(const QString& name, int argCount); + bool initAfterCreated(); + + protected: + bool isOpenInternal(); + void interruptExecution(); + QString getErrorTextInternal(); + int getErrorCodeInternal(); + bool openInternal(); + bool closeInternal(); + bool registerCollationInternal(const QString& name); + bool deregisterCollationInternal(const QString& name); + + private: + DbAndroidConnection* createConnection(); + + DbAndroid* plugin = nullptr; + DbAndroidConnection* connection = nullptr; + int errorCode = 0; + QString errorText; + + private slots: + void handleDisconnected(); +}; + +#endif // DBANDROIDINSTANCE_H -- cgit v1.2.3