kexi

kexidbconnectiondata.h

00001 /***************************************************************************
00002  * kexidbconnectiondata.h
00003  * This file is part of the KDE project
00004  * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #ifndef KROSS_KEXIDB_KEXIDBCONNECTIONDATA_H
00021 #define KROSS_KEXIDB_KEXIDBCONNECTIONDATA_H
00022 
00023 #include <qstring.h>
00024 
00025 #include <api/object.h>
00026 #include <api/variant.h>
00027 #include <api/list.h>
00028 #include <api/class.h>
00029 
00030 #include <kexidb/connection.h>
00031 #include <kexidb/connectiondata.h>
00032 
00033 namespace Kross { namespace KexiDB {
00034 
00039     class KexiDBConnectionData : public Kross::Api::Class<KexiDBConnectionData>
00040     {
00041             friend class KexiDBDriverManager;
00042         public:
00043             KexiDBConnectionData(::KexiDB::ConnectionData* data);
00044             virtual ~KexiDBConnectionData();
00045             operator ::KexiDB::ConnectionData& () { return *m_data; }
00046             operator ::KexiDB::ConnectionData* () { return m_data; }
00047             virtual const QString getClassName() const;
00048             ::KexiDB::ConnectionData* data() { return m_data; }
00049 
00050         private:
00051 
00053             const QString caption() const;
00055             void setCaption(const QString& name);
00056 
00058             const QString description() const;
00060             void setDescription(const QString& desc);
00061 
00063             const QString driverName() const;
00065             void setDriverName(const QString& driver);
00066 
00068             bool localSocketFileUsed() const;
00070             void setLocalSocketFileUsed(bool used);
00072             const QString localSocketFileName() const;
00074             void setLocalSocketFileName(const QString& socketfilename);
00075 
00076             // For serverbased drivers
00077 
00079             const QString databaseName() const;
00081             void setDatabaseName(const QString& dbname);
00082 
00084             const QString hostName() const;
00086             void setHostName(const QString& hostname);
00087 
00089             int port() const;
00091             void setPort(int p);
00092 
00094             const QString password() const;
00096             void setPassword(const QString& passwd);
00097 
00099             const QString userName() const;
00101             void setUserName(const QString& username);
00102 
00103             // For filebased drivers
00104 
00106             const QString fileName() const;
00108             void setFileName(const QString& filename);
00109 
00111             const QString dbPath() const;
00113             const QString dbFileName() const;
00114 
00116             const QString serverInfoString() const;
00117 
00118         private:
00119             ::KexiDB::ConnectionData* m_data;
00120             QString m_dbname;
00121     };
00122 
00123 }}
00124 
00125 #endif
00126 
KDE Home | KDE Accessibility Home | Description of Access Keys