kexi
connectiondata.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Jaroslaw Staniek <js@iidea.pl> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 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 KEXIDB_CONNECTION_DATA_H 00021 #define KEXIDB_CONNECTION_DATA_H 00022 00023 #include <kexidb/kexidb_export.h> 00024 00025 #include <qobject.h> 00026 #include <qstring.h> 00027 #include <qptrlist.h> 00028 00029 namespace KexiDB { 00030 00038 class ConnectionDataBase 00039 { 00040 public: 00041 ConnectionDataBase(); 00042 00049 QString caption; 00050 00054 QString description; 00055 00063 int id; 00064 00076 QString driverName; 00077 00083 QString hostName; 00084 00090 unsigned short int port; 00091 00102 bool useLocalSocketFile; 00103 00110 QString localSocketFileName; 00111 00118 QString password; 00119 00127 bool savePassword; 00128 00133 QString userName; 00134 00135 protected: 00142 QString m_fileName; 00143 00149 QString m_dbPath; 00150 00156 QString m_dbFileName; 00157 }; 00158 00160 00162 class KEXI_DB_EXPORT ConnectionData : public QObject, public ConnectionDataBase 00163 { 00164 public: 00165 typedef QPtrList<ConnectionData> List; 00166 typedef QPtrListIterator<ConnectionData> ListIterator; 00167 00168 ConnectionData(); 00169 00170 ConnectionData(const ConnectionData&); 00171 00172 ~ConnectionData(); 00173 00174 ConnectionData& operator=(const ConnectionData& cd); 00175 00183 void setFileName( const QString& fn ); 00184 00192 QString fileName() const { return m_fileName; } 00193 00199 QString dbPath() const { return m_dbPath; } 00200 00206 QString dbFileName() const { return m_dbFileName; } 00207 00221 QString serverInfoString(bool addUser = true) const; 00222 00228 uint formatVersion; 00229 00230 protected: 00231 class Private; 00232 Private *priv; 00233 00234 friend class Connection; 00235 }; 00236 00237 } //namespace KexiDB 00238 00239 #endif