kexi

kexidbconnectiondata.h
1/***************************************************************************
2 * kexidbconnectiondata.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 ***************************************************************************/
19
20#ifndef KROSS_KEXIDB_KEXIDBCONNECTIONDATA_H
21#define KROSS_KEXIDB_KEXIDBCONNECTIONDATA_H
22
23#include <tqstring.h>
24
25#include <api/object.h>
26#include <api/variant.h>
27#include <api/list.h>
28#include <api/class.h>
29
30#include <kexidb/connection.h>
31#include <kexidb/connectiondata.h>
32
33namespace Kross { namespace KexiDB {
34
39 class KexiDBConnectionData : public Kross::Api::Class<KexiDBConnectionData>
40 {
41 friend class KexiDBDriverManager;
42 public:
43 KexiDBConnectionData(::KexiDB::ConnectionData* data);
44 virtual ~KexiDBConnectionData();
45 operator ::KexiDB::ConnectionData& () { return *m_data; }
46 operator ::KexiDB::ConnectionData* () { return m_data; }
47 virtual const TQString getClassName() const;
48 ::KexiDB::ConnectionData* data() { return m_data; }
49
50 private:
51
53 const TQString caption() const;
55 void setCaption(const TQString& name);
56
58 const TQString description() const;
60 void setDescription(const TQString& desc);
61
63 const TQString driverName() const;
65 void setDriverName(const TQString& driver);
66
68 bool localSocketFileUsed() const;
70 void setLocalSocketFileUsed(bool used);
72 const TQString localSocketFileName() const;
74 void setLocalSocketFileName(const TQString& socketfilename);
75
76 // For serverbased drivers
77
79 const TQString databaseName() const;
81 void setDatabaseName(const TQString& dbname);
82
84 const TQString hostName() const;
86 void setHostName(const TQString& hostname);
87
89 int port() const;
91 void setPort(int p);
92
94 const TQString password() const;
96 void setPassword(const TQString& passwd);
97
99 const TQString userName() const;
101 void setUserName(const TQString& username);
102
103 // For filebased drivers
104
106 const TQString fileName() const;
108 void setFileName(const TQString& filename);
109
111 const TQString dbPath() const;
113 const TQString dbFileName() const;
114
116 const TQString serverInfoString() const;
117
118 private:
120 TQString m_dbname;
121 };
122
123}}
124
125#endif
126
Database specific connection data, e.g. host, port.
KrossKexiDB provides access to the KexiDB database functionality.