diff options
| author | 2015-11-25 16:48:49 -0500 | |
|---|---|---|
| committer | 2015-11-25 16:48:49 -0500 | |
| commit | 7412693e086a7eafaa7ea861164caf523943e5fa (patch) | |
| tree | 0aee322e40572df306b9813546c7a12b3093bcea /Plugins/DbAndroid/dbandroidinstance.h | |
| parent | 640196993d31cf5d6fdf36386990ec05f473a048 (diff) | |
| parent | 8e640722c62692818ab840d50b3758f89a41a54e (diff) | |
Merge tag 'upstream/3.0.7'
Upstream version 3.0.7
# gpg: Signature made Wed 25 Nov 2015 04:48:48 PM EST using RSA key ID EBE9BD91
# gpg: Good signature from "Unit 193 <unit193@gmail.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.org>"
# gpg: aka "Unit 193 <unit193@ubuntu.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'Plugins/DbAndroid/dbandroidinstance.h')
| -rw-r--r-- | Plugins/DbAndroid/dbandroidinstance.h | 51 |
1 files changed, 51 insertions, 0 deletions
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 <QObject> +#include <functional> +#include <QCache> + +class DbAndroidConnection; +class DbAndroid; + +class DbAndroidInstance : public AbstractDb +{ + Q_OBJECT + + public: + typedef std::function<void(const QStringList&)> AsyncDbListResponseHandler; + + DbAndroidInstance(DbAndroid* plugin, const QString& name, const QString& path, const QHash<QString, QVariant>& 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 |
