1
/***************************************************************************
2
* kexidbconnectiondata.h
3
* This file is part of the KDE project
4
* copyright (C)2004-2006 by Sebastian Sauer (mail@dipe.org)
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
***************************************************************************/
20
#ifndef SCRIPTING_KEXIDBCONNECTIONDATA_H
21
#define SCRIPTING_KEXIDBCONNECTIONDATA_H
26
#include <kexidb/connection.h>
27
#include <kexidb/connectiondata.h>
33
* A KexiDBConnectionData is used to store the details needed for
34
* a connection with a database.
36
class KexiDBConnectionData : public QObject
40
KexiDBConnectionData(QObject* parent, ::KexiDB::ConnectionData* data, bool owner);
41
virtual ~KexiDBConnectionData();
42
::KexiDB::ConnectionData* data() {
48
/** Return the connection name. */
49
const QString caption() const;
50
/** Set the connection name. */
51
void setCaption(const QString& name);
53
/** Return the description. */
54
const QString description() const;
55
/** Set the description. */
56
void setDescription(const QString& desc);
58
/** Return drivername. */
59
const QString driverName() const;
60
/** Set the drivername. */
61
void setDriverName(const QString& driver);
63
/** Return true if a local socket file is used else false. */
64
bool localSocketFileUsed() const;
65
/** Set if the local socket file should be used. */
66
void setLocalSocketFileUsed(bool used);
67
/** Return the local socket filename. */
68
const QString localSocketFileName() const;
69
/** Set the local socket filename. */
70
void setLocalSocketFileName(const QString& socketfilename);
72
// For serverbased drivers
74
/** Return the database name. */
75
const QString databaseName() const;
76
/** Set the database name. */
77
void setDatabaseName(const QString& dbname);
79
/** Return the hostname. */
80
const QString hostName() const;
81
/** Set the hostname. */
82
void setHostName(const QString& hostname);
84
/** Return the port number. */
86
/** Set the port number. */
89
/** Return the password. */
90
const QString password() const;
91
/** Set the password. */
92
void setPassword(const QString& passwd);
94
/** Return the username. */
95
const QString userName() const;
96
/** Set the username. */
97
void setUserName(const QString& username);
99
// For filebased drivers
101
/** Return the filename. */
102
const QString fileName() const;
103
/** Set the filename. */
104
void setFileName(const QString& filename);
106
/** Return the database path. */
107
const QString dbPath() const;
108
/** Return the database filename. */
109
const QString dbFileName() const;
111
/** Return a user-friendly string representation. */
112
const QString serverInfoString() const;
115
::KexiDB::ConnectionData* m_data;