kexi
kexidbmodule.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kexidbmodule.h"
00021 #include "kexidbdrivermanager.h"
00022 #include "kexidbconnection.h"
00023
00024
00025
00026 #include <main/manager.h>
00027
00028 #include <kdebug.h>
00029
00030
00031 #define KROSS_KEXIDB_VERSION 1
00032
00033 extern "C"
00034 {
00039 Kross::Api::Object* KDE_EXPORT init_module(Kross::Api::Manager* manager)
00040 {
00041 return new Kross::KexiDB::KexiDBModule(manager);
00042 }
00043 }
00044
00045 using namespace Kross::KexiDB;
00046
00047 KexiDBModule::KexiDBModule(Kross::Api::Manager* )
00048 : Kross::Api::Module("KexiDB")
00049
00050 {
00051
00052 addChild( "version", new Kross::Api::Variant(KROSS_KEXIDB_VERSION) );
00053 addChild( new KexiDBDriverManager() );
00054 }
00055
00056 KexiDBModule::~KexiDBModule()
00057 {
00058
00059 }
00060
00061 const QString KexiDBModule::getClassName() const
00062 {
00063 return "Kross::KexiDB::KexiDBModule";
00064 }
00065
00066 Kross::Api::Object::Ptr KexiDBModule::get(const QString& name, void* p)
00067 {
00068 if(name == "KexiDBConnection") {
00069 ::KexiDB::Connection* connection = (::KexiDB::Connection*)p;
00070 if(connection)
00071 return new KexiDBConnection(connection);
00072 }
00073 return 0;
00074 }
|