File indexing completed on 2024-05-12 16:40:15
0001 /* This file is part of the KDE project 0002 Copyright (C) 2004 Adam Pigg <adam@piggz.co.uk> 0003 Copyright (C) 2004 Jarosław Staniek <staniek@kde.org> 0004 Copyright (C) 2005 Martin Ellis <kde@martinellis.co.uk> 0005 0006 This program is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU Library General Public 0008 License as published by the Free Software Foundation; either 0009 version 2 of the License, or (at your option) any later version. 0010 0011 This program is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Library General Public License for more details. 0015 0016 You should have received a copy of the GNU Library General Public License 0017 along with this program; see the file COPYING. If not, write to 0018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 * Boston, MA 02110-1301, USA. 0020 */ 0021 0022 #ifndef KEXI_MIGRATE_DATA_H 0023 #define KEXI_MIGRATE_DATA_H 0024 0025 #include <KDbConnection> 0026 #include "keximigrate_export.h" 0027 #include <kexiprojectdata.h> 0028 0029 namespace KexiMigration 0030 { 0031 //Use this class to store all possible options that could be used by keximigrate. 0032 //The current members are not meant to be a definite set, for example, i envisage 0033 //adding table/field lists if we allow only importing certain tables/fields 0034 class KEXIMIGRATE_EXPORT Data 0035 { 0036 public: 0037 Data(); 0038 ~Data(); 0039 0040 QString sourceDatabaseInfoString() const; 0041 0042 //! Connection data for the source database 0043 KDbConnectionData* source; 0044 0045 //! Name of the source database 0046 QString sourceName; 0047 0048 //! @return destination project data 0049 KexiProjectData* destinationProjectData(); 0050 0051 //! @overload KexiProjectData* destinationProjectData() 0052 const KexiProjectData* destinationProjectData() const; 0053 0054 //! Sets destination project data to @a destinationProjectData. 0055 //! The object wil be owned by KexiMigration::Data. 0056 //! Previous project data other than @a destinationProjectData will be deleted. 0057 void setDestinationProjectData(KexiProjectData* destinationProjectData); 0058 0059 //! @return @c true if not only structure should be migrated but also data 0060 bool shouldCopyData() const; 0061 0062 //! Sets flag that determines if not only structure should be migrated but also data 0063 void setShouldCopyData(bool set); 0064 0065 private: 0066 class Private; 0067 Private * const d; 0068 Q_DISABLE_COPY(Data) 0069 }; 0070 }//namespace KexiMigration 0071 #endif