connectiondata.h
Go to the documentation of this file.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 <qobject.h> 00024 #include <qstring.h> 00025 #include <qptrlist.h> 00026 00027 namespace KexiDB { 00028 00036 class ConnectionDataBase 00037 { 00038 public: 00039 ConnectionDataBase(); 00040 00047 QString caption; 00048 00052 QString description; 00053 00061 int id; 00062 00074 QString driverName; 00075 00081 QString hostName; 00082 00088 unsigned short int port; 00089 00100 bool useLocalSocketFile; 00101 00108 QString localSocketFileName; 00109 00116 QString password; 00117 00125 bool savePassword; 00126 00131 QString userName; 00132 00133 protected: 00140 QString m_fileName; 00141 00147 QString m_dbPath; 00148 00154 QString m_dbFileName; 00155 }; 00156 00158 00160 class KEXI_DB_EXPORT ConnectionData : public QObject, public ConnectionDataBase 00161 { 00162 public: 00163 typedef QPtrList<ConnectionData> List; 00164 typedef QPtrListIterator<ConnectionData> ListIterator; 00165 00166 ConnectionData(); 00167 00168 ConnectionData(const ConnectionData&); 00169 00170 ~ConnectionData(); 00171 00172 ConnectionData& operator=(const ConnectionData& cd); 00173 00181 void setFileName( const QString& fn ); 00182 00190 QString fileName() const { return m_fileName; } 00191 00197 QString dbPath() const { return m_dbPath; } 00198 00204 QString dbFileName() const { return m_dbFileName; } 00205 00219 QString serverInfoString(bool addUser = true) const; 00220 00226 uint formatVersion; 00227 00228 protected: 00229 class Private; 00230 Private *priv; 00231 00232 friend class Connection; 00233 }; 00234 00235 } //namespace KexiDB 00236 00237 #endif
