aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbAndroid/dbandroidinstance.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-11-25 16:48:41 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-11-25 16:48:41 -0500
commit8e640722c62692818ab840d50b3758f89a41a54e (patch)
tree38197eb1688a5afc338081ea17e15f938976e422 /Plugins/DbAndroid/dbandroidinstance.h
parent9618f0ebbf4b88045247c01ce8c8f58203508ebf (diff)
Imported Upstream version 3.0.7upstream/3.0.7
Diffstat (limited to 'Plugins/DbAndroid/dbandroidinstance.h')
-rw-r--r--Plugins/DbAndroid/dbandroidinstance.h51
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