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

« back to all changes in this revision

Viewing changes to kexi/migration/xbase/xbasemigrate.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) 2008 Sharan Rao <sharanrao@gmail.com>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Library General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Library General Public License for more details.
 
13
 
 
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 XBASEMIGRATE_H
 
21
#define XBASEMIGRATE_H
 
22
 
 
23
#include <QHash>
 
24
 
 
25
#include <migration/keximigrate.h>
 
26
#include <migration/keximigrate_p.h>
 
27
#include "xbase.h"
 
28
 
 
29
namespace KexiMigration
 
30
{
 
31
 
 
32
class xBaseMigrate : public KexiMigrate, protected xbXBase
 
33
{
 
34
  Q_OBJECT
 
35
  KEXIMIGRATION_DRIVER
 
36
 
 
37
  public:
 
38
    xBaseMigrate(QObject *parent, const QVariantList& args = QVariantList());
 
39
    virtual ~xBaseMigrate();
 
40
    
 
41
  protected:
 
42
    //! Driver specific function to return table names
 
43
    virtual bool drv_tableNames(QStringList& tablenames);
 
44
    
 
45
    //! Driver specific implementation to read a table schema
 
46
    virtual bool drv_readTableSchema(
 
47
      const QString& originalName, KexiDB::TableSchema& tableSchema);
 
48
    
 
49
    //! Driver specific connection implementation
 
50
    virtual bool drv_connect();
 
51
    
 
52
    virtual bool drv_disconnect();
 
53
 
 
54
    virtual bool drv_copyTable(const QString& srcTable, 
 
55
      KexiDB::Connection *destConn, KexiDB::TableSchema* dstTable);
 
56
 
 
57
//TODO: move this somewhere to low level class (MIGRATION?)
 
58
//                      virtual bool drv_getTablesList( QStringList &list );
 
59
//TODO: move this somewhere to low level class (MIGRATION?)
 
60
//                      virtual bool drv_containsTable( const QString &tableName );
 
61
 
 
62
 
 
63
  private:
 
64
    KexiDB::Field::Type type(char xBaseColumnType);
 
65
 
 
66
    //! Sets and existing constraints on the field
 
67
    void getConstraints(const QString& tableName, KexiDB::Field* fld);
 
68
 
 
69
    //! Returns a list of index files corresponding to the specific fieldName
 
70
    QStringList getIndexFileNames(const QString& tableName, const QString& fieldName);
 
71
 
 
72
    //! Mapping tableNames to actual absoolute file name paths
 
73
    //  XBase only deals with absolute names ( with the .dbf extension ) which is pretty cumbersome
 
74
    QHash<QString,QString> m_tableNamePathMap;
 
75
    
 
76
};
 
77
}
 
78
 
 
79
#endif