~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kexi/plugins/scripting/kexidb/kexidbconnectiondata.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 * kexidbconnectiondata.h
 
3
 * This file is part of the KDE project
 
4
 * copyright (C)2004-2006 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 SCRIPTING_KEXIDBCONNECTIONDATA_H
 
21
#define SCRIPTING_KEXIDBCONNECTIONDATA_H
 
22
 
 
23
#include <qstring.h>
 
24
#include <qobject.h>
 
25
 
 
26
#include <kexidb/connection.h>
 
27
#include <kexidb/connectiondata.h>
 
28
 
 
29
namespace Scripting
 
30
{
 
31
 
 
32
/**
 
33
 * A KexiDBConnectionData is used to store the details needed for
 
34
 * a connection with a database.
 
35
 */
 
36
class KexiDBConnectionData : public QObject
 
37
{
 
38
    Q_OBJECT
 
39
public:
 
40
    KexiDBConnectionData(QObject* parent, ::KexiDB::ConnectionData* data, bool owner);
 
41
    virtual ~KexiDBConnectionData();
 
42
    ::KexiDB::ConnectionData* data() {
 
43
        return m_data;
 
44
    }
 
45
 
 
46
public slots:
 
47
 
 
48
    /** Return the connection name. */
 
49
    const QString caption() const;
 
50
    /** Set the connection name. */
 
51
    void setCaption(const QString& name);
 
52
 
 
53
    /** Return the description. */
 
54
    const QString description() const;
 
55
    /** Set the description. */
 
56
    void setDescription(const QString& desc);
 
57
 
 
58
    /** Return drivername. */
 
59
    const QString driverName() const;
 
60
    /** Set the drivername. */
 
61
    void setDriverName(const QString& driver);
 
62
 
 
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);
 
71
 
 
72
    // For serverbased drivers
 
73
 
 
74
    /** Return the database name. */
 
75
    const QString databaseName() const;
 
76
    /** Set the database name. */
 
77
    void setDatabaseName(const QString& dbname);
 
78
 
 
79
    /** Return the hostname. */
 
80
    const QString hostName() const;
 
81
    /** Set the hostname. */
 
82
    void setHostName(const QString& hostname);
 
83
 
 
84
    /** Return the port number. */
 
85
    int port() const;
 
86
    /** Set the port number. */
 
87
    void setPort(int p);
 
88
 
 
89
    /** Return the password. */
 
90
    const QString password() const;
 
91
    /** Set the password. */
 
92
    void setPassword(const QString& passwd);
 
93
 
 
94
    /** Return the username. */
 
95
    const QString userName() const;
 
96
    /** Set the username. */
 
97
    void setUserName(const QString& username);
 
98
 
 
99
    // For filebased drivers
 
100
 
 
101
    /** Return the filename. */
 
102
    const QString fileName() const;
 
103
    /** Set the filename. */
 
104
    void setFileName(const QString& filename);
 
105
 
 
106
    /** Return the database path. */
 
107
    const QString dbPath() const;
 
108
    /** Return the database filename. */
 
109
    const QString dbFileName() const;
 
110
 
 
111
    /** Return a user-friendly string representation. */
 
112
    const QString serverInfoString() const;
 
113
 
 
114
private:
 
115
    ::KexiDB::ConnectionData* m_data;
 
116
    QString m_dbname;
 
117
    bool m_owner;
 
118
};
 
119
 
 
120
}
 
121
 
 
122
#endif
 
123