blob: 453b3704d9b5f9f6d65e10a263be6349da52cc61 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
|