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

« back to all changes in this revision

Viewing changes to kexi/kexidb/drivermanager.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
/* This file is part of the KDE project
 
2
   Copyright (C) 2003 Daniel Molkentin <molkentin@kde.org>
 
3
   Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
 
4
   Copyright (C) 2003-2006 Jarosław Staniek <staniek@kde.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
 
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
   Library General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU Library General Public License
 
17
   along with this program; see the file COPYING.  If not, write to
 
18
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
 
20
*/
 
21
 
 
22
#ifndef KEXIDB_DRIVER_MNGR_H
 
23
#define KEXIDB_DRIVER_MNGR_H
 
24
 
 
25
#include <klibloader.h>
 
26
#include <kservice.h>
 
27
 
 
28
#include "driver.h"
 
29
 
 
30
namespace KexiDB
 
31
{
 
32
 
 
33
class DriverManagerInternal;
 
34
class Connection;
 
35
 
 
36
//! Database driver management, e.g. finding and loading drivers.
 
37
class KEXI_DB_EXPORT DriverManager : public QObject, public KexiDB::Object
 
38
{
 
39
public:
 
40
    typedef QHash<QString, KService::Ptr> ServicesHash;
 
41
 
 
42
    DriverManager();
 
43
    virtual ~DriverManager();
 
44
 
 
45
    /*! Tries to load db driver with named name \a name.
 
46
      The name is case insensitive.
 
47
      \return db driver, or 0 if error (then error message is also set) */
 
48
    Driver* driver(const QString& name);
 
49
 
 
50
    /*! returns list of available drivers names.
 
51
      That drivers can be loaded by first use of driver() method. */
 
52
    const QStringList driverNames();
 
53
 
 
54
    /*! returns information list of available drivers.
 
55
      That drivers can be loaded by first use of driver() method. */
 
56
    const KexiDB::Driver::InfoHash driversInfo();
 
57
 
 
58
    /*! \return information about driver's named with \a name.
 
59
      The name is case insensitive.
 
60
      You can check if driver information is not found calling
 
61
      Info::name.isEmpty() (then error message is also set). */
 
62
    KexiDB::Driver::Info driverInfo(const QString &name);
 
63
 
 
64
    /*! \return service information about driver's named with \a name.
 
65
      The name is case insensitive.
 
66
      In most cases you can use driverInfo() instead. */
 
67
    KService::Ptr serviceInfo(const QString &name);
 
68
 
 
69
    /*! \return a hash structure of the services. Not necessary for everyday use. */
 
70
    const ServicesHash& services();
 
71
 
 
72
    /*! Looks up a drivers list by MIME type of database file.
 
73
     Only file-based database drivers are checked.
 
74
     The lookup is case insensitive.
 
75
     \return driver name or null string if no driver found.
 
76
    */
 
77
    QString lookupByMime(const QString &mimeType);
 
78
 
 
79
    //! server error is set if there is error at KService level (useful for debugging)
 
80
    virtual QString serverErrorMsg();
 
81
    virtual int serverResult();
 
82
    virtual QString serverResultName();
 
83
 
 
84
    /*! HTML information about possible problems encountered.
 
85
     It's displayed in 'details' section, if an error encountered.
 
86
     Currently it contains a list of incompatible db drivers.
 
87
     Used in KexiStartupHandler::detectDriverForFile(). */
 
88
    QString possibleProblemsInfoMsg() const;
 
89
 
 
90
protected:
 
91
    virtual void drv_clearServerResult();
 
92
 
 
93
private:
 
94
    DriverManagerInternal *d_int;
 
95
};
 
96
 
 
97
} //namespace KexiDB
 
98
 
 
99
#endif