Kooky
cmysqlplugin.h
Go to the documentation of this file.
1 
29 #ifndef CMYSQLPLUGIN_H
30 #define CMYSQLPLUGIN_H
31 
32 
33 #include "cdbinterface.h"
34 
35 #include <QtCore>
36 #include <QObject>
37 #include <QString>
38 #include <QSqlDatabase>
39 
40 
45 class cMySQLPlugin : public QObject, public cDBInterface
46 {
47  Q_OBJECT
48  Q_PLUGIN_METADATA(IID "cMySQLPlugin" FILE "dMySQL.json")
49  Q_INTERFACES(cDBInterface)
50 
51 public:
57  qint16 pluginAPIVersion() { return(1); }
63  QString pluginName() { return("MySQL DB"); }
69  qint16 pluginVersion() { return(1); }
87 
93  bool connect();
99  bool init();
105  QString lastError();
106 
112  bool config();
113 
114 protected:
120  bool open();
121 
122  QSqlDatabase m_db;
123  QString m_szLastError;
124 };
125 
126 #endif // CMYSQLPLUGIN_H
This is the base class for all database connector plugins.
Definition: cdbinterface.h:34
QString pluginName()
Returns the name of the plugin.
Definition: cmysqlplugin.h:63
QString lastError()
returns the last error string.
Definition: cmysqlplugin.cpp:89
qint16 pluginAPIVersion()
Returns the version of the plugin API.
Definition: cmysqlplugin.h:57
Definition: cInterface.h:42
bool connect()
connects to the database.
Definition: cmysqlplugin.cpp:9
QSqlDatabase m_db
Definition: cmysqlplugin.h:122
iType
Defines the type of the interface.
Definition: cInterface.h:38
QString m_szLastError
Definition: cmysqlplugin.h:123
bool open()
opens the database.
Definition: cmysqlplugin.cpp:68
qint16 pluginVersion()
returns the version of the plugin
Definition: cmysqlplugin.h:69
bool init()
initializes default settings for the plugin.
Definition: cmysqlplugin.cpp:22
MySQL Database Connector Plugin class.
Definition: cmysqlplugin.h:45
bool config()
calls the configuration dialog.
Definition: cmysqlplugin.cpp:94
iType pluginType()
returns the type of the plugin.
Definition: cmysqlplugin.h:86